Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deployment/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ services:
- ../../documentation/src/main/resources/openapi:/usr/share/nginx/html/openapi:ro
- ../../documentation/src/main/resources/images:/usr/share/nginx/html/images:ro
- ./swagger3-index.html:/usr/share/nginx/html/index.html:ro
- ../helm/ditto/swaggerui-config/swagger-oidc.js:/usr/share/nginx/html/swagger-oidc.js:ro
command: nginx -g 'daemon off;'
logging:
options:
Expand Down
68 changes: 30 additions & 38 deletions deployment/docker/swagger3-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,47 +42,39 @@

<script src="./swagger-ui-bundle.js"> </script>
<script src="./swagger-ui-standalone-preset.js"> </script>
<script src="./swagger-oidc.js"> </script>
<script>
window.onload = function() {

const ui = SwaggerUIBundle({
urls: [
{url: "/apidoc/openapi/ditto-api-2.yml", name:"Ditto API v2"}
],
"urls.primaryName": "Ditto API v2",
validatorUrl: null,
docExpansion: "none",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout",
oauth2RedirectUrl: window.location.origin + "/apidoc/oauth2-redirect.html",
onComplete: function () {
ui.preauthorizeBasic("NginxBasic", "ditto", "ditto");
}
});

ui.initOAuth({
clientId: "853201765597-7nmcpg90krhogd9375dl44sse4tup0gj.apps.googleusercontent.com",
clientSecret: "<leave that empty>",
realm: "eclipse-ditto",
appName: "Eclipse Ditto :: Sandbox",
scopeSeparator: " ",
scopes: "openid",
additionalQueryStringParams: {
}
});

window.ui = ui;
window.onload = async function() {
const isApidoc = window.location.pathname.startsWith("/apidoc");
const openApiPath = isApidoc ? "/apidoc/openapi/ditto-api-2.yml" : "/openapi/ditto-api-2.yml";
const oauth2RedirectPath = isApidoc ? "/apidoc/oauth2-redirect.html" : "/oauth2-redirect.html";
await SwaggerOidc.initSwaggerUiWithOidc({
specUrl: openApiPath,
openApiFileName: "ditto-api-2.yml",
oauth2RedirectPath: oauth2RedirectPath,
preauthorizeBasic: {
name: "NginxBasic",
username: "ditto",
password: "ditto"
},
oauth: {
mode: "always",
useOidcClientId: true,
useOidcScopes: true,
config: {
clientId: "",
realm: "eclipse-ditto",
appName: "Eclipse Ditto",
scopeSeparator: " ",
scopes: "openid",
usePkceWithAuthorizationCodeGrant: true,
additionalQueryStringParams: {
}
}
}
});
}
</script>
</body>

</html>

2 changes: 1 addition & 1 deletion deployment/helm/ditto/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ description: |
A digital twin is a virtual, cloud based, representation of his real world counterpart
(real world “Things”, e.g. devices like sensors, smart heating, connected cars, smart grids, EV charging stations etc).
type: application
version: 3.8.13 # chart version is effectively set by release-job
version: 3.8.14 # chart version is effectively set by release-job
appVersion: 3.8.11
keywords:
- iot-chart
Expand Down
45 changes: 20 additions & 25 deletions deployment/helm/ditto/swaggerui-config/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,34 +41,29 @@

<script src="./swagger-ui-bundle.js"> </script>
<script src="./swagger-ui-standalone-preset.js"> </script>
<script src="./swagger-oidc.js"> </script>
<script>
window.onload = function() {

const ui = SwaggerUIBundle({
urls: [
{url: "./openapi/ditto-api-2.yml", name:"Ditto API v2"}
],
"urls.primaryName": "Ditto API v2",
validatorUrl: null,
docExpansion: "none",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout",
oauth2RedirectUrl: window.location.origin + "./oauth2-redirect.html",
onComplete: function () {
}
});
window.ui = ui;
window.onload = async function() {
await SwaggerOidc.initSwaggerUiWithOidc({
urls: [{url: "./openapi/ditto-api-2.yml", name:"Ditto API v2"}],
primaryName: "Ditto API v2",
openApiFileName: "ditto-api-2.yml",
oauth2RedirectPath: "/apidoc/oauth2-redirect.html",
oauth: {
mode: "whenClientId",
useOidcClientId: true,
useOidcScopes: true,
config: {
clientId: "",
appName: "Eclipse Ditto :: Swagger UI",
scopeSeparator: " ",
scopes: "openid",
usePkceWithAuthorizationCodeGrant: true
}
}
});
}
</script>
</body>

</html>

Loading
Loading