Skip to content

Commit

Permalink
RESTful service: List Web Applications - Suppress Keycloak Client ID …
Browse files Browse the repository at this point in the history
…for local Web Services #2101
  • Loading branch information
vrindanayak committed Jul 30, 2019
1 parent a146497 commit 118dff3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public Response listWebApps() {
JsonGenerator gen = Json.createGenerator(out);
gen.writeStartArray();
for (WebApplicationInfo webappInfo : webappInfos)
jsonConf.writeTo(webappInfo, gen);
jsonConf.writeTo(webappInfo, gen, keycloakClientID(webappInfo));
gen.writeEnd();
gen.flush();
}).build();
Expand All @@ -204,6 +204,15 @@ public Response listWebApps() {
}
}

private String keycloakClientID(WebApplicationInfo webAppInfo) {
String authURL = System.getProperty("auth-server-url");
KeycloakClient keycloakClient = webAppInfo.getKeycloakClient();
return keycloakClient == null || authURL == null
|| (authURL.equals(keycloakClient.getKeycloakServerURL())
&& System.getProperty("realm-name", "dcm4che").equals(keycloakClient.getKeycloakRealm()))
? null : webAppInfo.getKeycloakClientID();
}

@GET
@NoCache
@Path("/hl7apps")
Expand Down Expand Up @@ -633,6 +642,9 @@ private static WebApplicationInfo toWebApplicationInfo(UriInfo info) {
case "dicomApplicationCluster":
webappInfo.setApplicationClusters(toArray(value));
break;
case "dcmKeycloakClientID":
webappInfo.setKeycloakClientID(firstValueOf(value));
break;
}
});
return webappInfo;
Expand Down
11 changes: 11 additions & 0 deletions dcm4chee-arc-ui2/src/swagger/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3166,6 +3166,9 @@
{
"$ref": "#/components/parameters/dicomAETitle"
},
{
"$ref": "#/components/parameters/dcmKeycloakClientID"
},
{
"$ref": "#/components/parameters/dicomApplicationCluster"
}
Expand Down Expand Up @@ -13448,6 +13451,14 @@
"type": "string"
}
},
"dcmKeycloakClientID": {
"name": "dcmKeycloakClientID",
"in": "query",
"description": "Keycloak Client ID",
"schema": {
"type": "string"
}
},
"dicomManufacturer": {
"name": "dicomManufacturer",
"in": "query",
Expand Down

0 comments on commit 118dff3

Please sign in to comment.