From 3a905ef1cbd1550dcb291a31766936511dc507b9 Mon Sep 17 00:00:00 2001 From: pujavs <43700552+pujavs@users.noreply.github.com> Date: Thu, 1 Dec 2022 02:34:38 +0530 Subject: [PATCH] test(config-api): fixed incorrect value for emailVerified in test script (#3128) * fix(config-api): agama string format * fix(config-api): test json fix for boolean value * fix(config-api): test json fix for boolean value --- .../docs/jans-config-api-swagger-auto.yaml | 268 ++++++------------ .../feature/mgt/user/user-patch.json | 6 +- .../test/resources/feature/mgt/user/user.json | 6 +- .../service/auth/AgamaFlowService.java | 2 +- .../openid-clients-get-all.json | 162 +++-------- .../openid-clients/openid-clients-get.json | 18 +- 6 files changed, 139 insertions(+), 323 deletions(-) diff --git a/jans-config-api/docs/jans-config-api-swagger-auto.yaml b/jans-config-api/docs/jans-config-api-swagger-auto.yaml index 2b3b83113f0..9825ae9b5c1 100644 --- a/jans-config-api/docs/jans-config-api-swagger-auto.yaml +++ b/jans-config-api/docs/jans-config-api-swagger-auto.yaml @@ -1666,19 +1666,11 @@ paths: "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Config Api Client" - }, - "value": "Jans Config Api Client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Config Api Client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -1786,19 +1778,11 @@ paths: "refresh_token" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Config Api Client" - }, - "value": "Jans Config Api Client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Config Api Client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -1901,19 +1885,11 @@ paths: "client_credentials" ], "applicationType": "native", - "clientName": { - "values": { - "": "SCIM client" - }, - "value": "SCIM client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "SCIM client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "tokenEndpointAuthMethod": "client_secret_basic", "scopes": [ @@ -1984,19 +1960,11 @@ paths: "urn:ietf:params:oauth:grant-type:device_code" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Role Based Client" - }, - "value": "Jans Role Based Client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Role Based Client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "idTokenSignedResponseAlg": "RS256", "userInfoSignedResponseAlg": "RS256", @@ -2077,19 +2045,11 @@ paths: "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Test Client (don't remove)" - }, - "value": "Jans Test Client (don't remove)", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Test Client (don't remove)", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "public", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -2157,19 +2117,11 @@ paths: "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Test Resource Server Client (don't remove)" - }, - "value": "Jans Test Resource Server Client (don't remove)", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Test Resource Server Client (don't remove)", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "public", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -2230,19 +2182,11 @@ paths: "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Test Requesting Party Client (don't remove)" - }, - "value": "Jans Test Requesting Party Client (don't remove)", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Test Requesting Party Client (don't remove)", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "public", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -2297,19 +2241,11 @@ paths: "authorization_code" ], "applicationType": "web", - "clientName": { - "values": { - "": "test1234" - }, - "value": "test1234", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "test1234", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "public", "tokenEndpointAuthMethod": "client_secret_basic", "scopes": [ @@ -2371,19 +2307,11 @@ paths: "authorization_code" ], "applicationType": "web", - "clientName": { - "values": { - "": "test12345" - }, - "value": "test12345", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "test12345", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "public", "tokenEndpointAuthMethod": "client_secret_basic", "scopes": [ @@ -2548,19 +2476,11 @@ paths: "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Config Api Client" - }, - "value": "Jans Config Api Client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Config Api Client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -2770,19 +2690,11 @@ paths: "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Config Api Client" - }, - "value": "Jans Config Api Client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Config Api Client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -2925,19 +2837,11 @@ paths: "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Config Api Client" - }, - "value": "Jans Config Api Client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Config Api Client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -3116,19 +3020,11 @@ paths: "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Config Api Client" - }, - "value": "Jans Config Api Client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Config Api Client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -7185,19 +7081,19 @@ components: $ref: '#/components/schemas/AttributeValidation' tooltip: type: string - adminCanEdit: + whitePagesCanView: type: boolean - userCanEdit: + userCanView: type: boolean - adminCanView: + userCanEdit: type: boolean - userCanView: + userCanAccess: type: boolean adminCanAccess: type: boolean - userCanAccess: + adminCanView: type: boolean - whitePagesCanView: + adminCanEdit: type: boolean baseDn: type: string @@ -8350,15 +8246,6 @@ components: $ref: '#/components/schemas/EngineConfig' ssaConfiguration: $ref: '#/components/schemas/SsaConfiguration' - allResponseTypesSupported: - uniqueItems: true - type: array - items: - type: string - enum: - - code - - token - - id_token enabledFeatureFlags: uniqueItems: true type: array @@ -8386,6 +8273,15 @@ components: - STAT - PAR - SSA + allResponseTypesSupported: + uniqueItems: true + type: array + items: + type: string + enum: + - code + - token + - id_token fapi: type: boolean AuthenticationFilter: @@ -8644,13 +8540,13 @@ components: type: boolean internal: type: boolean - locationPath: - type: string locationType: type: string enum: - ldap - file + locationPath: + type: string baseDn: type: string ScriptError: diff --git a/jans-config-api/plugins/user-mgt-plugin/src/test/resources/feature/mgt/user/user-patch.json b/jans-config-api/plugins/user-mgt-plugin/src/test/resources/feature/mgt/user/user-patch.json index cbcde1c6a7f..eef49548448 100644 --- a/jans-config-api/plugins/user-mgt-plugin/src/test/resources/feature/mgt/user/user-patch.json +++ b/jans-config-api/plugins/user-mgt-plugin/src/test/resources/feature/mgt/user/user-patch.json @@ -4,10 +4,10 @@ "name": "emailVerified", "multiValued": false, "values": [ - "TRUE" + true ], - "value": "TRUE", - "displayValue": "TRUE" + "value": true, + "displayValue": true }, { "name": "secretAnswer", diff --git a/jans-config-api/plugins/user-mgt-plugin/src/test/resources/feature/mgt/user/user.json b/jans-config-api/plugins/user-mgt-plugin/src/test/resources/feature/mgt/user/user.json index 62cee2f9026..b3fb18928d1 100644 --- a/jans-config-api/plugins/user-mgt-plugin/src/test/resources/feature/mgt/user/user.json +++ b/jans-config-api/plugins/user-mgt-plugin/src/test/resources/feature/mgt/user/user.json @@ -14,10 +14,10 @@ "name": "emailVerified", "multiValued": false, "values": [ - "TRUE" + true ], - "value": "TRUE", - "displayValue": "TRUE" + "value": true, + "displayValue": true }, { "name": "jansAdminUIRole", diff --git a/jans-config-api/server/src/main/java/io/jans/configapi/service/auth/AgamaFlowService.java b/jans-config-api/server/src/main/java/io/jans/configapi/service/auth/AgamaFlowService.java index 186176753f6..08eb155a675 100644 --- a/jans-config-api/server/src/main/java/io/jans/configapi/service/auth/AgamaFlowService.java +++ b/jans-config-api/server/src/main/java/io/jans/configapi/service/auth/AgamaFlowService.java @@ -145,7 +145,7 @@ public String getAgamaFlowDn(String flowName) { if (StringUtils.isBlank(flowName)) { return AGAMA_FLOWS_BASE; } - return String.format(String.format("%s=%s,%s", Flow.ATTR_NAMES.QNAME, flowName, AGAMA_FLOWS_BASE)); + return String.format(String.format("%s,%s", Flow.ATTR_NAMES.QNAME, flowName, AGAMA_FLOWS_BASE)); } public AgamaConfiguration getAgamaConfiguration() { diff --git a/jans-config-api/server/src/main/resources/example/openid-clients/openid-clients-get-all.json b/jans-config-api/server/src/main/resources/example/openid-clients/openid-clients-get-all.json index a4326e3a16c..52d1df2640e 100644 --- a/jans-config-api/server/src/main/resources/example/openid-clients/openid-clients-get-all.json +++ b/jans-config-api/server/src/main/resources/example/openid-clients/openid-clients-get-all.json @@ -21,19 +21,11 @@ "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Config Api Client" - }, - "value": "Jans Config Api Client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Config Api Client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -141,19 +133,11 @@ "refresh_token" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Config Api Client" - }, - "value": "Jans Config Api Client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Config Api Client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -256,19 +240,11 @@ "client_credentials" ], "applicationType": "native", - "clientName": { - "values": { - "": "SCIM client" - }, - "value": "SCIM client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "SCIM client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "tokenEndpointAuthMethod": "client_secret_basic", "scopes": [ @@ -339,19 +315,11 @@ "urn:ietf:params:oauth:grant-type:device_code" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Role Based Client" - }, - "value": "Jans Role Based Client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Role Based Client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "idTokenSignedResponseAlg": "RS256", "userInfoSignedResponseAlg": "RS256", @@ -432,19 +400,11 @@ "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Test Client (don't remove)" - }, - "value": "Jans Test Client (don't remove)", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Test Client (don't remove)", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "public", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -512,19 +472,11 @@ "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Test Resource Server Client (don't remove)" - }, - "value": "Jans Test Resource Server Client (don't remove)", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Test Resource Server Client (don't remove)", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "public", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -585,19 +537,11 @@ "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Test Requesting Party Client (don't remove)" - }, - "value": "Jans Test Requesting Party Client (don't remove)", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Test Requesting Party Client (don't remove)", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "public", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic", @@ -652,19 +596,11 @@ "authorization_code" ], "applicationType": "web", - "clientName": { - "values": { - "": "test1234" - }, - "value": "test1234", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "test1234", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "public", "tokenEndpointAuthMethod": "client_secret_basic", "scopes": [ @@ -726,19 +662,11 @@ "authorization_code" ], "applicationType": "web", - "clientName": { - "values": { - "": "test12345" - }, - "value": "test12345", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "test12345", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "public", "tokenEndpointAuthMethod": "client_secret_basic", "scopes": [ diff --git a/jans-config-api/server/src/main/resources/example/openid-clients/openid-clients-get.json b/jans-config-api/server/src/main/resources/example/openid-clients/openid-clients-get.json index 07c19388910..12ccccd6710 100644 --- a/jans-config-api/server/src/main/resources/example/openid-clients/openid-clients-get.json +++ b/jans-config-api/server/src/main/resources/example/openid-clients/openid-clients-get.json @@ -16,19 +16,11 @@ "client_credentials" ], "applicationType": "web", - "clientName": { - "values": { - "": "Jans Config Api Client" - }, - "value": "Jans Config Api Client", - "languageTags": [ - "" - ] - }, - "logoUri": {}, - "clientUri": {}, - "policyUri": {}, - "tosUri": {}, + "clientName": "Jans Config Api Client", + "logoUri": "", + "clientUri": "", + "policyUri": "", + "tosUri": "", "subjectType": "pairwise", "idTokenSignedResponseAlg": "RS256", "tokenEndpointAuthMethod": "client_secret_basic",