From 095d2b00835fbe1711c1ed73810d9fb0514461ee Mon Sep 17 00:00:00 2001 From: Holash Chand Date: Mon, 8 Apr 2024 12:59:59 +0530 Subject: [PATCH 1/8] registry service environment variables changes --- .../registry/test/RegistryTestBase.java | 12 +- .../sunbirdrc/elastic/ElasticServiceImpl.java | 6 +- .../CustomJwtAuthenticationConverter.java | 18 +- .../authorization/SecurityConfig.java | 8 +- .../pojos/OAuth2Configuration.java | 2 +- ...th2Properties.java => OAuth2Resource.java} | 7 +- .../authorization/pojos/OAuth2Resources.java | 13 - .../AuthorizationFilterTest.java | 86 ---- .../CustomJwtAuthenticationConverterTest.java | 30 +- .../sunbirdrc/auth/genericiam/AdminUtil.java | 6 +- .../pojos/IdentityProviderConfiguration.java | 20 +- .../dev/sunbirdrc/plugin/DivocPDFActor.java | 4 +- .../java/dev/sunbirdrc/pojos/Response.java | 2 +- java/registry/docker-compose.yml | 7 - .../registry/app/AppStartupRunner.java | 2 +- .../registry/app/SunbirdRCApplication.java | 8 +- .../registry/config/GenericConfiguration.java | 52 +- .../registry/config/KafkaConfiguration.java | 6 +- .../registry/config/MinioClientConfig.java | 10 +- .../validation/DatabaseConfigValidator.java | 12 +- .../consumers/CreateEntityConsumer.java | 4 +- .../controller/AbstractController.java | 2 +- .../controller/FileStorageController.java | 2 +- .../RegistryAttestationPolicyController.java | 2 +- .../controller/RegistryController.java | 2 +- .../controller/RegistryEntityController.java | 4 +- .../controller/RegistrySwaggerController.java | 8 +- .../RegistryTemplateController.java | 2 +- .../controller/RegistryUtilsController.java | 2 +- .../registry/helper/EntityStateHelper.java | 6 +- .../registry/helper/RegistryHelper.java | 24 +- .../registry/helper/SignatureHelper.java | 2 +- .../service/CredentialSchemaService.java | 14 +- .../registry/service/DIDService.java | 6 +- .../registry/service/ElasticReadService.java | 2 +- .../service/ElasticSearchService.java | 12 +- .../registry/service/FileStorageService.java | 4 +- .../registry/service/NativeReadService.java | 4 +- .../registry/service/NativeSearchService.java | 10 +- .../registry/service/NotificationHelper.java | 4 +- .../registry/service/SchemaService.java | 3 +- .../registry/service/impl/AuditDBImpl.java | 6 +- .../registry/service/impl/AuditDBWriter.java | 4 +- .../registry/service/impl/AuditFileImpl.java | 2 +- .../service/impl/AuditServiceImpl.java | 8 +- .../service/impl/CertificateServiceImpl.java | 16 +- .../service/impl/EncryptionServiceImpl.java | 12 +- .../service/impl/FileEventService.java | 2 +- .../registry/service/impl/IdGenService.java | 8 +- .../service/impl/KafkaEventService.java | 2 +- .../impl/RegistryAsyncServiceImpl.java | 2 +- .../service/impl/RegistryServiceImpl.java | 17 +- .../service/impl/RetryRestTemplate.java | 12 +- .../service/impl/SignatureV1ServiceImpl.java | 10 +- .../service/impl/SignatureV2ServiceImpl.java | 18 +- .../registry/sink/JanusGraphStorage.java | 16 +- .../registry/util/EntityParenter.java | 2 +- .../registry/util/EntityTypeHandler.java | 2 +- .../src/main/resources/application.yml | 484 ++++++++---------- .../RegistryEntityControllerTest.java | 3 + .../registry/dao/impl/SearchDaoImplTest.java | 2 +- .../service/NotificationHelperTest.java | 2 +- .../service/impl/RegistryServiceImplTest.java | 2 +- .../sunbirdrc/actors/ClaimPluginActor.java | 3 +- 64 files changed, 446 insertions(+), 619 deletions(-) rename java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/{OAuth2Properties.java => OAuth2Resource.java} (72%) delete mode 100644 java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Resources.java diff --git a/java/cukes/src/test/java/dev/sunbirdrc/registry/test/RegistryTestBase.java b/java/cukes/src/test/java/dev/sunbirdrc/registry/test/RegistryTestBase.java index f5d984aa1..f8cf59dae 100644 --- a/java/cukes/src/test/java/dev/sunbirdrc/registry/test/RegistryTestBase.java +++ b/java/cukes/src/test/java/dev/sunbirdrc/registry/test/RegistryTestBase.java @@ -27,11 +27,11 @@ public class RegistryTestBase { private static final String CONTEXT_CONSTANT = "teacher:"; protected static Type mapType = new TypeToken>() { }.getType(); - private static String ssoUrl = System.getenv("sunbird_sso_url"); - private static String ssoClientId = System.getenv("sunbird_sso_client_id"); - private static String ssoUsername = System.getenv("sunbird_sso_username"); - private static String ssoPassword = System.getenv("sunbird_sso_password"); - private static String ssoRealm = System.getenv("sunbird_sso_realm"); + private static String ssoUrl = System.getenv("IDENTITY_URL"); + private static String ssoClientId = System.getenv("IDENTITY_CLIENT_ID"); + private static String ssoUsername = System.getenv("IDENTITY_USERNAME"); + private static String ssoPassword = System.getenv("IDENTITY_PASSWORD"); + private static String ssoRealm = System.getenv("IDENTITY_REALM"); public static String accessToken = generateAuthToken(); public String jsonld; protected RestTemplate restTemplate; @@ -51,7 +51,7 @@ public static String generateRandomId() { } private static String generateAuthToken() { - String ssoAuthBody = new StringBuilder().append("client_id=").append(ssoClientId).append("&username=") + String ssoAuthBody = new StringBuilder().append("client_id=").append(``ssoClientId).append("&username=") .append(ssoUsername).append("&password=").append(ssoPassword).append("&grant_type=password").toString(); HttpHeaders headers = new HttpHeaders(); headers.setCacheControl("no-cache"); diff --git a/java/elastic-search/src/main/java/dev/sunbirdrc/elastic/ElasticServiceImpl.java b/java/elastic-search/src/main/java/dev/sunbirdrc/elastic/ElasticServiceImpl.java index 7eda5e32c..129c8ade4 100644 --- a/java/elastic-search/src/main/java/dev/sunbirdrc/elastic/ElasticServiceImpl.java +++ b/java/elastic-search/src/main/java/dev/sunbirdrc/elastic/ElasticServiceImpl.java @@ -147,7 +147,7 @@ private static RestHighLevelClient getClient(String indexName) { * @return * @throws IOException */ - @Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.maxAttempts}}", + @Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.max-attempts}}", backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) public static boolean addIndex(String indexName, String documentType) throws IOException { boolean response = false; @@ -215,7 +215,7 @@ public RestStatus addEntity(String index, String entityId, JsonNode inputEntity) * @return */ @Override - @Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.maxAttempts}}", + @Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.max-attempts}}", backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) public Map readEntity(String index, String osid) throws IOException { logger.debug("readEntity starts with index {} and entityId {}", index, osid); @@ -276,7 +276,7 @@ public RestStatus deleteEntity(String index, String osid) { } @Override - @Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.maxAttempts}}", + @Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.max-attempts}}", backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) public JsonNode search(String index, SearchQuery searchQuery) throws IOException { BoolQueryBuilder query = buildQuery(searchQuery); diff --git a/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/CustomJwtAuthenticationConverter.java b/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/CustomJwtAuthenticationConverter.java index 9f53e7b35..65a05e1f3 100644 --- a/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/CustomJwtAuthenticationConverter.java +++ b/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/CustomJwtAuthenticationConverter.java @@ -3,7 +3,7 @@ import com.jayway.jsonpath.DocumentContext; import com.jayway.jsonpath.JsonPath; import dev.sunbirdrc.registry.authorization.pojos.UserToken; -import dev.sunbirdrc.registry.authorization.pojos.OAuth2Properties; +import dev.sunbirdrc.registry.authorization.pojos.OAuth2Resource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.convert.converter.Converter; @@ -17,21 +17,21 @@ class CustomJwtAuthenticationConverter implements Converter { private static final Logger logger = LoggerFactory.getLogger(CustomJwtAuthenticationConverter.class); - private final OAuth2Properties oAuth2Properties; + private final OAuth2Resource oAuth2Resource; - public CustomJwtAuthenticationConverter(OAuth2Properties oAuth2Properties) { - this.oAuth2Properties = oAuth2Properties; + public CustomJwtAuthenticationConverter(OAuth2Resource oAuth2Resource) { + this.oAuth2Resource = oAuth2Resource; } @Override public AbstractAuthenticationToken convert(Jwt source) { try { DocumentContext documentContext = JsonPath.parse(source.getClaims()); - List roles = getValue(documentContext, oAuth2Properties.getRolesPath(), ArrayList.class); - String email = getValue(documentContext, oAuth2Properties.getEmailPath(), String.class); - Map consentFields = getValue(documentContext, oAuth2Properties.getConsentPath(), Map.class); - List entities = getValue(documentContext, oAuth2Properties.getEntityPath(), ArrayList.class); - String userId = getValue(documentContext, oAuth2Properties.getUserIdPath(), String.class); + List roles = getValue(documentContext, oAuth2Resource.getRolesPath(), ArrayList.class); + String email = getValue(documentContext, oAuth2Resource.getEmailPath(), String.class); + Map consentFields = getValue(documentContext, oAuth2Resource.getConsentPath(), Map.class); + List entities = getValue(documentContext, oAuth2Resource.getEntityPath(), ArrayList.class); + String userId = getValue(documentContext, oAuth2Resource.getUserIdPath(), String.class); return new UserToken(source, userId, email, consentFields, entities, roles.stream().map(SimpleGrantedAuthority::new).collect(Collectors.toList())); } catch (Exception e) { diff --git a/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/SecurityConfig.java b/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/SecurityConfig.java index f456072fb..e4394ce87 100644 --- a/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/SecurityConfig.java +++ b/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/SecurityConfig.java @@ -1,7 +1,7 @@ package dev.sunbirdrc.registry.authorization; import dev.sunbirdrc.registry.authorization.pojos.OAuth2Configuration; -import dev.sunbirdrc.registry.authorization.pojos.OAuth2Resources; +import dev.sunbirdrc.registry.authorization.pojos.OAuth2Resource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Configuration; @@ -31,7 +31,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { protected void configure(HttpSecurity http) throws Exception { HttpSecurity httpConfig = http.csrf().disable(); Map authenticationManagers = new HashMap<>(); - this.oAuth2Configuration.getResources().forEach(issuer -> addManager(authenticationManagers, issuer)); + this.oAuth2Configuration.getResource().forEach(issuer -> addManager(authenticationManagers, issuer)); httpConfig .addFilterBefore(schemaAuthFilter, WebAsyncManagerIntegrationFilter.class) .authorizeRequests(auth -> auth @@ -49,10 +49,10 @@ protected void configure(HttpSecurity http) throws Exception { } - private void addManager(Map authenticationManagers, OAuth2Resources auth2Resources) { + private void addManager(Map authenticationManagers, OAuth2Resource auth2Resources) { TenantJwtDecoder tenantJwtDecoder = CustomJwtDecoders.fromOidcIssuerLocation(auth2Resources.getUri()); JwtAuthenticationProvider authenticationProvider = new JwtAuthenticationProvider(tenantJwtDecoder); - authenticationProvider.setJwtAuthenticationConverter(new CustomJwtAuthenticationConverter(auth2Resources.getProperties())); + authenticationProvider.setJwtAuthenticationConverter(new CustomJwtAuthenticationConverter(auth2Resources)); authenticationManagers.put(tenantJwtDecoder.getIssuer(), authenticationProvider::authenticate); } diff --git a/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Configuration.java b/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Configuration.java index 4bdca4aa4..d105cfcb0 100644 --- a/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Configuration.java +++ b/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Configuration.java @@ -14,6 +14,6 @@ @Component @Data public class OAuth2Configuration { - List resources; + List resource; } diff --git a/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Properties.java b/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Resource.java similarity index 72% rename from java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Properties.java rename to java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Resource.java index cca41a580..3b0a88fce 100644 --- a/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Properties.java +++ b/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Resource.java @@ -1,10 +1,13 @@ package dev.sunbirdrc.registry.authorization.pojos; - import lombok.Data; +import javax.validation.constraints.NotBlank; + @Data -public class OAuth2Properties { +public class OAuth2Resource { + @NotBlank + private String uri; private String rolesPath = "realm_access.roles"; private String emailPath = "email"; private String consentPath = "consent"; diff --git a/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Resources.java b/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Resources.java deleted file mode 100644 index 5ba009ebe..000000000 --- a/java/middleware/registry-middleware/authorization/src/main/java/dev/sunbirdrc/registry/authorization/pojos/OAuth2Resources.java +++ /dev/null @@ -1,13 +0,0 @@ -package dev.sunbirdrc.registry.authorization.pojos; - -import lombok.Data; - -import javax.validation.constraints.NotBlank; - -@Data -public class OAuth2Resources { - @NotBlank - private String uri; - private OAuth2Properties properties = new OAuth2Properties(); - -} diff --git a/java/middleware/registry-middleware/authorization/src/test/java/dev/sunbirdrc/registry/authorization/AuthorizationFilterTest.java b/java/middleware/registry-middleware/authorization/src/test/java/dev/sunbirdrc/registry/authorization/AuthorizationFilterTest.java index 8a96af9e3..8c46fb651 100644 --- a/java/middleware/registry-middleware/authorization/src/test/java/dev/sunbirdrc/registry/authorization/AuthorizationFilterTest.java +++ b/java/middleware/registry-middleware/authorization/src/test/java/dev/sunbirdrc/registry/authorization/AuthorizationFilterTest.java @@ -108,90 +108,4 @@ public void test_valid_token() throws MiddlewareHaltException, IOException { assertEquals("874ed8a5-782e-4f6c-8f36-e0288455901e", authInfo.getSub()); assertEquals("admin-cli", authInfo.getAud()); } - -// @Test -// @Ignore -// public void test_keycloak_token_validation() throws Exception { -// Map mapObject = new HashMap<>(); -// String body = "client_id=" + System.getenv("sunbird_sso_client_id") + "&username=" -// + System.getenv("sunbird_sso_username") + "&password=" + System.getenv("sunbird_sso_password") -// + "&grant_type=password"; -// HttpHeaders headers = new HttpHeaders(); -// headers.setCacheControl("no-cache"); -// headers.set("content-type", "application/x-www-form-urlencoded"); -// HttpEntity request = new HttpEntity(body, headers); -// -// String url = System.getenv("sunbird_sso_url") + "realms/" + System.getenv("sunbird_sso_realm") -// + "/protocol/openid-connect/token "; -// ResponseEntity response = new RestTemplate().postForEntity(url, request, String.class); -// Map myMap = new Gson().fromJson(response.getBody(), type); -// String accessToken = (String) myMap.get("access_token"); -// mapObject.put(Constants.TOKEN_OBJECT, accessToken); -// String userId = "874ed8a5-782e-4f6c-8f36-e0288455901e"; -// assertEquals(new KeyCloakServiceImpl().verifyToken(accessToken), userId); -// } - - @Test - @Ignore - public void test_invalid_environment_variable() throws Exception { - expectedEx.expectMessage("Auth token and/or Environment variable is invalid"); - expectedEx.expect(MiddlewareHaltException.class); - - String body = "client_id=" + System.getenv("sunbird_sso_client_id") + "&username=" - + System.getenv("sunbird_sso_username") + "&password=" + System.getenv("sunbird_sso_password") - + "&grant_type=password"; - HttpHeaders headers = new HttpHeaders(); - headers.setCacheControl("no-cache"); - headers.set("content-type", "application/x-www-form-urlencoded"); - HttpEntity request = new HttpEntity<>(body, headers); - - String publicKey = System.getenv("sunbird_sso_publickey"); - String realm = System.getenv("sunbird_sso_realm"); - String authUrl = System.getenv("sunbird_sso_url"); - String userName = System.getenv("sunbird_sso_username"); - String password = System.getenv("sunbird_sso_password"); - String clientId = System.getenv("sunbird_sso_client_id"); - try { - String url = System.getenv("sunbird_sso_url") + "realms/" + System.getenv("sunbird_sso_realm") - + "/protocol/openid-connect/token "; - ResponseEntity response = new RestTemplate().postForEntity(url, request, String.class); - Map myMap = new Gson().fromJson(response.getBody(), type); - - APIMessage apiMessage = new APIMessage(null); - Map mapObject = apiMessage.getLocalMap(); - String accessToken = myMap.get("access_token"); - mapObject.put(Constants.TOKEN_OBJECT, accessToken); - - assertNotNull(System.getenv("sunbird_sso_publickey")); - assertNotNull(System.getenv("sunbird_sso_realm")); - assertNotNull(System.getenv("sunbird_sso_url")); - assertNotNull(System.getenv("sunbird_sso_username")); - assertNotNull(System.getenv("sunbird_sso_password")); - assertNotNull(System.getenv("sunbird_sso_client_id")); - - injectEnvironmentVariable("sunbird_sso_publickey", "invalid.public.key"); - injectEnvironmentVariable("sunbird_sso_realm", "invalid.realm"); - injectEnvironmentVariable("sunbird_sso_url", "invalid.url"); - injectEnvironmentVariable("sunbird_sso_username", "invalid.userName"); - injectEnvironmentVariable("sunbird_sso_password", "invalid.password"); - injectEnvironmentVariable("sunbird_sso_client_id", "invalid.clientId"); - - assertThat(System.getenv("sunbird_sso_publickey"), is("invalid.public.key")); - assertThat(System.getenv("sunbird_sso_realm"), is("invalid.realm")); - assertThat(System.getenv("sunbird_sso_url"), is("invalid.url")); - assertThat(System.getenv("sunbird_sso_username"), is("invalid.userName")); - assertThat(System.getenv("sunbird_sso_password"), is("invalid.password")); - assertThat(System.getenv("sunbird_sso_client_id"), is("invalid.clientId")); - - authFilter.execute(apiMessage); - } finally { - - injectEnvironmentVariable("sunbird_sso_publickey", publicKey); - injectEnvironmentVariable("sunbird_sso_realm", realm); - injectEnvironmentVariable("sunbird_sso_url", authUrl); - injectEnvironmentVariable("sunbird_sso_username", userName); - injectEnvironmentVariable("sunbird_sso_password", password); - injectEnvironmentVariable("sunbird_sso_client_id", clientId); - } - } } diff --git a/java/middleware/registry-middleware/authorization/src/test/java/dev/sunbirdrc/registry/authorization/CustomJwtAuthenticationConverterTest.java b/java/middleware/registry-middleware/authorization/src/test/java/dev/sunbirdrc/registry/authorization/CustomJwtAuthenticationConverterTest.java index 9e18849f5..20f08015a 100644 --- a/java/middleware/registry-middleware/authorization/src/test/java/dev/sunbirdrc/registry/authorization/CustomJwtAuthenticationConverterTest.java +++ b/java/middleware/registry-middleware/authorization/src/test/java/dev/sunbirdrc/registry/authorization/CustomJwtAuthenticationConverterTest.java @@ -1,6 +1,6 @@ package dev.sunbirdrc.registry.authorization; -import dev.sunbirdrc.registry.authorization.pojos.OAuth2Properties; +import dev.sunbirdrc.registry.authorization.pojos.OAuth2Resource; import dev.sunbirdrc.registry.authorization.pojos.UserToken; import org.junit.Assert; import org.junit.Test; @@ -21,13 +21,13 @@ public class CustomJwtAuthenticationConverterTest { @Test public void shouldExtractValuesFromJWTClaim() { - OAuth2Properties oAuth2Properties = new OAuth2Properties(); - oAuth2Properties.setUserIdPath("sub"); - oAuth2Properties.setRolesPath("user.roles"); - oAuth2Properties.setConsentPath("user.consent"); - oAuth2Properties.setEmailPath("user.email"); - oAuth2Properties.setEntityPath("entity"); - CustomJwtAuthenticationConverter converter = new CustomJwtAuthenticationConverter(oAuth2Properties); + OAuth2Resource oAuth2Resource = new OAuth2Resource(); + oAuth2Resource.setUserIdPath("sub"); + oAuth2Resource.setRolesPath("user.roles"); + oAuth2Resource.setConsentPath("user.consent"); + oAuth2Resource.setEmailPath("user.email"); + oAuth2Resource.setEntityPath("entity"); + CustomJwtAuthenticationConverter converter = new CustomJwtAuthenticationConverter(oAuth2Resource); Jwt jwt = mock(Jwt.class); Map claims = new HashMap<>(); claims.put("sub", "1234"); @@ -51,13 +51,13 @@ public void shouldExtractValuesFromJWTClaim() { @Test public void shouldHandleInvalidValuesWhileExtractionWithDefaultValues() { - OAuth2Properties oAuth2Properties = new OAuth2Properties(); - oAuth2Properties.setUserIdPath("sub"); - oAuth2Properties.setRolesPath("user.roles"); - oAuth2Properties.setConsentPath("user.consent"); - oAuth2Properties.setEmailPath("user.email"); - oAuth2Properties.setEntityPath("entity"); - CustomJwtAuthenticationConverter converter = new CustomJwtAuthenticationConverter(oAuth2Properties); + OAuth2Resource oAuth2Resource = new OAuth2Resource(); + oAuth2Resource.setUserIdPath("sub"); + oAuth2Resource.setRolesPath("user.roles"); + oAuth2Resource.setConsentPath("user.consent"); + oAuth2Resource.setEmailPath("user.email"); + oAuth2Resource.setEntityPath("entity"); + CustomJwtAuthenticationConverter converter = new CustomJwtAuthenticationConverter(oAuth2Resource); Jwt jwt = mock(Jwt.class); Map claims = new HashMap<>(); claims.put("sub", "1234"); diff --git a/java/middleware/registry-middleware/generic-iam/src/main/java/dev/sunbirdrc/auth/genericiam/AdminUtil.java b/java/middleware/registry-middleware/generic-iam/src/main/java/dev/sunbirdrc/auth/genericiam/AdminUtil.java index 0310fe652..ff7a9d41e 100644 --- a/java/middleware/registry-middleware/generic-iam/src/main/java/dev/sunbirdrc/auth/genericiam/AdminUtil.java +++ b/java/middleware/registry-middleware/generic-iam/src/main/java/dev/sunbirdrc/auth/genericiam/AdminUtil.java @@ -22,20 +22,16 @@ public class AdminUtil implements IdentityManager { private final RestTemplate restTemplate; - private final String iamServiceURL; - public AdminUtil(IdentityProviderConfiguration identityProviderConfiguration) { this.identityProviderConfiguration = identityProviderConfiguration; this.restTemplate = new RestTemplate(); - this.iamServiceURL = System.getenv() - .getOrDefault("sunbird_sso_url", "http://localhost:3990/fusionauth/api/v1/user"); } @Override public String createUser(CreateUserRequest createUserRequest) throws IdentityException { logger.info("Creating user with mobile_number : " + createUserRequest.getUserName()); - ResponseEntity response = this.restTemplate.postForEntity(this.iamServiceURL, + ResponseEntity response = this.restTemplate.postForEntity(identityProviderConfiguration.getCreateUserUrl(), createUserRequest, CreateUserResponse.class); if (response.getStatusCode() == HttpStatus.OK && response.getBody() != null && !StringUtils.isEmpty(response.getBody().getUserId())) { diff --git a/java/middleware/registry-middleware/identity-provider/src/main/java/dev/sunbirdrc/registry/identity_providers/pojos/IdentityProviderConfiguration.java b/java/middleware/registry-middleware/identity-provider/src/main/java/dev/sunbirdrc/registry/identity_providers/pojos/IdentityProviderConfiguration.java index 5456e303f..eef368196 100644 --- a/java/middleware/registry-middleware/identity-provider/src/main/java/dev/sunbirdrc/registry/identity_providers/pojos/IdentityProviderConfiguration.java +++ b/java/middleware/registry-middleware/identity-provider/src/main/java/dev/sunbirdrc/registry/identity_providers/pojos/IdentityProviderConfiguration.java @@ -9,24 +9,26 @@ @Component @Getter public class IdentityProviderConfiguration { - @Value("${identity.provider}") + @Value("${identity.provider-name}") private String provider; @Value("${identity.url}") private String url; + @Value("${identity.create-user-path}") + private String createUserPath; @Value("${identity.realm}") private String realm; - @Value("${identity.client_id}") + @Value("${identity.admin-client-id}") private String clientId; - @Value("${identity.client_secret}") + @Value("${identity.admin-client-secret}") private String clientSecret; - @Value("${identity.set_default_password}") + @Value("${identity.set-default-password}") private Boolean setDefaultPassword; - @Value("${identity.default_password}") + @Value("${identity.default-password}") private String defaultPassword; - @Value("${identity.user_actions}") + @Value("${identity.user-actions}") private List userActions; - @Value("${httpConnection.maxConnections:5}") + @Value("${http.max-connections:5}") private int httpMaxConnections; @Value("${authentication.enabled:true}") @@ -35,4 +37,8 @@ public class IdentityProviderConfiguration { public Boolean setDefaultPassword() { return setDefaultPassword; } + + public String getCreateUserUrl() { + return (url + createUserPath).replaceAll("(? 1; for (DBConnectionInfo info : mgr.getConnectionInfo()) { if (info.getShardId().isEmpty() || info.getUri().isEmpty()) { - message = "database.connectionInfo.shardId or database.connectionInfo.uri is empty"; + message = "database.connection-info.shard-id or database.connection-info.uri is empty"; break; } if (nShardsExist && info.getShardLabel().isEmpty()) { - message = "database.connectionInfo.shardLabel is empty"; + message = "database.connection-info.shard-label is empty"; break; } if (nShardsExist && !isUniqueShardId(mgr.getConnectionInfo(), info.getShardId())) { - message = "database.connectionInfo.shardId must be unique"; + message = "database.connection-info.shard-id must be unique"; break; } if (nShardsExist && !isUniqueShardLabel(mgr.getConnectionInfo(), info.getShardLabel())) { - message = "database.connectionInfo.shardLabel must be unique"; + message = "database.connection-info.shard-label must be unique"; break; } } diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/consumers/CreateEntityConsumer.java b/java/registry/src/main/java/dev/sunbirdrc/registry/consumers/CreateEntityConsumer.java index 7e123b512..c94067f2a 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/consumers/CreateEntityConsumer.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/consumers/CreateEntityConsumer.java @@ -45,7 +45,7 @@ public class CreateEntityConsumer { private final RegistryHelper registryHelper; private final WebhookService webhookService; - @Value("${kafka.postCreateEntityTopic:post_create_entity}") + @Value("${kafka.post-create-entity-topic:post_create_entity}") String postCreateEntityTopic; @Value("${webhook.url}") @@ -62,7 +62,7 @@ public CreateEntityConsumer(ObjectMapper objectMapper, ShardManager shardManager this.webhookService = webhookService; } - @KafkaListener(topics = "#{'${kafka.createEntityTopic}'}", groupId = createEntityGroupId, autoStartup = "${async.enabled}") + @KafkaListener(topics = "#{'${kafka.create-entity-topic}'}", groupId = createEntityGroupId, autoStartup = "${async.enabled}") public void createEntityConsumer(@Payload String message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key, Acknowledgment acknowledgment) { PostCreateEntityMessage postCreateEntityMessage = PostCreateEntityMessage.builder().build(); try { diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/AbstractController.java b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/AbstractController.java index 18574a09e..d5a6e78a7 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/AbstractController.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/AbstractController.java @@ -44,7 +44,7 @@ public abstract class AbstractController { @Autowired IDefinitionsManager definitionsManager; - @Value("${database.uuidPropertyName}") + @Value("${database.uuid-property-name}") public String uuidPropertyName; ResponseEntity badRequestException(ResponseParams responseParams, Response response, String errorMessage) { diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/FileStorageController.java b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/FileStorageController.java index afc0911df..a68e42d7d 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/FileStorageController.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/FileStorageController.java @@ -21,7 +21,7 @@ // TODO: Get should be viewed by both attestor and reviewer @Controller -@ConditionalOnProperty(name = "filestorage.enabled", havingValue = "true", matchIfMissing = true) +@ConditionalOnProperty(name = "file-storage.enabled", havingValue = "true", matchIfMissing = true) public class FileStorageController { private static final Logger logger = LoggerFactory.getLogger(FileStorageController.class); private final FileStorageService fileStorageService; diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryAttestationPolicyController.java b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryAttestationPolicyController.java index 3f56a084e..a6ed3cfdd 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryAttestationPolicyController.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryAttestationPolicyController.java @@ -20,7 +20,7 @@ public class RegistryAttestationPolicyController extends AbstractController { private static Logger logger = LoggerFactory.getLogger(RegistryAttestationPolicyController.class); - @Value("${registry.attestationPolicy.createAccess:''}") + @Value("${registry.attestation-policy.create-access:''}") public List createAttestationEntities; @PostMapping("/api/v1/{entityName}/attestationPolicy") diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryController.java b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryController.java index 1434b7ffe..913f0e574 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryController.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryController.java @@ -28,7 +28,7 @@ import java.util.Set; @RestController -@ConditionalOnProperty("registry.baseAPIS.enable") +@ConditionalOnProperty("registry.base-apis.enable") public class RegistryController extends AbstractController { private static Logger logger = LoggerFactory.getLogger(RegistryController.class); diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryEntityController.java b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryEntityController.java index 9d2b18a19..b7d2137d5 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryEntityController.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryEntityController.java @@ -68,7 +68,7 @@ public class RegistryEntityController extends AbstractController { @Autowired(required = false) private ICertificateService certificateService; - @Value("${filestorage.enabled}") + @Value("${file-storage.enabled}") private boolean fileStorageEnabled; @Autowired(required = false) private FileStorageService fileStorageService; @@ -81,7 +81,7 @@ public class RegistryEntityController extends AbstractController { @Value("${authentication.enabled:true}") boolean securityEnabled; - @Value("${certificate.enableExternalTemplates:false}") + @Value("${template.external-enabled:false}") boolean externalTemplatesEnabled; @RequestMapping(value = "/api/v1/{entityName}/invite", method = RequestMethod.POST) diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistrySwaggerController.java b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistrySwaggerController.java index 5a967c91b..6e0eba1cf 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistrySwaggerController.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistrySwaggerController.java @@ -31,18 +31,18 @@ import static dev.sunbirdrc.registry.Constants.TITLE; @RestController -@ConditionalOnProperty(name = "api-swagger.enabled", havingValue = "true") +@ConditionalOnProperty(name = "swagger.enabled", havingValue = "true") public class RegistrySwaggerController { private final IDefinitionsManager definitionsManager; private final RefResolver refResolver; private final ObjectMapper objectMapper; @Value("${registry.schema.url}") private String schemaUrl; - @Value("${api-swagger.title}") + @Value("${swagger.title}") private String swaggerTitle; - @Value("${api-swagger.description}") + @Value("${swagger.description}") private String swaggerDescription; - @Value("${api-swagger.version}") + @Value("${swagger.version}") private String swaggerVersion; private RegistryHelper registryHelper; diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryTemplateController.java b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryTemplateController.java index 4a998d8e6..83be0df1a 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryTemplateController.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryTemplateController.java @@ -16,7 +16,7 @@ public class RegistryTemplateController{ private static final Logger logger = LoggerFactory.getLogger(RegistryTemplateController.class); - @Value("${certificate.templateFolderPath}") + @Value("${template.folder-path}") private String templatesFolderPath; @RequestMapping(value = "/api/v1/templates/{fileName}", method = RequestMethod.GET) diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryUtilsController.java b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryUtilsController.java index d88efcec2..a30e97127 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryUtilsController.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/controller/RegistryUtilsController.java @@ -77,7 +77,7 @@ public class RegistryUtilsController { @Value("${audit.enabled}") private boolean auditEnabled; - @Value("${audit.frame.store}") + @Value("${audit.frame-store}") public String auditStoreType; @RequestMapping(value = "/utils/sign", method = RequestMethod.POST) diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/helper/EntityStateHelper.java b/java/registry/src/main/java/dev/sunbirdrc/registry/helper/EntityStateHelper.java index 67f5fc53b..ea144f8ff 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/helper/EntityStateHelper.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/helper/EntityStateHelper.java @@ -37,7 +37,7 @@ public class EntityStateHelper { private static final Logger logger = LoggerFactory.getLogger(EntityStateHelper.class); - @Value("${database.uuidPropertyName}") + @Value("${database.uuid-property-name}") private String uuidPropertyName; private final IDefinitionsManager definitionsManager; @@ -48,9 +48,9 @@ public class EntityStateHelper { private final ClaimRequestClient claimRequestClient; - @Value("${identity.set_default_password}") + @Value("${identity.set-default-password}") private Boolean setDefaultPassword; - @Value("${identity.default_password}") + @Value("${identity.default-password}") private String defaultPassword; private final boolean authenticationEnabled; diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/helper/RegistryHelper.java b/java/registry/src/main/java/dev/sunbirdrc/registry/helper/RegistryHelper.java index 2e0ec3ef1..10c9fd3b7 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/helper/RegistryHelper.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/helper/RegistryHelper.java @@ -96,9 +96,9 @@ public class RegistryHelper { private static final Logger logger = LoggerFactory.getLogger(RegistryHelper.class); @Value("${authentication.enabled:true}") boolean securityEnabled; - @Value("${notification.service.enabled}") boolean notificationEnabled; - @Value("${invite.required_validation_enabled}") boolean skipRequiredValidationForInvite = true; - @Value("${invite.signature_enabled}") boolean skipSignatureForInvite = true; + @Value("${notification.enabled}") boolean notificationEnabled; + @Value("${invite.skip-required-validation}") boolean skipRequiredValidationForInvite = true; + @Value("${invite.skip-signature}") boolean skipSignatureForInvite = true; @Autowired(required = false) private NotificationHelper notificationHelper; @Autowired @@ -146,25 +146,25 @@ public class RegistryHelper { @Autowired private ObjectMapper objectMapper; - @Value("${filestorage.enabled}") + @Value("${file-storage.enabled}") private boolean fileStorageEnabled; @Autowired(required = false) private FileStorageService fileStorageService; - @Value("${database.uuidPropertyName}") + @Value("${database.uuid-property-name}") public String uuidPropertyName; - @Value("${audit.frame.suffix}") + @Value("${audit.suffix}") public String auditSuffix; @Value("${event.enabled}") private boolean isEventsEnabled; - @Value("${audit.frame.suffixSeparator}") + @Value("${audit.suffix-separator}") public String auditSuffixSeparator; - @Value("${conditionalAccess.internal}") + @Value("${conditional-access.internal}") private String internalFieldsProp; - @Value("${conditionalAccess.private}") + @Value("${conditional-access.private}") private String privateFieldsProp; @Value("${signature.enabled}") @@ -173,12 +173,12 @@ public class RegistryHelper { @Value("${workflow.enabled:true}") private boolean workflowEnabled; - @Value("${attestationPolicy.search_enabled:false}") + @Value("${registry.attestation-policy.search-enabled:false}") private boolean attestationPolicySearchEnabled; - @Value("${view_template.decrypt_private_fields:false}") + @Value("${view-template.decrypt-private-fields:false}") private boolean viewTemplateDecryptPrivateFields; - @Value("${registry.hard_delete_enabled}") + @Value("${registry.hard-delete-enabled}") private boolean isHardDeleteEnabled; @Autowired diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/helper/SignatureHelper.java b/java/registry/src/main/java/dev/sunbirdrc/registry/helper/SignatureHelper.java index a15ce813f..b529bc382 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/helper/SignatureHelper.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/helper/SignatureHelper.java @@ -26,7 +26,7 @@ public class SignatureHelper { @Autowired private SignatureService signatureService; - @Value("${filestorage.enabled}") + @Value("${file-storage.enabled}") private boolean fileStorageEnabled; @Autowired(required = false) private FileStorageService fileStorageService; diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/CredentialSchemaService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/CredentialSchemaService.java index 3790b27da..da0725ae9 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/CredentialSchemaService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/CredentialSchemaService.java @@ -31,18 +31,18 @@ import static dev.sunbirdrc.registry.middleware.util.Constants.CONNECTION_FAILURE; @Component -@ConditionalOnExpression("${signature.enabled:false} && ('${signature.provider}' == 'dev.sunbirdrc.registry.service.impl.SignatureV2ServiceImpl')") +@ConditionalOnExpression("${signature.enabled:false} && ('${signature.provider-name}' == 'dev.sunbirdrc.registry.service.impl.SignatureV2ServiceImpl')") public class CredentialSchemaService implements HealthIndicator { private static final Logger logger = LoggerFactory.getLogger(CredentialSchemaService.class); - @Value("${signature.v2.schema.healthCheckURL}") + @Value("${signature.v2.schema.health-check-url}") private String healthCheckUrl; - @Value("${signature.v2.schema.createSchemaURL}") + @Value("${signature.v2.schema.create-url}") private String createUrl; - @Value("${signature.v2.schema.updateSchemaURL}") + @Value("${signature.v2.schema.update-url}") private String updateUrl; - @Value("${signature.v2.schema.getSchemaByIdAndVersionURL}") + @Value("${signature.v2.schema.get-by-id-and-version-url}") private String getByIdAndVersionUrl; - @Value("${signature.v2.schema.getSchemaByTagsURL}") + @Value("${signature.v2.schema.search-by-tags-url}") private String getByTagsUrl; @Autowired(required = false) @@ -52,7 +52,7 @@ public class CredentialSchemaService implements HealthIndicator { @Value("${signature.v2.schema.author}") private String authorName; - @Value("${signature.v2.schema.authorDidMethod}") + @Value("${signature.v2.schema.author-did-method}") private String authorDidMethod; @Autowired diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/DIDService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/DIDService.java index e3c3a4654..738bef650 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/DIDService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/DIDService.java @@ -33,11 +33,11 @@ @ConditionalOnProperty(value = "did.enabled", havingValue = "true") public class DIDService implements HealthIndicator { private static final Logger logger = LoggerFactory.getLogger(DIDService.class); - @Value("${did.healthCheckURL}") + @Value("${did.health-check-url}") private String healthCheckUrl; - @Value("${did.generateURL}") + @Value("${did.generate-url}") private String generateIdUrl; - @Value("${did.resolveURL}") + @Value("${did.resolve-url}") private String resolveIdUrl; private static final String authorSchemaName = "Issuer"; diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/ElasticReadService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/ElasticReadService.java index 5456d91d9..a643b89bc 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/ElasticReadService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/ElasticReadService.java @@ -30,7 +30,7 @@ * */ @Component -@ConditionalOnProperty(name = "search.providerName", havingValue = "dev.sunbirdrc.registry.service.ElasticSearchService") +@ConditionalOnProperty(name = "search.provider-name", havingValue = "dev.sunbirdrc.registry.service.ElasticSearchService") public class ElasticReadService implements IReadService { private static Logger logger = LoggerFactory.getLogger(ElasticReadService.class); diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/ElasticSearchService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/ElasticSearchService.java index 9131046de..4ae5a7c72 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/ElasticSearchService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/ElasticSearchService.java @@ -40,7 +40,7 @@ * */ @Component -@ConditionalOnProperty(name = "search.providerName", havingValue = "dev.sunbirdrc.registry.service.ElasticSearchService") +@ConditionalOnProperty(name = "search.provider-name", havingValue = "dev.sunbirdrc.registry.service.ElasticSearchService") public class ElasticSearchService implements ISearchService { private static Logger logger = LoggerFactory.getLogger(ElasticSearchService.class); @@ -59,16 +59,10 @@ public class ElasticSearchService implements ISearchService { @Value("${search.limit}") private int limit; - @Value("${database.uuidPropertyName}") + @Value("${database.uuid-property-name}") private String uuidPropertyName; - @Value("${audit.enabled}") - private boolean auditEnabled; - - @Value("${audit.frame.suffix}") - private String auditSuffix; - - @Value("${registry.expandReference}") + @Value("${registry.expand-reference}") private boolean expandReferenceObj; @Autowired diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/FileStorageService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/FileStorageService.java index 455bc503b..07c379e32 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/FileStorageService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/FileStorageService.java @@ -36,14 +36,14 @@ import static dev.sunbirdrc.registry.middleware.util.Constants.SUNBIRD_FILE_STORAGE_SERVICE_NAME; @Service -@ConditionalOnProperty(name = "filestorage.enabled", havingValue = "true", matchIfMissing = true) +@ConditionalOnProperty(name = "file-storage.enabled", havingValue = "true", matchIfMissing = true) public class FileStorageService implements HealthIndicator { private static final Logger logger = LoggerFactory.getLogger(FileStorageService.class); private final MinioClient minioClient; private final String bucketName; private static final String CONTENT_TYPE_TEXT = "text/plain"; - public FileStorageService(MinioClient minioClient, @Value("${filestorage.bucketname}") String bucketName) { + public FileStorageService(MinioClient minioClient, @Value("${file-storage.bucket-name}") String bucketName) { this.bucketName = bucketName; this.minioClient = minioClient; } diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/NativeReadService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/NativeReadService.java index 7bc647770..ce74e5f82 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/NativeReadService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/NativeReadService.java @@ -41,13 +41,13 @@ public class NativeReadService implements IReadService { @Autowired private IAuditService auditService; - @Value("${database.uuidPropertyName}") + @Value("${database.uuid-property-name}") public String uuidPropertyName; @Value("${audit.enabled}") private boolean auditEnabled; - @Value("${registry.expandReference}") + @Value("${registry.expand-reference}") private boolean expandReferenceObj; /** diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/NativeSearchService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/NativeSearchService.java index ff3ba583f..23f283d49 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/NativeSearchService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/NativeSearchService.java @@ -58,7 +58,7 @@ public class NativeSearchService implements ISearchService { @Autowired private APIMessage apiMessage; - @Value("${database.uuidPropertyName}") + @Value("${database.uuid-property-name}") public String uuidPropertyName; @Value("${search.offset}") @@ -70,15 +70,15 @@ public class NativeSearchService implements ISearchService { @Value("${audit.enabled}") private boolean auditEnabled; - @Value("${audit.frame.suffix}") + @Value("${audit.suffix}") private String auditSuffix; - @Value("${search.expandInternal}") + @Value("${search.expand-internal}") private boolean expandInternal; - @Value("${registry.expandReference}") + @Value("${registry.expand-reference}") private boolean expandReferenceObj; - @Value("${search.removeNonPublicFieldsForNativeSearch:true}") + @Value("${search.remove-non-public-fields-for-native-search:true}") private boolean removeNonPublicFieldsForNativeSearch; @Override diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/NotificationHelper.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/NotificationHelper.java index 6c4dfd574..83504e7ac 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/NotificationHelper.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/NotificationHelper.java @@ -28,7 +28,7 @@ import static dev.sunbirdrc.registry.middleware.util.Constants.MOBILE; @Service -@ConditionalOnProperty(name = "notification.service.enabled", havingValue = "true") +@ConditionalOnProperty(name = "notification.enabled", havingValue = "true") public class NotificationHelper { private static Logger logger = LoggerFactory.getLogger(NotificationHelper.class); boolean notificationEnabled; @@ -37,7 +37,7 @@ public class NotificationHelper { private RegistryService registryService; private ObjectMapper objectMapper; @Autowired - public NotificationHelper(@Value("${notification.service.enabled}") boolean notificationEnabled, IDefinitionsManager definitionsManager, EntityStateHelper entityStateHelper, RegistryService registryService, ObjectMapper objectMapper) { + public NotificationHelper(@Value("${notification.enabled}") boolean notificationEnabled, IDefinitionsManager definitionsManager, EntityStateHelper entityStateHelper, RegistryService registryService, ObjectMapper objectMapper) { this.notificationEnabled = notificationEnabled; this.definitionsManager = definitionsManager; this.entityStateHelper = entityStateHelper; diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/SchemaService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/SchemaService.java index c7300be36..83654d395 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/SchemaService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/SchemaService.java @@ -36,7 +36,7 @@ public class SchemaService { @Value("${signature.enabled:false}") private boolean signatureEnabled; - @Value("${signature.provider}") + @Value("${signature.provider-name}") private String signatureProvider; @Autowired(required = false) private CredentialSchemaService credentialSchemaService; @@ -176,6 +176,7 @@ private void ensureCredentialSchema(String title, Object credentialTemplate, Str if(!signatureEnabled || !Objects.equals(signatureProvider, SignatureV2ServiceImpl.class.getName())) { return; } + if(credentialTemplate != null) return; try { credentialSchemaService.ensureCredentialSchema(title, credentialTemplate, status); } catch (Exception e) { diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditDBImpl.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditDBImpl.java index c36558b10..c9e23185e 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditDBImpl.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditDBImpl.java @@ -23,7 +23,7 @@ * Audit service implementation for audit layer in the application */ @Component -@ConditionalOnExpression("${audit.enabled} and 'database'.equalsIgnoreCase('${audit.frame.store}')") +@ConditionalOnExpression("${audit.enabled} and 'database'.equalsIgnoreCase('${audit.frame-store}')") public class AuditDBImpl extends AuditServiceImpl { private static Logger logger = LoggerFactory.getLogger(AuditDBImpl.class); @@ -32,10 +32,10 @@ public class AuditDBImpl extends AuditServiceImpl { private AuditDBWriter auditWriter; - @Value("${audit.frame.suffix}") + @Value("${audit.suffix}") private String auditSuffix; - @Value("${audit.frame.suffixSeparator}") + @Value("${audit.suffix-separator}") private String auditSuffixSeparator; @Autowired diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditDBWriter.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditDBWriter.java index 1f610b41c..2a46c7e44 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditDBWriter.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditDBWriter.java @@ -34,7 +34,7 @@ public class AuditDBWriter { @Value("${persistence.commit.enabled:true}") private boolean commitEnabled; - @Value("${database.uuidPropertyName}") + @Value("${database.uuid-property-name}") public String uuidPropertyName; @Autowired @@ -42,7 +42,7 @@ public class AuditDBWriter { @Autowired private EntityParenter entityParenter; - @Value("${registry.expandReference}") + @Value("${registry.expand-reference}") private boolean expandReferenceObj; public String auditToDB(Shard shard, JsonNode rootNode, String entityType) throws AuditFailedException { diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditFileImpl.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditFileImpl.java index 495bb790a..a9b869582 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditFileImpl.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditFileImpl.java @@ -18,7 +18,7 @@ * Audit service implementation for audit layer in the application */ @Component -@ConditionalOnExpression("${audit.enabled} and 'file'.equalsIgnoreCase('${audit.frame.store}')") +@ConditionalOnExpression("${audit.enabled} and 'file'.equalsIgnoreCase('${audit.frame-store}')") public class AuditFileImpl extends AuditServiceImpl { private static Logger logger = LoggerFactory.getLogger(AuditFileImpl.class); diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditServiceImpl.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditServiceImpl.java index dff4264c4..60340e430 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditServiceImpl.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/AuditServiceImpl.java @@ -49,13 +49,13 @@ public class AuditServiceImpl implements IAuditService { @Value("${audit.enabled}") private boolean auditEnabled; - @Value("${audit.frame.store}") + @Value("${audit.frame-store}") private String auditFrameStore; - @Value("${audit.frame.suffix}") + @Value("${audit.suffix}") private String auditSuffix; - @Value("${audit.frame.suffixSeparator}") + @Value("${audit.suffix-separator}") private String auditSuffixSeparator; @Autowired @@ -68,7 +68,7 @@ public class AuditServiceImpl implements IAuditService { private AuditProviderFactory auditProviderFactory; - @Value("${search.providerName}") + @Value("${search.provider-name}") private String searchProvider; private boolean isFileAudit() { diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/CertificateServiceImpl.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/CertificateServiceImpl.java index 6b82e0072..e798fc133 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/CertificateServiceImpl.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/CertificateServiceImpl.java @@ -32,26 +32,26 @@ import static dev.sunbirdrc.registry.middleware.util.Constants.SUNBIRD_CERTIFICATE_SERVICE_NAME; @Component -@ConditionalOnExpression("${certificate.enabled:false} && ('${signature.provider}' == 'dev.sunbirdrc.registry.service.impl.SignatureV1ServiceImpl')") +@ConditionalOnExpression("${certificate.enabled:false} && ('${signature.provider-name}' == 'dev.sunbirdrc.registry.service.impl.SignatureV1ServiceImpl')") public class CertificateServiceImpl implements ICertificateService { private final String templateBaseUrl; private final String certificateUrl; private final String certificateHealthCheckURL; private final RestTemplate restTemplate; - private boolean signatureEnabled; + private final boolean certificateEnabled; private static Logger logger = LoggerFactory.getLogger(CertificateServiceImpl.class); - public CertificateServiceImpl(@Value("${certificate.templateBaseUrl}") String templateBaseUrl, - @Value("${certificate.apiUrl}") String certificateUrl, - @Value("${signature.enabled}") boolean signatureEnabled, - @Value("${certificate.healthCheckURL}") String certificateHealthCheckURL, + public CertificateServiceImpl(@Value("${template.base-url}") String templateBaseUrl, + @Value("${certificate.pdf-url}") String certificateUrl, + @Value("${certificate.enabled}") boolean certificateEnabled, + @Value("${certificate.health-check-url}") String certificateHealthCheckURL, RestTemplate restTemplate) { this.templateBaseUrl = templateBaseUrl; this.certificateUrl = certificateUrl; this.restTemplate = restTemplate; this.certificateHealthCheckURL = certificateHealthCheckURL; - this.signatureEnabled = signatureEnabled; + this.certificateEnabled = certificateEnabled; } @Override @@ -101,7 +101,7 @@ public String getServiceName() { @Override public ComponentHealthInfo getHealthInfo() { - if (signatureEnabled) { + if (certificateEnabled) { try { ResponseEntity response = restTemplate.getForEntity(URI.create(certificateHealthCheckURL), String.class); if (!StringUtils.isEmpty(response.getBody()) && Arrays.asList("UP", "OK").contains(response.getBody().toUpperCase())) { diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/EncryptionServiceImpl.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/EncryptionServiceImpl.java index 1bfe02b3c..20d191c2e 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/EncryptionServiceImpl.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/EncryptionServiceImpl.java @@ -37,19 +37,19 @@ public class EncryptionServiceImpl implements EncryptionService { private static Logger logger = LoggerFactory.getLogger(EncryptionServiceImpl.class); @Value("${encryption.enabled}") private boolean encryptionEnabled; - @Value("${encryption.tenant.id}") + @Value("${encryption.tenant-id}") private String encryptionTenantId; @Value("${encryption.method}") private String encryptionMethod; - @Value("${encryption.uri}") + @Value("${encryption.url}") private String encryptionUri; - @Value("${decryption.uri}") + @Value("${decryption.url}") private String decryptionUri; - @Value("${encryption.batch.uri}") + @Value("${encryption.batch-url}") private String encryptionBatchUri; - @Value("${decryption.batch.uri}") + @Value("${decryption.batch-url}") private String decryptionBatchUri; - @Value("${encryption.healthCheckURL}") + @Value("${encryption.health-check-url}") private String encryptionServiceHealthCheckUri; @Autowired private RetryRestTemplate retryRestTemplate; diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/FileEventService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/FileEventService.java index 280cd6274..fde36f1b2 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/FileEventService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/FileEventService.java @@ -11,7 +11,7 @@ import org.springframework.stereotype.Service; @Service -@ConditionalOnProperty(name = "event.providerName", havingValue = "dev.sunbirdrc.registry.service.impl.FileEventService") +@ConditionalOnProperty(name = "event.provider-name", havingValue = "dev.sunbirdrc.registry.service.impl.FileEventService") public class FileEventService implements IEventService { private static Logger logger = LoggerFactory.getLogger(FileEventService.class); diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/IdGenService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/IdGenService.java index 11667cba5..64a1a45d3 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/IdGenService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/IdGenService.java @@ -39,13 +39,13 @@ public class IdGenService implements IIdGenService { private static final Logger logger = LoggerFactory.getLogger(IdGenService.class); - @Value("${idgen.generateURL}") + @Value("${idgen.generate-url}") private String generateUrl; - @Value("${idgen.idFormatURL}") + @Value("${idgen.id-format-url}") private String idFormatUrl; - @Value("${idgen.healthCheckURL}") + @Value("${idgen.health-check-url}") private String healthCheckUrl; - @Value("${idgen.tenantId}") + @Value("${idgen.tenant-id}") private String tenantId; @Value("${idgen.enabled:false}") private boolean enabled; diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/KafkaEventService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/KafkaEventService.java index dce9360c4..e75f552bb 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/KafkaEventService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/KafkaEventService.java @@ -12,7 +12,7 @@ import org.springframework.stereotype.Service; @Service -@ConditionalOnProperty(name = "event.providerName", havingValue = "dev.sunbirdrc.registry.service.impl.KafkaEventService", matchIfMissing = true) +@ConditionalOnProperty(name = "event.provider-name", havingValue = "dev.sunbirdrc.registry.service.impl.KafkaEventService", matchIfMissing = true) public class KafkaEventService implements IEventService { @Value("${events.topic:events}") diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RegistryAsyncServiceImpl.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RegistryAsyncServiceImpl.java index 92ababe0f..203036706 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RegistryAsyncServiceImpl.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RegistryAsyncServiceImpl.java @@ -28,7 +28,7 @@ @Qualifier("async") public class RegistryAsyncServiceImpl extends RegistryServiceImpl implements RegistryService { private static final Logger logger = LoggerFactory.getLogger(RegistryAsyncServiceImpl.class); - @Value("${kafka.createEntityTopic:create_entity}") + @Value("${kafka.create-entity-topic:create_entity}") String createEntityTopic; @Autowired private KafkaTemplate kafkaTemplate; diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RegistryServiceImpl.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RegistryServiceImpl.java index 8084a8fd9..0a7f17014 100755 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RegistryServiceImpl.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RegistryServiceImpl.java @@ -77,13 +77,13 @@ public class RegistryServiceImpl implements RegistryService { @Value("${encryption.enabled}") private boolean encryptionEnabled; - @Value("${registry.hard_delete_enabled}") + @Value("${registry.hard-delete-enabled}") private boolean isHardDeleteEnabled; @Value("${event.enabled}") private boolean isEventsEnabled; - @Value("${database.uuidPropertyName}") + @Value("${database.uuid-property-name}") public String uuidPropertyName; @Value("${signature.enabled}") @@ -95,22 +95,19 @@ public class RegistryServiceImpl implements RegistryService { @Value("${persistence.commit.enabled:true}") private boolean commitEnabled; - @Value("${search.providerName}") + @Value("${search.provider-name}") private String searchProvider; @Value("${audit.enabled}") private boolean auditEnabled; - @Value("${registry.perRequest.indexCreation.enabled:false}") + @Value("${registry.per-request.index-creation.enabled:false}") private boolean perRequestIndexCreation; - @Value("${elastic.search.add_shard_prefix:true}") + @Value("${elastic.search.add-shard-prefix:true}") private boolean addShardPrefixForESRecord; - @Value("${registry.context.base}") - private String registryBaseUrl; - - @Value("${notification.async.enabled}") + @Value("${notification.async-enabled}") private boolean asyncEnabled; @Value("${notification.topic}") @@ -139,7 +136,7 @@ public class RegistryServiceImpl implements RegistryService { @Value("${idgen.enabled:false}") private boolean idGenEnabled; - @Value("${registry.expandReference}") + @Value("${registry.expand-reference}") private boolean expandReferenceObj; /** diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RetryRestTemplate.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RetryRestTemplate.java index 9e295e6de..f6e658cfe 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RetryRestTemplate.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/RetryRestTemplate.java @@ -19,19 +19,19 @@ public class RetryRestTemplate { @Autowired private RestTemplate restTemplate; - @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.maxAttempts}}", + @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.max-attempts}}", backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) public ResponseEntity postForEntity(String url, Object propertyValue){ return restTemplate.postForEntity(url, propertyValue, String.class); } - @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.maxAttempts}}", + @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.max-attempts}}", backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) public ResponseEntity putForEntity(String url, HttpEntity propertyValue, Object... uriVariables){ return restTemplate.exchange(url, HttpMethod.PUT, propertyValue, String.class, uriVariables); } - @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.maxAttempts}}", + @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.max-attempts}}", backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) public ResponseEntity getForEntity(String url){ HttpHeaders headers = new HttpHeaders(); @@ -39,7 +39,7 @@ public ResponseEntity getForEntity(String url){ return restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(null, headers), String.class); } - @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.maxAttempts}}", + @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.max-attempts}}", backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) public ResponseEntity getForEntity(String url, Object... uriVariables){ HttpHeaders headers = new HttpHeaders(); @@ -48,13 +48,13 @@ public ResponseEntity getForEntity(String url, Object... uriVariables){ return restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(null, headers), String.class, uriVariables); } - @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.maxAttempts}}", + @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.max-attempts}}", backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) public void deleteForEntity(String url, Object... uriVariables){ restTemplate.delete(url, uriVariables); } - @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.maxAttempts}}", + @Retryable(value ={SignatureException.UnreachableException.class,ResourceAccessException.class,ServiceUnavailableException.class }, maxAttemptsExpression = "#{${service.retry.max-attempts}}", backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) public ResponseEntity getForObject(String url, HttpHeaders headers, Class tClass, Object... uriVariables){ return restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(null, headers), tClass, uriVariables); diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV1ServiceImpl.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV1ServiceImpl.java index 718a77487..9a4875c01 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV1ServiceImpl.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV1ServiceImpl.java @@ -22,16 +22,16 @@ import static dev.sunbirdrc.registry.middleware.util.Constants.SUNBIRD_SIGNATURE_SERVICE_NAME; @Component -@ConditionalOnExpression("${signature.enabled:false} && ('${signature.provider}' == 'dev.sunbirdrc.registry.service.impl.SignatureV1ServiceImpl')") +@ConditionalOnExpression("${signature.enabled:false} && ('${signature.provider-name}' == 'dev.sunbirdrc.registry.service.impl.SignatureV1ServiceImpl')") public class SignatureV1ServiceImpl implements SignatureService { private static Logger logger = LoggerFactory.getLogger(SignatureV1ServiceImpl.class); - @Value("${signature.v1.healthCheckURL}") + @Value("${signature.v1.health-check-url}") private String healthCheckURL; - @Value("${signature.v1.signURL}") + @Value("${signature.v1.sign-url}") private String signURL; - @Value("${signature.v1.verifyURL}") + @Value("${signature.v1.verify-url}") private String verifyURL; - @Value("${signature.v1.keysURL}") + @Value("${signature.v1.keys-url}") private String keysURL; @Autowired private RetryRestTemplate retryRestTemplate; diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java index 4f3bc6c86..3f4c4fa75 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java @@ -41,25 +41,25 @@ import static dev.sunbirdrc.registry.middleware.util.Constants.CONNECTION_FAILURE; @Component -@ConditionalOnExpression("${signature.enabled:false} && ('${signature.provider}' == 'dev.sunbirdrc.registry.service.impl.SignatureV2ServiceImpl')") +@ConditionalOnExpression("${signature.enabled:false} && ('${signature.provider-name}' == 'dev.sunbirdrc.registry.service.impl.SignatureV2ServiceImpl')") public class SignatureV2ServiceImpl implements SignatureService, ICertificateService { private static final Logger logger = LoggerFactory.getLogger(SignatureV2ServiceImpl.class); - @Value("${signature.v2.healthCheckURL}") + @Value("${signature.v2.health-check-url}") private String healthCheckUrl; - @Value("${signature.v2.issueCredentialURL}") + @Value("${signature.v2.issue-url}") private String issueCredentialURL; - @Value("${signature.v2.getCredentialByIdURL}") + @Value("${signature.v2.get-url}") private String getCredentialByIdURL; - @Value("${signature.v2.deleteCredentialByIdURL}") + @Value("${signature.v2.delete-url}") private String deleteCredentialByIdURL; - @Value("${signature.v2.verifyCredentialURL}") + @Value("${signature.v2.verify-url}") private String verifyCredentialURL; - @Value("${signature.v2.getRevocationListURL}") + @Value("${signature.v2.revocation-list-url}") private String getRevocationListURL; - @Value("${signature.v2.credentialDidMethod}") + @Value("${signature.v2.credential-did-method}") private String credentialMethod; - @Value("${signature.v2.issuerDidMethod}") + @Value("${signature.v2.issuer-did-method}") private String credentialIssuerMethod; @Autowired diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/sink/JanusGraphStorage.java b/java/registry/src/main/java/dev/sunbirdrc/registry/sink/JanusGraphStorage.java index 64bb9e4df..a9441a87e 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/sink/JanusGraphStorage.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/sink/JanusGraphStorage.java @@ -50,14 +50,14 @@ public JanusGraphStorage(Environment environment, DBConnectionInfo connectionInf } public JanusGraphStorage(Environment environment) { - String graphFactory = environment.getProperty("database.janus_cassandra.graphFactory"); - String storageBackend = environment.getProperty("database.janus_cassandra.storage.backend"); - String hostname = environment.getProperty("database.janus_cassandra.storage.hostname"); - String storageKeyspace = environment.getProperty("database.janus_cassandra.storage.keyspace"); - String dbCacheSize = environment.getProperty("database.janus_cassandra.db.cache.size"); - String dbCacheCleanUpWaitTime = environment.getProperty("database.janus_cassandra.db.cache.clean.wait"); - String searchIndex = environment.getProperty("database.janus_cassandra.index.storage.backend"); - String searchHostname = environment.getProperty("database.janus_cassandra.index.hostname"); + String graphFactory = environment.getProperty("database.janus-cassandra.graph-factory"); + String storageBackend = environment.getProperty("database.janus-cassandra.storage.backend"); + String hostname = environment.getProperty("database.janus-cassandra.storage.hostname"); + String storageKeyspace = environment.getProperty("database.janus-cassandra.storage.keyspace"); + String dbCacheSize = environment.getProperty("database.janus-cassandra.db-cache-size"); + String dbCacheCleanUpWaitTime = environment.getProperty("database.janus-cassandra.db-cache-clean-wait"); + String searchIndex = environment.getProperty("database.janus-cassandra.index.storage-backend"); + String searchHostname = environment.getProperty("database.janus-cassandra.index.hostname"); setProvider(Constants.GraphDatabaseProvider.CASSANDRA); Configuration config = new BaseConfiguration(); diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/util/EntityParenter.java b/java/registry/src/main/java/dev/sunbirdrc/registry/util/EntityParenter.java index 1fc735115..86179216b 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/util/EntityParenter.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/util/EntityParenter.java @@ -34,7 +34,7 @@ public class EntityParenter { @Autowired private IndexHelper indexHelper; - @Value("${database.uuidPropertyName}") + @Value("${database.uuid-property-name}") public String uuidPropertyName; @Autowired diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/util/EntityTypeHandler.java b/java/registry/src/main/java/dev/sunbirdrc/registry/util/EntityTypeHandler.java index 1c9bd3019..3427422b3 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/util/EntityTypeHandler.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/util/EntityTypeHandler.java @@ -10,7 +10,7 @@ public class EntityTypeHandler { private final List externalEntities; - public EntityTypeHandler(@Value("${registry.externalentities}") String[] externalEntities) { + public EntityTypeHandler(@Value("${registry.external-entities}") String[] externalEntities) { this.externalEntities = Arrays.asList(externalEntities); } diff --git a/java/registry/src/main/resources/application.yml b/java/registry/src/main/resources/application.yml index c4972a3e2..5bdd7af80 100644 --- a/java/registry/src/main/resources/application.yml +++ b/java/registry/src/main/resources/application.yml @@ -8,22 +8,21 @@ spring: servlet: multipart: enabled: true - max-file-size: ${max_file_size:5MB} - max-request-size: ${max_request_size:5MB} + max-file-size: ${MAX_FILE_SIZE:5MB} + max-request-size: ${MAX_REQUEST_SIZE:5MB} output: ansi: enabled: ALWAYS oauth2: - resources: + resource: - uri: ${oauth2_resource_uri:http://localhost:8080/auth/realms/sunbird-rc} - properties: - emailPath: ${oauth2_resource_email_path:email} - consentPath: ${oauth2_resource_consent_path:consent} - rolesPath: ${oauth2_resource_roles_path:realm_access.roles} - entityPath: ${oauth2_resource_entity_path:entity} - userIdPath: ${oauth2_resource_user_id_path:sub} + email-path: ${oauth2_resource_email_path:email} + consent-path: ${oauth2_resource_consent_path:consent} + roles-path: ${oauth2_resource_roles_path:realm_access.roles} + entity-path: ${oauth2_resource_entity_path:entity} + user-id-path: ${oauth2_resource_user_id_path:sub} @@ -32,78 +31,76 @@ environment: default server: # Change this port number if you want to run it on another. - port: ${server_port:8081} + port: 8081 notification: - service: - enabled: ${notification_enabled:false} - connection_url: ${notification_url:http://localhost:8765/notification-service/v1/notification} - health_url: ${notification_url:http://localhost:8765/notification-service/v1/health} - async: - enabled: ${notification_async_enabled:false} - topic: ${notification_topic:notify} + enabled: false + url: http://localhost:8765/notification-service/v1/notification + health-check-url: http://localhost:8765/notification-service/v1/health + async-enabled: false + topic: notify invite: - required_validation_enabled: ${invite_required_validation_enabled:true} - signature_enabled: ${invite_signature_enabled:true} + skip-required-validation: true + skip-signature: true cors: # By default, allowing all domains to access this service. Choose a particular domain, # in production. For example, http://otherservice.com:9090, to allow requests from otherservice.com. - allowedOrigin: ${cors_allowedOrigin:*} + allowed-origin: '*' perf: monitoring: - enabled: ${perf_monitoring_enabled:false} - + enabled: false registry: - perRequest: - indexCreation: + per-request: + index-creation: enabled: ${registry_perRequest_indexCreation_enabled:true} - baseAPIS: - enable: ${registry_base_apis_enable:false} - externalentities: ${external_entities:} + base-apis: + enabled: ${registry_base_apis_enable:false} + external-entities: ${external_entities:} context: - base: ${registry_context_base:http://localhost:8081/} + base: http://localhost:8081/ system: - base: ${registry_system_base:http://localhost:8081/sunbirdrc/} - rootEntity: - type: ${registry_rootentity_type:Teacher} + base: http://localhost:8081/sunbirdrc/ schema: - url: ${registry_schema_url:http://localhost:8081/_schemas/} - attestationPolicy: - search_enabled: ${search_attestation_db:false} - createAccess: ${create_attestation_access_entities:User} - manager: - type: ${manager_type:DefinitionsManager} - redis: - host: ${redis_host:localhost} - port: ${redis_port:6379} - hard_delete_enabled: ${hard_delete_enabled:false} - expandReference: ${expand_reference:false} + url: http://localhost:8081/_schemas/ + attestation-policy: + search-enabled: ${search_attestation_db:false} + create-access: ${create_attestation_access_entities:User} + hard-delete-enabled: ${hard_delete_enabled:false} + expand-reference: ${expand_reference:false} + +definitions: + manager-type: ${manager_type:DefinitionsManager} + +redis: + host: redis + port: 6379 workflow: enabled: ${workflow.enable:true} -view_template_decrypt_private_fields: ${view_template_decrypt_private_fields:false} +view-template: + decrypt-private-fields: false async: - enabled: ${async_enabled:false} + enabled: false event: - enabled: ${event_enabled:false} - topic: ${event_topic:events} - providerName: ${event_providerName:dev.sunbirdrc.registry.service.impl.KafkaEventService} + enabled: false + topic: events + provider-name: ${event_providerName:dev.sunbirdrc.registry.service.impl.KafkaEventService} kafka: - bootstrapAddress: ${kafka_bootstrap_address:localhost:9094} - createEntityTopic: ${kafka_create_entity_topic:create_entity} - postCreateEntityTopic: ${kafka_post_create_entity_topic:post_create_entity} + bootstrap-address: kafka:9092 + create-entity-topic: create_entity + post-create-entity-topic: post_create_entity webhook: - enabled: ${webhook_enabled:false} - url: ${webhook_url:http://localhost:5001/api/v1/callback} + enabled: false + url: http://localhost:5001/api/v1/callback -conditionalAccess: +conditional-access: internal: _internal private: _private @@ -111,54 +108,54 @@ conditionalAccess: # offset: search result starts from value provided as default # limits: search result to value provided as default search: - offset: ${search_offset:0} - limit: ${search_limit:2000} + offset: 0 + limit: 2000 # The search mechanism to use. Values could be either NativeSearchService or ElasticSearchService # If NativeSearchService, then every search API uses the same database as the writes. May # not offer high speed reads. This is the default search service, if this config is not provided. # If ElasticSearchService, then Elastic search is used. - expandInternal: ${search_expandInternal:true} - removeNonPublicFieldsForNativeSearch: ${remove_non_public_fields_for_native_search:true} - providerName: ${search_providerName:dev.sunbirdrc.registry.service.NativeSearchService} + expand-internal: ${search_expandInternal:true} + remove-non-public-fields-for-native-search: true + provider-name: ${search_providerName:dev.sunbirdrc.registry.service.NativeSearchService} # This property is to be used for read request read: # The read mechanism to use, values could be either NativeReadService or ElasticReadService - providerName: dev.sunbirdrc.registry.service.NativeReadService + provider-name: dev.sunbirdrc.registry.service.NativeReadService database: # This property is internal and not to be confused with the schema definition. # Clients use this property to perform read/update operation. # NOTE: Once a name is chosen it must not be changed, unless you're ready to let go the # existing data in the database. - uuidPropertyName: ${database_uuidPropertyName:osid} + uuid-property-name: ${database_uuidPropertyName:osid} # Providers available are NEO4J, SQLG, CASSANDRA, ORIENTDB, TINKERGRAPH (in-memory). # NOTE: Values given against 'shardId' must be unique - provider: ${database_provider:SQLG} + provider: SQLG # Choose "none" as the propertyName if you don't want any shards. Otherwise # implement IShardAdvisor interface in your own ways. An example, SerialNumShardAdvisor # has been provided for reference. If you'd like to use it, set value "serialNum" here. # Note that "serialNum" must then be part of the payload. - shardProperty: ${database_shardProperty:none} + shard-property: ${database_shardProperty:none} # This property is instruction to use the shard advisor. # Values could be dev.sunbirdrc.registry.sink.shard.DefaultShardAdvisor, OR # dev.sunbirdrc.registry.sink.shard.SerialNumberShardAdvisor OR # absolute class name of your advisor class. # If this property not provided, advisor is set to DefaultShardAdvisor - shardAdvisorClassName: dev.sunbirdrc.registry.sink.shard.DefaultShardAdvisor + shard-advisor-class-name: dev.sunbirdrc.registry.sink.shard.DefaultShardAdvisor - connectionInfo: + connection-info: - # shardId, shardlabel must be a unique identifier to each connection. - shardId: shard1 + shard-id: shard1 # shardLabel is used as prefix for a uuid. Could be any alpha numeric string # Example of a record identifier: 1-60f76147-0acd-4dff-b75a-2d811787d04d # Note '1' is the label used for record identifier # shardLabel is not stored in the database - shardLabel: 1 + shard-label: 1 # The format of the URI can be learnt from the following links - # * 1. Graph database (Neo4J) @@ -173,7 +170,7 @@ database: username: ${connectionInfo_username:postgres} password: ${connectionInfo_password:postgres} - maxPoolSize: ${connectionInfo_maxPoolSize:200} + max-pool-size: ${connectionInfo_maxPoolSize:200} # Any other shard information follows... #- @@ -187,43 +184,39 @@ database: # Uncomment the following section to use Cassandra as backend store # ################################################################################## cassandra: - graphFactory: org.janusgraph.core.JanusGraphFactory + graph-factory: org.janusgraph.core.JanusGraphFactory backend: "cql" - hostname: ${cassandra_host:localhost} - keyspace: ${cassandra_keyspace:registry_db} - db.cache.size: ${cassandra_db_cache_size:0.25} + hostname: localhost + keyspace: registry_db + db-cache-size: 0.25 # wait time in milliseconds to clean the cache - db.cache.clean.wait: ${cassandra_db_cache_clean_wait:60} + db-cache-clean-wait: 60 index: - storage.backend: ${cassandr_index_storage:elasticsearch} - hostname: ${cassandra_index_hostname:localhost} + storage-backend: elasticsearch + hostname: localhost # File for framing the entity while reading frame: - file: ${frame_file:frame.json} - + file: frame.json encryption: - enabled: ${encryption_enabled:false} - healthCheckURL: ${encryption_health_check_url:http://localhost:8013/health} - uri: ${encryption_uri:http://localhost:8013/crypto/v1/_encrypt} - batch: - uri: ${encryption_batch_uri:http://localhost:8013/crypto/v1/_encrypt} - method: ${encryption_method:Normal} - tenant: - id: ${encryption_tenant_id:default} - + enabled: false + health-check-url: http://localhost:8013/health + url: ${encryption_uri:http://localhost:8013/crypto/v1/_encrypt} + batch-url: ${encryption_batch_uri:http://localhost:8013/crypto/v1/_encrypt} + method: Normal + tenant-id: default decryption: - uri: ${decryption_uri:http://localhost:8013/crypto/v1/_decrypt} - batch: - uri: ${decryption_batch_uri:http://localhost:8013/crypto/v1/_decrypt} + url: ${decryption_uri:http://localhost:8013/crypto/v1/_decrypt} + batch-url: ${decryption_batch_uri:http://localhost:8013/crypto/v1/_decrypt} certificate: - enabled: ${certificate_enabled:true} - templateBaseUrl: ${template_base_url:http://localhost:8081/api/v1/templates/} - healthCheckURL: ${certificate_health_check_url:http://localhost:8078/health} - apiUrl: ${pdf_url:http://localhost:8078/api/v1/certificate} - templateFolderPath: ${template_folder_path:public/_schemas/templates/} - enableExternalTemplates: ${enable_external_templates:false} + enabled: false + health-check-url: http://localhost:8078/health + pdf-url: ${pdf_url:http://localhost:8078/api/v1/certificate} +template: + base-url: http://localhost:8081/api/v1/templates/ + folder-path: public/_schemas/templates/ + external-enabled: ${enable_external_templates:false} # This audit configuration will enable audit logging in the system, use audit_frame.json to create a schema for database /elastic storage. # data_store can have following values @@ -232,159 +225,138 @@ certificate: # * ELASTIC : Store the audit log in elastic search configured in elastic properties. # Note : Database Stores the created audit schema in audit_schema folder. audit: - enabled: ${audit_enabled:true} - frame: - store: ${audit_frame_store:DATABASE} - suffix: ${audit_suffix:Audit} - suffixSeparator: ${audit_suffixSeparator:_} + enabled: true + frame-store: DATABASE + suffix: Audit + suffix-separator: ${audit_suffixSeparator:_} + +authentication: + enabled: true identity: - provider: ${identity_provider:dev.sunbirdrc.auth.keycloak.KeycloakProviderImpl} + provider-name: ${identity_provider:dev.sunbirdrc.auth.keycloak.KeycloakProviderImpl} url: ${sunbird_sso_url:http://localhost:8080/auth/} + create-user-path: /admin/realms/sunbird-rc/users realm: ${sunbird_sso_realm:sunbird-rc} - client_id: ${sunbird_sso_admin_client_id:admin-api} - client_secret: ${sunbird_sso_admin_client_secret:xxx} - set_default_password: ${sunbird_keycloak_user_set_password:false} - default_password: ${sunbird_keycloak_user_password:abcd@1234} - user_actions: ${identity_user_actions:} - -keycloak: - #publicKey: ${sunbird_sso_publickey:pk} - auth-server-url: ${sunbird_sso_url:http://localhost:8080/auth} - realm: ${sunbird_sso_realm:sunbird-rc} - resource: ${sunbird_sso_client_id:client} -keycloak-admin: - client-id: ${sunbird_sso_admin_client_id:admin-api} - client-secret: ${sunbird_sso_admin_client_secret:client_secret} -keycloak-user: + admin-client-id: ${sunbird_sso_admin_client_id:admin-api} + admin-client-secret: ${sunbird_sso_admin_client_secret:xxx} set-default-password: ${sunbird_keycloak_user_set_password:false} default-password: ${sunbird_keycloak_user_password:abcd@123} - # email actions which will be trigger by keycloak - # example email actions: VERIFY_EMAIL, UPDATE_PROFILE, UPDATE_PASSWORD, TERMS_AND_CONDITIONS etc. - # email details should be configured in keycloak realm settings - email-actions: ${keycloack_user_email_actions:} -claims: - enabled: ${claims_enabled:true} - url: ${claims_url:http://localhost:8082} -authentication: - enabled: ${authentication_enabled:true} - publicKey: ${authentication_publickey:} - realm: ${authentication_realm:sunbird-rc} - url: ${authentication_url:localhost:8443/auth} + user-actions: +claims: + enabled: false + url: http://localhost:8082 validation: - enabled: ${validation_enabled:true} - type: ${validation_type:json} + enabled: true + type: json # Sets the service request and retry related configuration service: connection: # Set the connection timeout for the underlying request configuration - timeout: ${service_connection_timeout:5000} + timeout: 5000 # Set the timeout in milliseconds used when requesting a connection from the connection manager using the underlying request Configuration request: - timeout: ${service_connection_request_timeout:5000} + timeout: 5000 # Set the socket read timeout for the underlying request configuration read: - timeout: ${service_read_timeout:5000} + timeout: 5000 retry: # The number of times an attempt must be made to reach to the service. - maxAttempts: ${service_retry_maxAttempts:5} + max-attempts: ${service_retry_maxAttempts:5} backoff: # The fixed time interval, in milliseconds, between each such attempt. - delay: ${service_retry_backoff_delay:1000} + delay: 1000 -httpConnection: - maxConnections: ${http_max_connections:100} +http: + max-connections: 100 # Sets the task-executor configuration for threads -taskExecutor: +task-executor: index: # Specify the prefix to use for the names of newly created threads. - threadPoolName: ${taskExecutor_index_threadPoolName:IndexThread-} + thread-pool-name: ${taskExecutor_index_threadPoolName:IndexThread-} # Set the ThreadPoolExecutor's core pool size. - corePoolSize: ${taskExecutor_index_corePoolSize:2} + core-pool-size: ${taskExecutor_index_corePoolSize:2} # Set the ThreadPoolExecutor's maximum pool size. - maxPoolSize: ${taskExecutor_index_maxPoolSize:2} + max-pool-size: ${taskExecutor_index_maxPoolSize:2} # Set the capacity for the ThreadPoolExecutor's BlockingQueue. - queueCapacity: ${taskExecutor_index_queueCapacity:100} + queue-capacity: ${taskExecutor_index_queueCapacity:100} # Sets the task-executor configuration for threads while auditing -auditTaskExecutor: +audit-task-executor: # Specify the prefix to use for the names of newly created threads. - threadPoolName: ${auditTaskExecutor_threadPoolName:AuditThread-} + thread-pool-name: ${auditTaskExecutor_threadPoolName:AuditThread-} # Set the ThreadPoolExecutor's core pool size. - corePoolSize: ${auditTaskExecutor_corePoolSize:2} + core-pool-size: ${auditTaskExecutor_corePoolSize:2} # Set the ThreadPoolExecutor's maximum pool size. - maxPoolSize: ${auditTaskExecutor_maxPoolSize:2} + max-pool-size: ${auditTaskExecutor_maxPoolSize:2} # Set the capacity for the ThreadPoolExecutor's BlockingQueue. - queueCapacity: ${auditTaskExecutor_queueCapacity:100} + queue-capacity: ${auditTaskExecutor_queueCapacity:100} # elastic-search configuration details elastic: search: - # elastic-search can be enable and disable through this flag - enabled: ${elastic_search_enabled:false} # elastic-search connection info - connection_url: ${elastic_search_connection_url:localhost:9200} - add_shard_prefix: ${elastic_search_add_shard_prefix:true} + connection-url: localhost:9200 + add-shard-prefix: true #if authentication is enabled - auth_enabled: ${elastic_search_auth_enabled:false} - elastic_username: ${elastic_search_username:elastic} - elastic_password: ${elastic_search_password:elastic} - scheme: ${elastic_search_scheme:http} -filestorage: - enabled: ${filestorage_enabled:false} - url: ${filestorage_connection_url:http://localhost:9000} - accesskey: ${filestorage_access_key:XXXXX} - secretkey: ${filestorage_secret_key:XXXXX} - bucketname: ${filestorage_bucket_key:dummy} - -api-swagger: - enabled: ${swagger_enabled:true} - title: ${swagger_title:Sunbird Registry and Credential} - description: ${swagger_description:Sunbird registry and credential api (SunbirdRC)} - version: ${swagger_version:1.0.0} + auth-enabled: false + username: elastic + password: elastic + scheme: http +file-storage: + enabled: false + connection-url: http://localhost:9000 + access-key: XXXXX + secret-key: XXXXX + bucket-name: dummy + +swagger: + enabled: true + title: Sunbird Registry and Credential + description: Sunbird registry and credential api (SunbirdRC) + version: 1.0.0 idgen: - enabled: ${idgen_enabled:false} - tenantId: ${idgen_tenant_id:default} - healthCheckURL: ${idgen_health_check_url:http://localhost:8088/egov-idgen/health} - generateURL: ${idgen_generate_url:http://localhost:8088/egov-idgen/id/_generate} - idFormatURL: ${idgen_id_format_url:http://localhost:8088/egov-idgen/id/_format/add} + enabled: idgen_enabled:false + tenant-id: default + health-check-url: http://localhost:8088/egov-idgen/health + generate-url: http://localhost:8088/egov-idgen/id/_generate + id-format-url: http://localhost:8088/egov-idgen/id/_format/add did: - enabled: ${did_enabled:false} - healthCheckURL: ${did_health_check_url:http://localhost:3332/health} - generateURL: ${did_generate_url:http://localhost:3332/did/generate} - resolveURL: ${did_resolve_url:http://localhost:3332/did/resolve/{id}} + enabled: false + health-check-url: http://localhost:3332/health + generate-url: http://localhost:3332/did/generate + resolve-url: http://localhost:3332/did/resolve/{id} signature: - enabled: ${signature_enabled:false} - provider: ${signature_provider:dev.sunbirdrc.registry.service.impl.SignatureV1ServiceImpl} + enabled: false + provider-name: dev.sunbirdrc.registry.service.impl.SignatureV1ServiceImpl v1: - healthCheckURL: ${sign_health_check_url:http://localhost:8079/health} - signURL: ${sign_url:http://localhost:8079/sign} - verifyURL: ${verify_url:http://localhost:8079/verify} - keysURL: ${keys_url:http://localhost:8013/keys/} - domain: ${domain_url:https://w3id.org/security/v1/} + health-check-url: ${sign_health_check_url:http://localhost:8079/health} + sign-url: ${sign_url:http://localhost:8079/sign} + verify-url: ${verify_url:http://localhost:8079/verify} + keys-url: ${keys_url:http://localhost:8013/keys/} v2: - credentialDidMethod: ${signature_v2_credential_did_method:rcw} - issuerDidMethod: ${signature_v2_issuer_did_method:issuer} - healthCheckURL: ${signature_v2_health_check_url:http://localhost:3000/health} - issueCredentialURL: ${signature_v2_issue_url:http://localhost:3000/credentials/issue} - getCredentialByIdURL: ${signature_v2_get_url:http://localhost:3000/credentials/{id}} - deleteCredentialByIdURL: ${signature_v2_delete_url:http://localhost:3000/credentials/{id}} - verifyCredentialURL: ${signature_v2_verify_url:http://localhost:3000/credentials/{id}/verify} - getRevocationListURL: ${signature_v2_revocation_list_url:http://localhost:3000/credentials/revocation-list?issuerId={issuerDid}&page={page}&limit={limit}} + credential-did-method: rcw + issuer-did-method: issuer + health-check-url: http://localhost:3000/health + issue-url: http://localhost:3000/credentials/issue + get-url: http://localhost:3000/credentials/{id} + delete-url: http://localhost:3000/credentials/{id} + verify-url: http://localhost:3000/credentials/{id}/verify + revocation-list-url: http://localhost:3000/credentials/revocation-list?issuerId={issuerDid}&page={page}&limit={limit} schema: - author: ${signature_v2_schema_author:Registry} - authorDidMethod: ${signature_v2_schema_author_did_method:author} - healthCheckURL: ${signature_v2_schema_health_check_url:http://localhost:3333/health} - createSchemaURL: ${signature_v2_schema_create_url:http://localhost:3333/credential-schema} - updateSchemaURL: ${signature_v2_schema_update_url:http://localhost:3333/credential-schema/{id}/{version}} - getSchemaByIdAndVersionURL: ${signature_v2_schema_get_by_id_and_version_url:http://localhost:3333/credential-schema/{id}/{version} - getSchemaByTagsURL: ${signature_v2_schema_search_by_tags_url:http://localhost:3333/credential-schema?tags={tags}} + author: Registry + author-did-method: author + health-check-url: http://localhost:3333/health + create-url: http://localhost:3333/credential-schema + update-url: http://localhost:3333/credential-schema/{id}/{version} + get-by-id-and-version-url: http://localhost:3333/credential-schema/{id}/{version} + search-by-tags-url: http://localhost:3333/credential-schema?tags={tags} --- ################################################################## @@ -400,12 +372,11 @@ spring: name: test-yaml enviroment: test workflow: - enabled: ${workflow.enable:true} -view_template: - decrypt_private_fields: ${view_template_decrypt_private_fields:false} + enabled: true +view-template: + decrypt-private-fields: false notification: - service: - enabled: true + enabled: true perf: monitoring: enabled: false @@ -415,28 +386,27 @@ registry: base: http://example.com/voc/teacher/1.0.0/ system: base: http://example.com/voc/opensaber/ - expandReference: ${expand_reference:false} + expand-reference: false # This property is to be used for read request read: # The read mechanism to use, values could be either NativeReadService or ElasticReadService - providerName: io.opensaber.registry.service.NativeReadService + provider-name: io.opensaber.registry.service.NativeReadService database: # This property is internal. Clients use this property to perform read/update operation. # NOTE: Once a uuidPropertyName is chosen it must not be changed, unless you're ready to let go the # existing data in the database. - uuidPropertyName: ${database_uuidPropertyName:osid} + uuid-property-name: osid # Providers available are NEO4J, SQLG, TINKERGRAPH, CASSANDRA, ORIENTDB. # NOTE: Values given against 'shardId' must be unique - provider: ${database_provider:TINKERGRAPH} + provider: TINKERGRAPH # Choose "none" as the propertyName if you don't want any shards. Otherwise # implement IShardAdvisor interface in your own ways. An example, SerialNumShardAdvisor # has been provided for reference. If you'd like to use it, set value "serialNum" here. - shardProperty: ${database_shardProperty:none} - # Any other provider breaks the unit tests, needs a work-item + shard-property: none # File for framing the entity while reading frame: @@ -444,25 +414,21 @@ frame: encryption: enabled: true - base: https://dev.sunbirded.org/encryption/ - uri: https://dev.sunbirded.org/encryption/encrypt - batch: - uri: https://dev.sunbirded.org/encryption/encrypt/obj + url: https://dev.sunbirded.org/encryption/encrypt + batch-url: https://dev.sunbirded.org/encryption/encrypt/obj decryption: - uri: https://dev.sunbirded.org/encryption/decrypt - batch: - uri: https://dev.sunbirded.org/encryption/decrypt/obj + url: https://dev.sunbirded.org/encryption/decrypt + batch-url: https://dev.sunbirded.org/encryption/decrypt/obj signature: - enabled: ${signature_enabled:true} - provider: ${signature_provider:dev.sunbirdrc.registry.service.impl.SignatureV1ServiceImpl} + enabled: true + provider: dev.sunbirdrc.registry.service.impl.SignatureV1ServiceImpl v1: - healthCheckURL: ${sign_health_check_url:https://dev.sunbirded.org/encryption/} - signURL: ${sign_url:https://dev.sunbirded.org/encryption/sign} - verifyURL: ${verify_url:https://dev.sunbirded.org/encryption/verify} - keysURL: ${keys_url:https://dev.sunbirded.org/encryption/keys/} - domain: ${domain_url:https://w3id.org/security/v1/} + health-check-url: https://dev.sunbirded.org/encryption/ + sign-url: https://dev.sunbirded.org/encryption/sign + verify-url: https://dev.sunbirded.org/encryption/verify + keys-url: https://dev.sunbirded.org/encryption/keys/ # These properties are used to enable the audit log @@ -472,74 +438,50 @@ signature: # suffixSeperator : specifies the separator used between entity name and suffix. If audit schema name is Teacher_Audit.json, the suffixSeperator is _. audit: - enabled: ${audit_enabled:false} - frame: - store: ${audit_frame_store:DATABASE} - suffix: ${audit_suffix:Audit} - suffixSeparator: ${audit_suffixSeparator:_} + enabled: false + frame-store: DATABASE + suffix: Audit + suffix-separator: _ authentication: - enabled: ${authentication_enabled:true} - publicKey: ${authentication_publickey:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqe1lVD9jnQWQce62e2Q44tACqBIt5UZyGzCegxax2gddj4xotY5BDxaxuJRGKDLRpm8lPNHxX8dce8SUVAMBfk85rL+Bxv1mjspKo7Q5qsFm9TGcvE4e/4xhgpMjw6dCFt8+S87jvRjmDHjakGMooOls1kjppQiklSEZ0lW3Crqet4RNjb1FNJ+2Jg26frm8i2cpb2wRnmLDuQ9sAnHCxAD2rGxSGLXhKABptbMeTVx25eh+PVISjc78uOhAnMwOHKApVBGnVCfcUoVYqfkX8XcPQU9ybmAi27vp9xZqMfh6I56Tl4fsWYBgf8ZMl0UWyRR3PNmo/0kxon1d3zqFnwIDAQAB} - realm: ${authentication_realm:PartnerRegistry} - url: ${authentication_url:http://localhost:8443/auth/} - -keycloak: - sso: - publicKey: ${sunbird_sso_publickey} - realm: ${sunbird_sso_realm} - auth_server_url: ${sunbird_sso_url} + enabled: true validation: - enabled: ${validation_enabled:true} - type: ${validation_type:json} + enabled: true + type: json # Sets the service request and retry related configuration service: connection: - # Set the connection timeout for the underlying request configuration - timeout: ${service_connection_timeout:5000} - # Set the timeout in milliseconds used when requesting a connection from the connection manager using the underlying request Configuration + timeout: 5000 request: - timeout: ${service_connection_request_timeout:5000} - # Set the socket read timeout for the underlying request configuration + timeout: 5000 read: - timeout: ${service_read_timeout:5000} + timeout: 5000 retry: - # The number of times an attempt must be made to reach to the service. - maxAttempts: ${service_retry_maxAttempts:5} + max-attempts: 5 backoff: - # The fixed time interval, in milliseconds, between each such attempt. - delay: ${service_retry_backoff_delay:1000} + delay: 1000 # Sets the task-executor configuration for threads -taskExecutor: +task-executor: index: - # Specify the prefix to use for the names of newly created threads. - threadPoolName: ${taskExecutor_index_threadPoolName:IndexThread-} - # Set the ThreadPoolExecutor's core pool size. - corePoolSize: ${taskExecutor_index_corePoolSize:2} - # Set the ThreadPoolExecutor's maximum pool size. - maxPoolSize: ${taskExecutor_index_maxPoolSize:2} - # Set the capacity for the ThreadPoolExecutor's BlockingQueue. - queueCapacity: ${taskExecutor_index_queueCapacity:3} + thread-pool-name: IndexThread- + core-pool-size: 2 + max-pool-size: 2 + queue-capacity: 3 # Sets the task-executor configuration for threads while auditing -auditTaskExecutor: - # Specify the prefix to use for the names of newly created threads. - threadPoolName: ${auditTaskExecutor_threadPoolName:AuditThread-} - # Set the ThreadPoolExecutor's core pool size. - corePoolSize: ${auditTaskExecutor_corePoolSize:2} - # Set the ThreadPoolExecutor's maximum pool size. - maxPoolSize: ${auditTaskExecutor_maxPoolSize:2} - # Set the capacity for the ThreadPoolExecutor's BlockingQueue. - queueCapacity: ${auditTaskExecutor_queueCapacity:3} +audit-task-executor: + thread-pool-name: AuditThread- + core-pool-size: 2 + max-pool-size: 2 + queue-capacity: 3 # elastic-search configuration details elastic: search: - # elastic-search can be enable and disable through this flag - enabled: ${elastic_search_enabled:true} - # elastic-search connection info - connection_url: ${elastic_search_connection_url:localhost:9200} + connection-url: localhost:9200 +certificate: + enabled: true diff --git a/java/registry/src/test/java/dev/sunbirdrc/registry/controller/RegistryEntityControllerTest.java b/java/registry/src/test/java/dev/sunbirdrc/registry/controller/RegistryEntityControllerTest.java index 73d8f5434..3f171c273 100644 --- a/java/registry/src/test/java/dev/sunbirdrc/registry/controller/RegistryEntityControllerTest.java +++ b/java/registry/src/test/java/dev/sunbirdrc/registry/controller/RegistryEntityControllerTest.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import dev.sunbirdrc.pojos.AsyncRequest; import dev.sunbirdrc.pojos.SunbirdRCInstrumentation; +import dev.sunbirdrc.registry.middleware.util.Constants; import org.mockito.ArgumentMatchers; import dev.sunbirdrc.registry.exception.RecordNotFoundException; import dev.sunbirdrc.registry.helper.RegistryHelper; @@ -28,6 +29,7 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; @@ -45,6 +47,7 @@ @WebMvcTest({RegistryEntityController.class}) @ContextConfiguration(classes = {RegistryEntityController.class}) @AutoConfigureMockMvc(addFilters = false) +@ActiveProfiles({Constants.DEFAULT_ENVIRONMENT, Constants.TEST_ENVIRONMENT}) public class RegistryEntityControllerTest { @MockBean diff --git a/java/registry/src/test/java/dev/sunbirdrc/registry/dao/impl/SearchDaoImplTest.java b/java/registry/src/test/java/dev/sunbirdrc/registry/dao/impl/SearchDaoImplTest.java index 061d77928..370daaf55 100644 --- a/java/registry/src/test/java/dev/sunbirdrc/registry/dao/impl/SearchDaoImplTest.java +++ b/java/registry/src/test/java/dev/sunbirdrc/registry/dao/impl/SearchDaoImplTest.java @@ -60,7 +60,7 @@ public class SearchDaoImplTest { private final static int limit = 1; private final static boolean expandInternal = true; private List entities = new ArrayList<>(); - @Value("${registry.expandReference}") + @Value("${registry.expand-reference}") private boolean expandReferenceObj; diff --git a/java/registry/src/test/java/dev/sunbirdrc/registry/service/NotificationHelperTest.java b/java/registry/src/test/java/dev/sunbirdrc/registry/service/NotificationHelperTest.java index 6448199b2..de1b0d9ed 100644 --- a/java/registry/src/test/java/dev/sunbirdrc/registry/service/NotificationHelperTest.java +++ b/java/registry/src/test/java/dev/sunbirdrc/registry/service/NotificationHelperTest.java @@ -38,7 +38,7 @@ public class NotificationHelperTest { private DefinitionsManager definitionsManager; private ObjectMapper objectMapper; - @Value("${notification.service.enabled}") + @Value("${notification.enabled}") boolean notificationEnabled; private NotificationHelper notificationHelper; @Mock diff --git a/java/registry/src/test/java/dev/sunbirdrc/registry/service/impl/RegistryServiceImplTest.java b/java/registry/src/test/java/dev/sunbirdrc/registry/service/impl/RegistryServiceImplTest.java index e0b99b48b..071dc1750 100644 --- a/java/registry/src/test/java/dev/sunbirdrc/registry/service/impl/RegistryServiceImplTest.java +++ b/java/registry/src/test/java/dev/sunbirdrc/registry/service/impl/RegistryServiceImplTest.java @@ -64,7 +64,7 @@ public class RegistryServiceImplTest { @Value("${registry.schema.url}") private String schemaUrl; private String validationType = "json"; - @Value("${registry.expandReference}") + @Value("${registry.expand-reference}") private boolean expandReferenceObj; public Constants.SchemaType getValidationType() throws IllegalArgumentException { diff --git a/java/sunbirdrc-actors/src/main/java/dev/sunbirdrc/actors/ClaimPluginActor.java b/java/sunbirdrc-actors/src/main/java/dev/sunbirdrc/actors/ClaimPluginActor.java index 92fd01746..2c054fb66 100644 --- a/java/sunbirdrc-actors/src/main/java/dev/sunbirdrc/actors/ClaimPluginActor.java +++ b/java/sunbirdrc-actors/src/main/java/dev/sunbirdrc/actors/ClaimPluginActor.java @@ -28,7 +28,7 @@ public class ClaimPluginActor extends BaseActor { // TODO: read url from config - private final String claimRequestUrl = System.getenv().getOrDefault("claims_url", "http://localhost:8082"); + private final String claimRequestUrl = System.getenv().getOrDefault("claims_url", System.getenv().getOrDefault("CLAIMS_URL", "http://localhost:8082")); private final String CLAIMS_PATH = "/api/v1/claims"; RestTemplate restTemplate = new RestTemplate(); @@ -79,6 +79,7 @@ private void attestClaim(PluginRequestMessage pluginRequestMessage) throws IOExc } private String getClaimRequestUrl() { + logger.debug("claims request url: {} ", claimRequestUrl); if (isBlank(claimRequestUrl)) { logger.error("claims service url is not set but it seems to be in use."); } From 6ae900a62ee262b7b9fa37ccd53e171045947c52 Mon Sep 17 00:00:00 2001 From: Holash Chand Date: Mon, 8 Apr 2024 18:22:36 +0530 Subject: [PATCH 2/8] changed environment variables for other services and docker compose file --- docker-compose.yml | 206 +++++++++--------- java/claim/Makefile | 2 +- .../claim/service/SunbirdRCClient.java | 2 +- .../src/main/resources/application.properties | 2 +- .../resources/application.properties.sample | 2 +- 5 files changed, 113 insertions(+), 101 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 96e593abd..4aa06cbdb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,87 +45,93 @@ services: - ./${SCHEMA_DIR-java/registry/src/main/resources/public/_schemas}:/home/sunbirdrc/config/public/_schemas - ./${VIEW_DIR-java/registry/src/main/resources/views}:/home/sunbirdrc/config/views/ environment: - - connectionInfo_uri=jdbc:postgresql://db:5432/registry - - connectionInfo_username=postgres - - connectionInfo_password=postgres - - encryption_enabled=${ENCRYPTION_ENABLED-false} - - encryption_health_check_url=http://encryption-service:8013/health - - encryption_uri=http://encryption-service:8013/crypto/v1/_encrypt - - encryption_batch_uri=http://encryption-service:8013/crypto/v1/_encrypt - - event_enabled=${EVENT_ENABLED-false} - - event_topic=events - - event_providerName=dev.sunbirdrc.registry.service.impl.KafkaEventService - - elastic_search_connection_url=${ELASTIC_SEARCH_CONNECTION_URL-es:9200} - - elastic_search_scheme=${ELASTIC_SEARCH_SCHEME-http} - - elastic_search_auth_enabled=${ELASTIC_SECURITY_ENABLED-false} - - elastic_search_username=${ELASTIC_SEARCH_USERNAME-elastic} - - elastic_search_password=${ELASTIC_SEARCH_PASSWORD} - - search_providerName=${SEARCH_PROVIDER_NAME-dev.sunbirdrc.registry.service.NativeSearchService} - - sunbird_sso_realm=${KEYCLOAK_REALM-sunbird-rc} - - sunbird_sso_url=${sunbird_sso_url-http://keycloak:8080/auth} - - OAUTH2_RESOURCES_0_URI=${oauth2_resource_uri-http://keycloak:8080/auth/realms/sunbird-rc} - - OAUTH2_RESOURCES_0_PROPERTIES_ROLES_PATH=${oauth2_resource_roles_path-realm_access.roles} - - identity_provider=${identity_provider-dev.sunbirdrc.auth.keycloak.KeycloakProviderImpl} - - idgen_enabled=${IDGEN_ENABLED-false} - - idgen_health_check_url=http://id-gen-service:8088/egov-idgen/health - - idgen_generate_url=http://id-gen-service:8088/egov-idgen/id/_generate - - idgen_id_format_url=http://id-gen-service:8088/egov-idgen/id/_format/add - - sunbird_sso_admin_client_id=${KEYCLOAK_ADMIN_CLIENT_ID-admin-api} - - sunbird_sso_client_id=${KEYCLOAK_CLIENT_ID-registry-frontend} - - sunbird_sso_admin_client_secret=${KEYCLOAK_SECRET} - - claims_enabled=${CLAIMS_ENABLED-false} - - claims_url=http://claim-ms:8082 - - did_enabled=${DID_ENABLED-false} - - did_health_check_url=http://identity:3332/health - - did_generate_url=http://identity:3332/did/generate - - did_resolve_url=http://identity:3332/did/resolve/{id} - - signature_enabled=${SIGNATURE_ENABLED-false} - - signature_provider=${SIGNATURE_PROVIDER-dev.sunbirdrc.registry.service.impl.SignatureV2ServiceImpl} - - signature_v2_credential_did_method=rcw - - signature_v2_issuer_did_method=issuer - - signature_v2_schema_author=Registry - - signature_v2_schema_author_did_method=author - - signature_v2_health_check_url=http://credential:3000/health - - signature_v2_issue_url=http://credential:3000/credentials/issue - - signature_v2_get_url=http://credential:3000/credentials/{id} - - signature_v2_delete_url=http://credential:3000/credentials/{id} - - signature_v2_verify_url=http://credential:3000/credentials/{id}/verify - - signature_v2_revocation_list_url=http://credential:3000/credentials/revocation-list?issuerId={issuerDid}&page={page}&limit={limit} - - signature_v2_schema_health_check_url=http://credential-schema:3333/health - - signature_v2_schema_create_url=http://credential-schema:3333/credential-schema - - signature_v2_schema_update_url=http://credential-schema:3333/credential-schema/{id}/{version} - - signature_v2_schema_get_by_id_and_version_url=http://credential-schema:3333/credential-schema/{id}/{version} - - signature_v2_schema_search_by_tags_url=http://credential-schema:3333/credential-schema?tags={tags} - - sign_url=http://certificate-signer:8079/sign - - verify_url=http://certificate-signer:8079/verify - - sign_health_check_url=http://certificate-signer:8079/health - - certificate_enabled=${CERTIFICATE_ENABLED-false} - - pdf_url=http://certificate-api:8078/api/v1/certificatePDF - - certificate_health_check_url=http://certificate-api:8078/health - - template_base_url=http://registry:8081/api/v1/templates/ #Looks for certificate templates for pdf copy of the signed certificate - - sunbird_keycloak_user_set_password=true - - filestorage_enabled=${FILESSTORAGE_ENABLED-false} - - filestorage_connection_url=http://file-storage:9000 - - filestorage_access_key=admin - - filestorage_secret_key=12345678 - - filestorage_bucket_key=issuance - - registry_base_apis_enable=false - - sunbird_keycloak_user_password=abcd@123 - - logging.level.root=INFO - - enable_external_templates=true - - async_enabled=${ASYNC_ENABLED-false} - - authentication_enabled=${AUTHENTICATION_ENABLED-false} - - kafka_bootstrap_address=kafka:9092 - - webhook_enabled=false - - webhook_url=http://localhost:5001/api/v1/callback - - redis_host=redis - - redis_port=6379 - - manager_type=${MANAGER_TYPE-DefinitionsManager} - - expand_reference=${EXPAND_REFERENCE-false} - - swagger_title=${SWAGGER_TITLE-Sunbird Registry and Credential} - - notification_async_enabled=${NOTIFICATION_ASYNC_ENABLED-false} - - notification_enabled=${NOTIFICATION_ENABLED-false} - - notification_url=${NOTIFICATION_URL-http://notification-ms:8765/notification-service/v1/notification} + - DATABASE_CONNECTION_INFO_0_URI=${DATABASE_URI-jdbc:postgresql://db:5432/registry} + - DATABASE_CONNECTION_INFO_0_USERNAME=${DATABASE_USERNAME-postgres} + - DATABASE_CONNECTION_INFO_0_PASSWORD=${DATABASE_PASSWORD-postgres} + - DATABASE_CONNECTION_INFO_0_SHARD_ID=shardId1 + - DATABASE_CONNECTION_INFO_0_SHARD_LABEL=1 + - DATABASE_CONNECTION_INFO_0_MAX_POOL_SIZE=200 + - ENCRYPTION_ENABLED=${ENCRYPTION_ENABLED-false} + - ENCRYPTION_HEALTH_CHECK_URL=http://encryption-service:8013/health + - ENCRYPTION_URL=http://encryption-service:8013/crypto/v1/_encrypt + - ENCRYPTION_BATCH_URL=http://encryption-service:8013/crypto/v1/_encrypt + - DECRYPTION_URL=http://encryption-service:8013/crypto/v1/_decrypt + - DECRYPTION_BATCH_URL=http://encryption-service:8013/crypto/v1/_decrypt + - EVENT_ENABLED=${EVENT_ENABLED-false} + - EVENT_TOPIC=events + - EVENT_PROVIDER_NAME=dev.sunbirdrc.registry.service.impl.KafkaEventService + - ELASTIC_SEARCH_CONNECTION_URL=${ELASTIC_SEARCH_CONNECTION_URL-es:9200} + - ELASTIC_SEARCH_SCHEME=${ELASTIC_SEARCH_SCHEME-http} + - ELASTIC_SEARCH_AUTH_ENABLED=${ELASTIC_SEARCH_AUTH_ENABLED-false} + - ELASTIC_SEARCH_USERNAME=${ELASTIC_SEARCH_USERNAME-elastic} + - ELASTIC_SEARCH_PASSWORD=${ELASTIC_SEARCH_PASSWORD} + - SEARCH_PROVIDER_NAME=${SEARCH_PROVIDER_NAME-dev.sunbirdrc.registry.service.NativeSearchService} + - OAUTH2_RESOURCE_0_URI=http://keycloak:8080/auth/realms/sunbird-rc + - OAUTH2_RESOURCE_0_ROLES_PATH=realm_access.roles + - AUTHENTICATION_ENABLED=${AUTHENTICATION_ENABLED-false} + - IDENTITY_PROVIDER_NAME=${IDENTITY_PROVIDER_NAME-dev.sunbirdrc.auth.keycloak.KeycloakProviderImpl} + - IDENTITY_REALM=${IDENTITY_REALM-sunbird-rc} + - IDENTITY_URL=${IDENTITY_URL-http://keycloak:8080/auth} + - IDENTITY_ADMIN_CLIENT_ID=${IDENTITY_ADMIN_CLIENT_ID-admin-api} + - IDENTITY_ADMIN_CLIENT_SECRET=${IDENTITY_ADMIN_CLIENT_SECRET} + - IDENTITY_SET_DEFAULT_PASSWORD=${IDENTITY_SET_DEFAULT_PASSWORD-true} + - IDENTITY_DEFAULT_PASSWORD=${IDENTITY_DEFAULT_PASSWORD-abcd@123} + - IDGEN_ENABLED=${IDGEN_ENABLED-false} + - IDGEN_HEALTH_CHECK_URL=http://id-gen-service:8088/egov-idgen/health + - IDGEN_GENERATE_URL=http://id-gen-service:8088/egov-idgen/id/_generate + - IDGEN_ID_FORMAT_URL=http://id-gen-service:8088/egov-idgen/id/_format/add + - CLAIMS_ENABLED=${CLAIMS_ENABLED-false} + - CLAIMS_URL=http://claim-ms:8082 + - DID_ENABLED=${DID_ENABLED-false} + - DID_HEALTH_CHECK_URL=http://identity:3332/health + - DID_GENERATE_URL=http://identity:3332/did/generate + - DID_RESOLVE_URL=http://identity:3332/did/resolve/{id} + - SIGNATURE_ENABLED=${SIGNATURE_ENABLED-false} + - SIGNATURE_PROVIDER_NAME=${SIGNATURE_PROVIDER_NAME-dev.sunbirdrc.registry.service.impl.SignatureV2ServiceImpl} + - SIGNATURE_V2_CREDENTIAL_DID_METHOD=rcw + - SIGNATURE_V2_ISSUER_DID_METHOD=issuer + - SIGNATURE_V2_SCHEMA_AUTHOR=Registry + - SIGNATURE_V2_SCHEMA_AUTHOR_DID_METHOD=author + - SIGNATURE_V2_HEALTH_CHECK_URL=http://credential:3000/health + - SIGNATURE_V2_ISSUE_URL=http://credential:3000/credentials/issue + - SIGNATURE_V2_GET_URL=http://credential:3000/credentials/{id} + - SIGNATURE_V2_DELETE_URL=http://credential:3000/credentials/{id} + - SIGNATURE_V2_VERIFY_URL=http://credential:3000/credentials/{id}/verify + - SIGNATURE_V2_REVOCATION_LIST_URL=http://credential:3000/credentials/revocation-list?issuerId={issuerDid}&page={page}&limit={limit} + - SIGNATURE_V2_SCHEMA_HEALTH_CHECK_URL=http://credential-schema:3333/health + - SIGNATURE_V2_SCHEMA_CREATE_URL=http://credential-schema:3333/credential-schema + - SIGNATURE_V2_SCHEMA_UPDATE_URL=http://credential-schema:3333/credential-schema/{id}/{version} + - SIGNATURE_V2_SCHEMA_GET_BY_ID_AND_VERSION_URL=http://credential-schema:3333/credential-schema/{id}/{version} + - SIGNATURE_V2_SCHEMA_SEARCH_BY_TAGS_URL=http://credential-schema:3333/credential-schema?tags={tags} + - SIGNATURE_V1_SIGN_URL=http://certificate-signer:8079/sign + - SIGNATURE_V1_VERIFY_URL=http://certificate-signer:8079/verify + - SIGNATURE_V1_HEALTH_CHECK_URL=http://certificate-signer:8079/health + - CERTIFICATE_ENABLED=${CERTIFICATE_ENABLED-false} + - CERTIFICATE_PDF_URL=http://certificate-api:8078/api/v1/certificatePDF + - CERTIFICATE_HEALTH_CHECK_URL=http://certificate-api:8078/health + - TEMPLATE_BASE_URL=http://registry:8081/api/v1/templates/ #Looks for certificate templates for pdf copy of the signed certificate + - TEMPLATE_EXTERNAL_ENABLED=${TEMPLATE_EXTERNAL_ENABLED-false} + - FILE_STORAGE_ENABLED=${FILE_STORAGE_ENABLED-false} + - FILE_STORAGE_CONNECTION_URL=http://file-storage:9000 + - FILE_STORAGE_ACCESS_KEY=admin + - FILE_STORAGE_SECRET_KEY=12345678 + - FILE_STORAGE_BUCKET_NAME=issuance + - REGISTRY_BASE_APIS_ENABLED=false + - LOGGING_LEVEL_ROOT=INFO + - LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_SECURITY=INFO + - ASYNC_ENABLED=${ASYNC_ENABLED-false} + - KAFKA_BOOTSTRAP_ADDRESS=kafka:9092 + - WEBHOOK_ENABLED=false + - WEBHOOK_URL=http://localhost:5001/api/v1/callback + - REDIS_HOST=redis + - REDIS_PORT=6379 + - DEFINITIONS_MANAGER_TYPE=${DEFINITIONS_MANAGER_TYPE-DefinitionsManager} + - REGISTRY_EXPAND_REFERENCE=${REGISTRY_EXPAND_REFERENCE-false} + - SWAGGER_TITLE=${SWAGGER_TITLE-Sunbird Registry and Credential} + - NOTIFICATION_ENABLED=${NOTIFICATION_ENABLED-false} + - NOTIFICATION_ASYNC_ENABLED=${NOTIFICATION_ASYNC_ENABLED-false} + - NOTIFICATION_HEALTH_CHECK_URL=http://notification-ms:8765/notification-service/v1/health + - NOTIFICATION_URL=http://notification-ms:8765/notification-service/v1/notification ports: - '8081:8081' depends_on: @@ -172,10 +178,10 @@ services: claim-ms: image: ghcr.io/sunbird-rc/sunbird-rc-claim-ms:${RELEASE_VERSION} environment: - - connectionInfo_uri=jdbc:postgresql://db:5432/registry - - connectionInfo_username=postgres - - connectionInfo_password=postgres - - sunbirdrc_url=http://registry:8081 + - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/registry + - SPRING_DATASOURCE_USERNAME=postgres + - SPRING_DATASOURCE_PASSWORD=postgres + - REGISTRY_URL=http://registry:8081 ports: - '8082:8082' depends_on: @@ -458,11 +464,13 @@ services: ports: - '8088:8088' environment: - spring.datasource.url: jdbc:postgresql://db:5432/registry - spring.flyway.baseline-on-migrate: "true" - autocreate.new.seq: "true" - idformat.from.mdms: "false" - egov.mdms.provider: org.egov.id.masterdata.provider.DBMasterDataProvider + - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/registry + - SPRING_DATASOURCE_USERNAME=postgres + - SPRING_DATASOURCE_PASSWORD=postgres + - SPRING_FLYWAY_BASELINE_ON_MIGRATE=true + - AUTOCREATE_NEW_SEQ=true + - IDFORMAT_FROM_MDMS=false + - EGOV_MDMS_PROVIDER=org.egov.id.masterdata.provider.DBMasterDataProvider depends_on: db: condition: service_healthy @@ -471,13 +479,17 @@ services: ports: - '8013:8013' environment: - server.port: 8013 - server.servlet.context-path: / - spring.datasource.url: jdbc:postgresql://db:5432/registry - spring.flyway.url: jdbc:postgresql://db:5432/registry - egov.mdms.provider: org.egov.enc.masterdata.provider.DBMasterDataProvider - spring.flyway.baseline-on-migrate: "true" - management.endpoints.web.base-path: / + - SERVER_PORT=8013 + - SERVER_SERVLET_CONTEXT_PATH=/ + - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/registry + - SPRING_DATASOURCE_USERNAME=postgres + - SPRING_DATASOURCE_PASSWORD=postgres + - SPRING_FLYWAY_URL=jdbc:postgresql://db:5432/registry + - SPRING_FLYWAY_USERNAME=postgres + - SPRING_FLYWAY_PASSWORD=postgres + - SPRING_FLYWAY_BASELINE_ON_MIGRATE=true + - EGOV_MDMS_PROVIDER=org.egov.enc.masterdata.provider.DBMasterDataProvider + - MANAGEMENT_ENDPOINTS_WEB_BASE_PATH=/ depends_on: db: condition: service_healthy diff --git a/java/claim/Makefile b/java/claim/Makefile index 9eb60e04d..4e512d152 100644 --- a/java/claim/Makefile +++ b/java/claim/Makefile @@ -5,7 +5,7 @@ rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) SOURCES := $(call rwildcard,java/,*.java) build: target/claim-0.0.1-SNAPSHOT.jar echo ${SOURCES} - cd target && docker build -t ghcr.io/sunbird-rc/sunbird-rc-claim-ms .. + cd target && docker build -t ghcr.io/sunbird-rc/sunbird-rc-claim-ms:env .. target/claim-0.0.1-SNAPSHOT.jar: $(SOURCES) echo $(SOURCES) diff --git a/java/claim/src/main/java/dev/sunbirdrc/claim/service/SunbirdRCClient.java b/java/claim/src/main/java/dev/sunbirdrc/claim/service/SunbirdRCClient.java index d3a249f73..0aa2b2a18 100644 --- a/java/claim/src/main/java/dev/sunbirdrc/claim/service/SunbirdRCClient.java +++ b/java/claim/src/main/java/dev/sunbirdrc/claim/service/SunbirdRCClient.java @@ -23,7 +23,7 @@ public class SunbirdRCClient { private final String sunbirdRCUrl; RestTemplate restTemplate = new RestTemplate(); - public SunbirdRCClient(@Value("${sunbirdrc.url}")String sunbirdRCUrl) { + public SunbirdRCClient(@Value("${registry.url}")String sunbirdRCUrl) { this.sunbirdRCUrl = sunbirdRCUrl; } diff --git a/java/claim/src/main/resources/application.properties b/java/claim/src/main/resources/application.properties index 51a497d85..43a201e6b 100644 --- a/java/claim/src/main/resources/application.properties +++ b/java/claim/src/main/resources/application.properties @@ -8,4 +8,4 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.hibernate.ddl-auto=update spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true -sunbirdrc.url=${sunbirdrc_url:http://localhost:8081} \ No newline at end of file +registry.url=${sunbirdrc_url:http://localhost:8081} \ No newline at end of file diff --git a/java/claim/src/main/resources/application.properties.sample b/java/claim/src/main/resources/application.properties.sample index 51a497d85..43a201e6b 100644 --- a/java/claim/src/main/resources/application.properties.sample +++ b/java/claim/src/main/resources/application.properties.sample @@ -8,4 +8,4 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.hibernate.ddl-auto=update spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true -sunbirdrc.url=${sunbirdrc_url:http://localhost:8081} \ No newline at end of file +registry.url=${sunbirdrc_url:http://localhost:8081} \ No newline at end of file From 5a66a77e9d45fdb16e9c04206d2c1fcf06c566f1 Mon Sep 17 00:00:00 2001 From: Holash Chand Date: Mon, 8 Apr 2024 18:22:56 +0530 Subject: [PATCH 3/8] Fixed credential services health check --- .../dev/sunbirdrc/registry/service/CredentialSchemaService.java | 2 +- .../main/java/dev/sunbirdrc/registry/service/DIDService.java | 2 +- .../sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/CredentialSchemaService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/CredentialSchemaService.java index da0725ae9..04e651cfc 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/CredentialSchemaService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/CredentialSchemaService.java @@ -214,7 +214,7 @@ public String getServiceName() { public ComponentHealthInfo getHealthInfo() { try { ResponseEntity response = retryRestTemplate.getForEntity(healthCheckUrl); - if (!StringUtils.isEmpty(response.getBody()) && JSONUtil.convertStringJsonNode(response.getBody()).get("status").asText().equalsIgnoreCase("UP")) { + if (!StringUtils.isEmpty(response.getBody()) && JSONUtil.convertStringJsonNode(response.getBody()).get("status").asText().equalsIgnoreCase("OK")) { logger.debug("{} service running!", this.getServiceName()); return new ComponentHealthInfo(getServiceName(), true); } else { diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/DIDService.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/DIDService.java index 738bef650..81f9765af 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/DIDService.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/DIDService.java @@ -140,7 +140,7 @@ public String getServiceName() { public ComponentHealthInfo getHealthInfo() { try { ResponseEntity response = retryRestTemplate.getForEntity(healthCheckUrl); - if (!StringUtils.isEmpty(response.getBody()) && JSONUtil.convertStringJsonNode(response.getBody()).get("status").asText().equalsIgnoreCase("UP")) { + if (!StringUtils.isEmpty(response.getBody()) && JSONUtil.convertStringJsonNode(response.getBody()).get("status").asText().equalsIgnoreCase("OK")) { logger.debug("{} service running!", this.getServiceName()); return new ComponentHealthInfo(getServiceName(), true); } else { diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java index 3f4c4fa75..1bd5b0300 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java @@ -230,7 +230,7 @@ public String getServiceName() { public ComponentHealthInfo getHealthInfo() { try { ResponseEntity response = retryRestTemplate.getForEntity(healthCheckUrl); - if (!StringUtils.isEmpty(response.getBody()) && JSONUtil.convertStringJsonNode(response.getBody()).get("status").asText().equalsIgnoreCase("UP")) { + if (!StringUtils.isEmpty(response.getBody()) && JSONUtil.convertStringJsonNode(response.getBody()).get("status").asText().equalsIgnoreCase("OK")) { logger.debug("{} service running!", this.getServiceName()); return new ComponentHealthInfo(getServiceName(), true); } else { From ccbbf051e8812963a809500868eb7db3abd9311b Mon Sep 17 00:00:00 2001 From: Holash Chand Date: Wed, 10 Apr 2024 08:05:49 +0530 Subject: [PATCH 4/8] added missing env variables for encryption and idgen services --- docker-compose.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 4aa06cbdb..6cc106ee2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -467,6 +467,10 @@ services: - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/registry - SPRING_DATASOURCE_USERNAME=postgres - SPRING_DATASOURCE_PASSWORD=postgres + - SPRING_FLYWAY_URL=jdbc:postgresql://db:5432/registry + - SPRING_FLYWAY_USERNAME=postgres + - SPRING_FLYWAY_PASSWORD=postgres + - SPRING_FLYWAY_TABLE=flyway_idgen_history - SPRING_FLYWAY_BASELINE_ON_MIGRATE=true - AUTOCREATE_NEW_SEQ=true - IDFORMAT_FROM_MDMS=false @@ -487,6 +491,7 @@ services: - SPRING_FLYWAY_URL=jdbc:postgresql://db:5432/registry - SPRING_FLYWAY_USERNAME=postgres - SPRING_FLYWAY_PASSWORD=postgres + - SPRING_FLYWAY_TABLE=flyway_encryption_history - SPRING_FLYWAY_BASELINE_ON_MIGRATE=true - EGOV_MDMS_PROVIDER=org.egov.enc.masterdata.provider.DBMasterDataProvider - MANAGEMENT_ENDPOINTS_WEB_BASE_PATH=/ From 2cbb6ac1f3213537e9641c125d66c67f0d949e75 Mon Sep 17 00:00:00 2001 From: Holash Chand Date: Wed, 10 Apr 2024 10:37:19 +0530 Subject: [PATCH 5/8] build fixes --- java/claim/Makefile | 2 +- .../java/dev/sunbirdrc/registry/test/RegistryTestBase.java | 2 +- java/registry/src/main/resources/application.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/java/claim/Makefile b/java/claim/Makefile index 4e512d152..9eb60e04d 100644 --- a/java/claim/Makefile +++ b/java/claim/Makefile @@ -5,7 +5,7 @@ rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) SOURCES := $(call rwildcard,java/,*.java) build: target/claim-0.0.1-SNAPSHOT.jar echo ${SOURCES} - cd target && docker build -t ghcr.io/sunbird-rc/sunbird-rc-claim-ms:env .. + cd target && docker build -t ghcr.io/sunbird-rc/sunbird-rc-claim-ms .. target/claim-0.0.1-SNAPSHOT.jar: $(SOURCES) echo $(SOURCES) diff --git a/java/cukes/src/test/java/dev/sunbirdrc/registry/test/RegistryTestBase.java b/java/cukes/src/test/java/dev/sunbirdrc/registry/test/RegistryTestBase.java index f8cf59dae..b9860cdb8 100644 --- a/java/cukes/src/test/java/dev/sunbirdrc/registry/test/RegistryTestBase.java +++ b/java/cukes/src/test/java/dev/sunbirdrc/registry/test/RegistryTestBase.java @@ -51,7 +51,7 @@ public static String generateRandomId() { } private static String generateAuthToken() { - String ssoAuthBody = new StringBuilder().append("client_id=").append(``ssoClientId).append("&username=") + String ssoAuthBody = new StringBuilder().append("client_id=").append(ssoClientId).append("&username=") .append(ssoUsername).append("&password=").append(ssoPassword).append("&grant_type=password").toString(); HttpHeaders headers = new HttpHeaders(); headers.setCacheControl("no-cache"); diff --git a/java/registry/src/main/resources/application.yml b/java/registry/src/main/resources/application.yml index 5bdd7af80..7a4f42953 100644 --- a/java/registry/src/main/resources/application.yml +++ b/java/registry/src/main/resources/application.yml @@ -320,7 +320,7 @@ swagger: version: 1.0.0 idgen: - enabled: idgen_enabled:false + enabled: false tenant-id: default health-check-url: http://localhost:8088/egov-idgen/health generate-url: http://localhost:8088/egov-idgen/id/_generate @@ -334,7 +334,7 @@ did: signature: enabled: false - provider-name: dev.sunbirdrc.registry.service.impl.SignatureV1ServiceImpl + provider-name: ${signature_provider:dev.sunbirdrc.registry.service.impl.SignatureV1ServiceImpl} v1: health-check-url: ${sign_health_check_url:http://localhost:8079/health} sign-url: ${sign_url:http://localhost:8079/sign} From 32c6475280416c58051ee6f9a3175dfd452c158f Mon Sep 17 00:00:00 2001 From: Holash Chand Date: Wed, 10 Apr 2024 12:44:10 +0530 Subject: [PATCH 6/8] fixed redis issue --- .../java/dev/sunbirdrc/registry/app/SunbirdRCApplication.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/app/SunbirdRCApplication.java b/java/registry/src/main/java/dev/sunbirdrc/registry/app/SunbirdRCApplication.java index f9dff0974..7bf44b3c2 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/app/SunbirdRCApplication.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/app/SunbirdRCApplication.java @@ -72,7 +72,7 @@ public FilterRegistrationBean corsFilter() { } @Bean - @ConditionalOnProperty(value = "registry.manager.type", havingValue = "DistributedDefinitionsManager") + @ConditionalOnProperty(value = "definitions.manager-type", havingValue = "DistributedDefinitionsManager") public JedisPool jedisPool() { final JedisPoolConfig poolConfig = new JedisPoolConfig(); JedisPool jedisPool = new JedisPool(poolConfig, redisHost, Integer.parseInt(redisPort)); @@ -91,6 +91,7 @@ public JedisPool jedisPool() { @Bean public IDefinitionsManager definitionsManager() { + System.out.println("IDefinitionManager: " + definitionManagerType); if(definitionManagerType.equals("DefinitionsManager")) { return new DefinitionsManager(); } From df01d9e6791f1da63724c56884958ed515863c12 Mon Sep 17 00:00:00 2001 From: Holash Chand Date: Wed, 10 Apr 2024 12:47:24 +0530 Subject: [PATCH 7/8] putting id-gen and enc first in the builds --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9bd25ac89..e6ffdd5af 100644 --- a/Makefile +++ b/Makefile @@ -12,14 +12,13 @@ build: java/registry/target/registry.jar rm -rf java/claim/target/*.jar cd target && rm -rf * && jar xvf ../java/registry/target/registry.jar && cp ../java/Dockerfile ./ && docker build -t ghcr.io/sunbird-rc/sunbird-rc-core . make -C java/claim - make -C services/notification-service docker - make -C services/metrics docker make -C services/id-gen-service docker make -C services/encryption-service docker make -C services/identity-service/ docker make -C services/credential-schema docker make -C services/credentials-service/ docker - + make -C services/notification-service docker + make -C services/metrics docker java/registry/target/registry.jar: $(SOURCES) echo $(SOURCES) From 8d9302e289a21abf275745fe689a39a73851fe3c Mon Sep 17 00:00:00 2001 From: Holash Chand Date: Tue, 28 May 2024 13:25:10 +0530 Subject: [PATCH 8/8] fixed uuid issues --- docker-compose.yml | 1 + .../sunbirdrc/plugin/controller/MosipCallbackController.java | 2 +- .../sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6d4449cb6..7d03920c3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -185,6 +185,7 @@ services: - SPRING_DATASOURCE_USERNAME=postgres - SPRING_DATASOURCE_PASSWORD=postgres - REGISTRY_URL=http://registry:8081 + - UUID_PROPERTY_NAME=osid ports: - '8082:8082' depends_on: diff --git a/java/plugins/mosip-external-plugin/src/main/java/dev/sunbirdrc/plugin/controller/MosipCallbackController.java b/java/plugins/mosip-external-plugin/src/main/java/dev/sunbirdrc/plugin/controller/MosipCallbackController.java index da4b59613..6c47ee1df 100644 --- a/java/plugins/mosip-external-plugin/src/main/java/dev/sunbirdrc/plugin/controller/MosipCallbackController.java +++ b/java/plugins/mosip-external-plugin/src/main/java/dev/sunbirdrc/plugin/controller/MosipCallbackController.java @@ -38,7 +38,7 @@ public class MosipCallbackController { @Autowired private ObjectMapper objectMapper; - @Value("${database.uuidPropertyName}") + @Value("${database.uuid-property-name}") private String uuidPropertyName; @RequestMapping(value = "/plugin/mosip/callback", method = RequestMethod.POST) diff --git a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java index 3347d6ada..ac134aa49 100644 --- a/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java +++ b/java/registry/src/main/java/dev/sunbirdrc/registry/service/impl/SignatureV2ServiceImpl.java @@ -62,7 +62,7 @@ public class SignatureV2ServiceImpl implements SignatureService, ICertificateSer @Value("${signature.v2.issuer-did-method}") private String credentialIssuerMethod; - @Value("${database.uuidPropertyName}") + @Value("${database.uuid-property-name}") public String uuidPropertyName; @Autowired