From 37238863430785f9afb7705d6a17f672da463176 Mon Sep 17 00:00:00 2001 From: Puja Sharma Date: Tue, 19 Apr 2022 16:56:06 +0530 Subject: [PATCH 1/3] feat(jans-config-api): jenkins build issue --- .../mgt/model/config/UserMgtConfigSource.java | 7 +- .../src/test/resources/karate.properties | 7 +- .../src/test/resources/test.properties | 79 ++----------------- .../resource/auth/ConfigBaseResource.java | 4 +- 4 files changed, 17 insertions(+), 80 deletions(-) diff --git a/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/UserMgtConfigSource.java b/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/UserMgtConfigSource.java index 81f705696f5..8b96c2d68a6 100644 --- a/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/UserMgtConfigSource.java +++ b/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/UserMgtConfigSource.java @@ -25,12 +25,14 @@ public UserMgtConfigSource() { this.loadProperties(); } + @SuppressWarnings @Override public Map getProperties() { log.debug("Getting properties"); return propertiesMap; } + @SuppressWarnings @Override public Set getPropertyNames() { log.debug("Getting Property Names"); @@ -43,11 +45,13 @@ public Set getPropertyNames() { return Collections.emptySet(); } + @SuppressWarnings @Override public int getOrdinal() { return 800; } - + + @SuppressWarnings @Override public String getValue(String name) { log.debug("UserMgtConfigSource()::getValue() - name:{}", name); @@ -65,6 +69,7 @@ public String getName() { return FILE_CONFIG; } + @SuppressWarnings private Properties loadProperties() { // Load the properties file ClassLoader loader = Thread.currentThread().getContextClassLoader(); diff --git a/jans-config-api/plugins/user-mgt-plugin/src/test/resources/karate.properties b/jans-config-api/plugins/user-mgt-plugin/src/test/resources/karate.properties index a849093586c..41c0d369aff 100644 --- a/jans-config-api/plugins/user-mgt-plugin/src/test/resources/karate.properties +++ b/jans-config-api/plugins/user-mgt-plugin/src/test/resources/karate.properties @@ -1,6 +1,5 @@ -#LOCAL -karate.test.url=http://localhost -karate.test.port=8080 +#karate.test.url=http://localhost +#karate.test.port=8080 #karate.test.url=https://jenkins-config-api.gluu.org/jans-config-api #karate.test.port=443 -#karate.test.url=https://jenkins-config-api.gluu.org +karate.test.url=${test.server} diff --git a/jans-config-api/plugins/user-mgt-plugin/src/test/resources/test.properties b/jans-config-api/plugins/user-mgt-plugin/src/test/resources/test.properties index 43b105ffc20..4257f297907 100644 --- a/jans-config-api/plugins/user-mgt-plugin/src/test/resources/test.properties +++ b/jans-config-api/plugins/user-mgt-plugin/src/test/resources/test.properties @@ -1,75 +1,8 @@ -#LOCAL -test.scopes=https://jans.io/oauth/config/acrs.readonly https://jans.io/oauth/config/acrs.write https://jans.io/oauth/config/attributes.readonly https://jans.io/oauth/config/attributes.write https://jans.io/oauth/config/attributes.delete https://jans.io/oauth/config/cache.readonly https://jans.io/oauth/config/cache.write https://jans.io/oauth/config/openid/clients.readonly https://jans.io/oauth/config/openid/clients.write https://jans.io/oauth/config/openid/clients.delete https://jans.io/oauth/jans-auth-server/config/properties.readonly https://jans.io/oauth/jans-auth-server/config/properties.write https://jans.io/oauth/config/smtp.readonly https://jans.io/oauth/config/smtp.write https://jans.io/oauth/config/smtp.delete https://jans.io/oauth/config/database/couchbase.readonly https://jans.io/oauth/config/database/couchbase.write https://jans.io/oauth/config/database/couchbase.delete https://jans.io/oauth/config/scripts.readonly https://jans.io/oauth/config/scripts.write https://jans.io/oauth/config/scripts.delete https://jans.io/oauth/config/fido2.readonly https://jans.io/oauth/config/fido2.write https://jans.io/oauth/config/jwks.readonly https://jans.io/oauth/config/jwks.write https://jans.io/oauth/config/database/ldap.readonly https://jans.io/oauth/config/database/ldap.write https://jans.io/oauth/config/database/ldap.delete https://jans.io/oauth/config/logging.readonly https://jans.io/oauth/config/logging.write https://jans.io/oauth/config/scopes.readonly https://jans.io/oauth/config/scopes.write https://jans.io/oauth/config/scopes.delete https://jans.io/oauth/config/uma/resources.readonly https://jans.io/oauth/config/uma/resources.write https://jans.io/oauth/config/uma/resources.delete https://jans.io/oauth/config/database/sql.readonly https://jans.io/oauth/config/database/sql.write https://jans.io/oauth/config/database/sql.delete https://jans.io/oauth/config/stats.readonly jans_stat https://jans.io/scim/users.read https://jans.io/scim/users.write https://jans.io/oauth/config/scim/users.read https://jans.io/oauth/config/scim/users.write https://jans.io/scim/config.readonly https://jans.io/scim/config.write https://jans.io/oauth/config/organization.readonly https://jans.io/oauth/config/organization.write https://jans.io/oauth/config/user.readonly https://jans.io/oauth/config/user.write https://jans.io/oauth/config/user.delete +test.scopes=${test.scopes} # Test env Setting -#token.endpoint=https://jenkins-config-api.gluu.org/jans-auth/restv1/token -#token.grant.type=client_credentials -#test.client.id=1801.f35446a2-b9cb-40af-a26e-c1221f3ca0cb -#test.client.secret=lye8TNJmNpze -#test.issuer=https://jenkins-config-api.gluu.org - -# Local Setting -#pujavs.jans.server -#token.endpoint=https://pujavs.jans.server/jans-auth/restv1/token -#token.grant.type=client_credentials -#test.client.id=1802.9dcd98ad-fe2c-4fd9-b717-d9436d9f2009 -#test.client.secret=test1234 -#test.issuer=https://pujavs.jans.server - -# pujavs.jans.server2 -#token.endpoint=https://pujavs.jans.server2/jans-auth/restv1/token -#token.grant.type=client_credentials -#test.client.id=1801.86d83471-fe91-4522-ac47-a256956c0f23 -#test.client.secret=wndq7RoRnyqm -#test.issuer=https:// pujavs.jans.server2 - -# pujavs.jans.server5 -#token.endpoint=https://pujavs.jans.server5/jans-auth/restv1/token -#token.grant.type=client_credentials -#test.client.id=1800.0f2aeab1-efee-4b89-a7f1-570c15a68ff3 -#test.client.secret=fxa2iV1Oi0HS -#test.issuer=https:// pujavs.jans.server5 - - -# pujavs.jans.server3 -#token.endpoint=https://pujavs.jans.server2/jans-auth/restv1/token -#token.grant.type=client_credentials -#test.client.id=1801.e0396ed5-055d-4986-9afc-342373995f0e -#test.client.secret=Dk3RaLUYSdJn -#test.issuer=https:// pujavs.jans.server3 - -# jans.server1 -#token.endpoint=https://jans.server1/jans-auth/restv1/token -#token.grant.type=client_credentials -#test.client.id=1800.d166622d-6771-4d5a-8fab-555566b20091 -#test.client.secret=slkveBOhwJn5 -#test.issuer=https://jans.server1 - -# jans.server2 -#token.endpoint=https://jans.server2/jans-auth/restv1/token -#token.grant.type=client_credentials -#test.client.id=1800.5ad89818-e1c6-45ba-873d-d549dfad67a4 -#test.client.secret=9ZW2HaDakqD4 -#test.issuer=https://jans.server2 - -# jans.server3 -#token.endpoint=https://jans.server3/jans-auth/restv1/token -#token.grant.type=client_credentials -#test.client.id=1800.1adcb34a-e1a5-4b4d-86d0-f92c62aab52b -#test.client.secret=aDiH4IuuGddZ -#test.issuer=https://jans.server3 - -# jans.server4 -#token.endpoint=https://jans.server4/jans-auth/restv1/token -#token.grant.type=client_credentials -#test.client.id=1800.7e78990f-fdae-40e9-9433-4fe20645851d -#test.client.secret=GfUrIapPM71X -#test.issuer=https://jans.server4 - - -# jans.server -token.endpoint=https://jans.server/jans-auth/restv1/token -token.grant.type=client_credentials -test.client.id=1800.5cfac798-9a5d-4a92-8efe-4cecc4f0c196 -test.client.secret=SSj633EttZdV -test.issuer=https://jans.server \ No newline at end of file +token.endpoint=${token.endpoint} +token.grant.type=${token.grant.type} +test.client.id=${test.client.id} +test.client.secret=${test.client.secret} +test.issuer=${test.issuer} \ No newline at end of file diff --git a/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/ConfigBaseResource.java b/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/ConfigBaseResource.java index eccf21c00c0..04e28d9a073 100644 --- a/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/ConfigBaseResource.java +++ b/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/ConfigBaseResource.java @@ -21,7 +21,7 @@ public class ConfigBaseResource extends BaseResource { @Inject - Logger log; + Logger logger; @Inject ConfigurationFactory configurationFactory; @@ -34,7 +34,7 @@ public class ConfigBaseResource extends BaseResource { protected static final int DEFAULT_MAX_COUNT = ApiConstants.DEFAULT_MAX_COUNT; protected int getMaxCount() { - log.trace(" MaxCount details - ApiAppConfiguration.MaxCount():{}, DEFAULT_MAX_COUNT:{} ", + logger.trace(" MaxCount details - ApiAppConfiguration.MaxCount():{}, DEFAULT_MAX_COUNT:{} ", configurationFactory.getApiAppConfiguration().getMaxCount(), DEFAULT_MAX_COUNT); return (configurationFactory.getApiAppConfiguration().getMaxCount() > 0 ? configurationFactory.getApiAppConfiguration().getMaxCount() From 9de6d709f0912b9fdd24c2279d9c9924a9e22f48 Mon Sep 17 00:00:00 2001 From: Puja Sharma Date: Tue, 19 Apr 2022 17:09:08 +0530 Subject: [PATCH 2/3] feat(jans-config-api): jenkins build issue --- .../jans/configapi/rest/resource/auth/OrganizationResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/OrganizationResource.java b/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/OrganizationResource.java index 1775d7a69c4..6c154a6b872 100644 --- a/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/OrganizationResource.java +++ b/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/OrganizationResource.java @@ -43,7 +43,7 @@ public Response getOrganization() { @Consumes(MediaType.APPLICATION_JSON_PATCH_JSON) @ProtectedApi(scopes = { ApiAccessConstants.ORG_CONFIG_WRITE_ACCESS }) public Response patchOrganization(@NotNull String pathString) throws JsonPatchException, IOException { - log.trace("Organization patch request - pathString:{} ", pathString); + logger.trace("Organization patch request - pathString:{} ", pathString); GluuOrganization organization = organizationService.getOrganization(); organization = Jackson.applyPatch(pathString, organization); organizationService.updateOrganization(organization); From 92c5ae7928891b38178f4eb13ff47d4eb29649c8 Mon Sep 17 00:00:00 2001 From: Puja Sharma Date: Tue, 19 Apr 2022 17:26:10 +0530 Subject: [PATCH 3/3] feat(jans-config-api): jenkins build issue --- .../model/config/MgmtConfiguration.java.bkp | 26 ------------------- .../mgt/model/config/UserMgtConfigSource.java | 7 +---- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/MgmtConfiguration.java.bkp diff --git a/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/MgmtConfiguration.java.bkp b/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/MgmtConfiguration.java.bkp deleted file mode 100644 index 92a0e7dfd67..00000000000 --- a/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/MgmtConfiguration.java.bkp +++ /dev/null @@ -1,26 +0,0 @@ -package io.jans.configapi.plugin.mgmt.model.config; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import org.eclipse.microprofile.config.Config; -import org.eclipse.microprofile.config.inject.ConfigProperty; - -@ApplicationScoped -public class MgmtConfiguration { - - @Inject - Config config; - - @Inject - @ConfigProperty(name = "mgmt.relative.path") - private String mgmtRelativePath; - - public String getMgmtRelativePath() { - return mgmtRelativePath; - } - - public void setMgmtRelativePath(String mgmtRelativePath) { - this.mgmtRelativePath = mgmtRelativePath; - } - -} diff --git a/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/UserMgtConfigSource.java b/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/UserMgtConfigSource.java index 8b96c2d68a6..81f705696f5 100644 --- a/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/UserMgtConfigSource.java +++ b/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/model/config/UserMgtConfigSource.java @@ -25,14 +25,12 @@ public UserMgtConfigSource() { this.loadProperties(); } - @SuppressWarnings @Override public Map getProperties() { log.debug("Getting properties"); return propertiesMap; } - @SuppressWarnings @Override public Set getPropertyNames() { log.debug("Getting Property Names"); @@ -45,13 +43,11 @@ public Set getPropertyNames() { return Collections.emptySet(); } - @SuppressWarnings @Override public int getOrdinal() { return 800; } - - @SuppressWarnings + @Override public String getValue(String name) { log.debug("UserMgtConfigSource()::getValue() - name:{}", name); @@ -69,7 +65,6 @@ public String getName() { return FILE_CONFIG; } - @SuppressWarnings private Properties loadProperties() { // Load the properties file ClassLoader loader = Thread.currentThread().getContextClassLoader();