diff --git a/server/pom.xml b/server/pom.xml index 5ee391b8..19ef416f 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -170,7 +170,7 @@ org.springdoc springdoc-openapi-starter-webmvc-ui - 2.1.0 + 2.3.0 org.bouncycastle diff --git a/server/src/main/java/access/api/ManageController.java b/server/src/main/java/access/api/ManageController.java index 3ed09b9a..71deb59f 100644 --- a/server/src/main/java/access/api/ManageController.java +++ b/server/src/main/java/access/api/ManageController.java @@ -68,12 +68,8 @@ public ResponseEntity> providerById(@PathVariable("type") En public ResponseEntity>> providers(@Parameter(hidden = true) User user) { LOG.debug("/providers"); UserPermissions.assertAuthority(user, Authority.SUPER_USER); - List> serviceProviders = manage.providers(EntityType.SAML20_SP); - List> relyingParties = manage.providers(EntityType.OIDC10_RP); - List> results = new ArrayList<>(); - results.addAll(serviceProviders); - results.addAll(relyingParties); - return ResponseEntity.ok(results); + List> providers = manage.providers(EntityType.SAML20_SP, EntityType.OIDC10_RP); + return ResponseEntity.ok(providers); } @GetMapping("applications") diff --git a/server/src/main/java/access/manage/RemoteManage.java b/server/src/main/java/access/manage/RemoteManage.java index 9baef45d..01fd85f5 100644 --- a/server/src/main/java/access/manage/RemoteManage.java +++ b/server/src/main/java/access/manage/RemoteManage.java @@ -72,7 +72,7 @@ public List> provisioning(Collection ids) { @Override public List> providersByInstitutionalGUID(String organisationGUID) { - Map baseQuery = (Map) this.queries.get("base_query"); + Map baseQuery = getBaseQuery(); baseQuery.put("metaDataFields.coin:institution_guid", organisationGUID); List serviceProviders = restTemplate.postForObject( String.format("%s/manage/api/internal/search/%s", this.url, EntityType.SAML20_SP.collectionName()), @@ -86,7 +86,7 @@ public List> providersByInstitutionalGUID(String organisatio @Override public Optional> identityProviderByInstitutionalGUID(String organisationGUID) { - Map baseQuery = (Map) this.queries.get("base_query"); + Map baseQuery = getBaseQuery(); baseQuery.put("metaDataFields.coin:institution_guid", organisationGUID); List > identityProviders = restTemplate.postForObject( String.format("%s/manage/api/internal/search/%s", this.url, EntityType.SAML20_IDP.collectionName()), @@ -95,9 +95,14 @@ public Optional> identityProviderByInstitutionalGUID(String } private List> getRemoteMetaData(String type) { - Object baseQuery = this.queries.get("base_query"); + Map baseQuery = getBaseQuery(); String url = String.format("%s/manage/api/internal/search/%s", this.url, type); return transformProvider(restTemplate.postForObject(url, baseQuery, List.class)); } + private Map getBaseQuery() { + return new HashMap<>((Map) this.queries.get("base_query")); + } + + } diff --git a/server/src/main/resources/manage/query_templates.json b/server/src/main/resources/manage/query_templates.json index 006461cf..75e9ea5e 100644 --- a/server/src/main/resources/manage/query_templates.json +++ b/server/src/main/resources/manage/query_templates.json @@ -4,4 +4,5 @@ "metaDataFields.logo:0:url", "metaDataFields.coin:application_url" ] - }} + } +}