From bc5de6c4d836ae14e50bf1157ccca4ef0a786046 Mon Sep 17 00:00:00 2001 From: pvsaidurga <132046494+pvsaidurga@users.noreply.github.com> Date: Thu, 3 Oct 2024 17:16:34 +0530 Subject: [PATCH 01/30] [ES-1689] added test case (#259) Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: kaifk468 --- .../controller/IdentityControllerTest.java | 15 ++++++ .../impl/AuthenticationServiceImplTest.java | 53 +++++++++++++++++++ .../service/impl/IdentityServiceTest.java | 43 ++++++++++++++- 3 files changed, 109 insertions(+), 2 deletions(-) diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java index b9e016c7..c1985195 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java @@ -7,6 +7,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -160,4 +161,18 @@ public void addVerifiedClaim_withInvalidClaim_returnErrorResponse() throws Exce .andExpect(jsonPath("$.errors[0].errorCode").value(ErrorConstants.INVALID_REQUEST)); } + @Test + public void updateIdentity_withValidIdentity_thenPass() throws Exception { + RequestWrapper requestWrapper = new RequestWrapper(); + ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); + requestWrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); + requestWrapper.setRequest(identityRequest); + + Mockito.doNothing().when(identityService).updateIdentity(identityRequest); + + mockMvc.perform(put("/identity").content(objectMapper.writeValueAsString(requestWrapper)) + .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + .andExpect(jsonPath("$.response.status").value("mock Identity data updated successfully")); + } + } diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java index 024cdd18..571968dc 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java @@ -333,6 +333,56 @@ public void kycExchange_withValidDetails_thenPass() throws MockIdentityException Assert.assertEquals("signedData", response.getKyc()); } + @Test + public void kycExchange_withInValidJwe_thenFail() throws MockIdentityException, JsonProcessingException { + ReflectionTestUtils.setField(authenticationService,"transactionTimeoutInSecs",60); + ReflectionTestUtils.setField(authenticationService,"encryptKyc",true); + ReflectionTestUtils.setField(authenticationService,"objectMapper",objectMapper); + String relyingPartyId = "relyingPartyId"; + String clientId = "clientId"; + + KycExchangeRequestDto kycExchangeRequestDto=new KycExchangeRequestDto(); + kycExchangeRequestDto.setKycToken("kycToken"); + kycExchangeRequestDto.setIndividualId("individualId"); + kycExchangeRequestDto.setTransactionId("transactionId"); + kycExchangeRequestDto.setClaimLocales(Arrays.asList("en","fr")); + kycExchangeRequestDto.setAcceptedClaims(Arrays.asList("name","gender")); + + kycExchangeRequestDto.setRequestDateTime(LocalDateTime.now()); + + KycAuth kycAuth=new KycAuth(); + kycAuth.setResponseTime(LocalDateTime.now().minusSeconds(2)); + kycAuth.setPartnerSpecificUserToken("token"); + + ObjectNode identityData = objectMapper.createObjectNode(); + identityData.put("gender", "Male"); + + ArrayNode arrayNode = objectMapper.createArrayNode(); + ObjectNode fullNameEng = objectMapper.createObjectNode(); + fullNameEng.put("value", "Test"); + fullNameEng.put("language", "eng"); + ObjectNode fullNameFra = objectMapper.createObjectNode(); + fullNameFra.put("value", "Test_fra"); + fullNameFra.put("language", "fra"); + arrayNode.add(fullNameEng); + arrayNode.add(fullNameFra); + identityData.put("fullName", arrayNode); + JWTSignatureResponseDto jwtSignatureResponseDto=new JWTSignatureResponseDto(); + jwtSignatureResponseDto.setJwtSignedData("signedData"); + + Mockito.when(authRepository.findByKycTokenAndValidityAndTransactionIdAndIndividualId( + Mockito.anyString(), eq(Valid.ACTIVE), Mockito.anyString(), Mockito.anyString())) + .thenReturn(Optional.of(kycAuth)); + Mockito.when(identityService.getIdentityV2(Mockito.anyString())).thenReturn(identityData); + Mockito.when(signatureService.jwtSign(Mockito.any())).thenReturn(jwtSignatureResponseDto); + + + MockIdentityException exception = Assert.assertThrows(MockIdentityException.class, () -> { + authenticationService.kycExchange(relyingPartyId, clientId, new KycExchangeDto(kycExchangeRequestDto,null)); + }); + Assert.assertEquals("mock-ida-008", exception.getMessage()); + } + @Test public void kycExchange_invalidToken_thenFail() { String relyingPartyId = "relyingPartyId"; @@ -483,9 +533,12 @@ public void kycExchangeV2_withDetail_thenPass() { verifiedClaim3.put("claims", claims3); verifiedClaimsList.add(verifiedClaim3); + ObjectNode addressClaim = objectMapper.createObjectNode(); + addressClaim.put("locality", NullNode.getInstance()); // Add the list of verified claims to the outer map acceptedClaims.put("verified_claims", verifiedClaimsList); + acceptedClaims.put("address",addressClaim); kycExchangeRequestDtoV2.setAcceptedClaimDetail(acceptedClaims); kycExchangeRequestDtoV2.setClaimLocales(List.of("eng")); diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/IdentityServiceTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/IdentityServiceTest.java index f74372d4..48200ecd 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/IdentityServiceTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/IdentityServiceTest.java @@ -31,8 +31,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; @RunWith(MockitoJUnitRunner.class) public class IdentityServiceTest { @@ -115,11 +114,25 @@ public void addIdentity_withValidDetails_thenPass() throws MockIdentityException IdentityData identityData = new IdentityData(); identityData.setEmail("email@gmail.com"); identityData.setEncodedPhoto("encodedPhoto"); + identityData.setPassword("password"); when(identityRepository.findById(identityData.getIndividualId())).thenReturn(Optional.empty()); identityService.addIdentity(identityData); verify(identityRepository).save(any(MockIdentity.class)); } + @Test + public void addIdentity_withDuplicateDetails_thenFail() throws MockIdentityException { + IdentityData identityData = new IdentityData(); + identityData.setEmail("email@gmail.com"); + identityData.setEncodedPhoto("encodedPhoto"); + when(identityRepository.findById(identityData.getIndividualId())).thenReturn(Optional.of(new MockIdentity())); + try{ + identityService.addIdentity(identityData); + }catch (MockIdentityException e){ + Assert.assertEquals(ErrorConstants.DUPLICATE_INDIVIDUAL_ID,e.getErrorCode()); + } + } + @Test public void getIdentity_withValidDetails_thenPass() throws MockIdentityException, JsonProcessingException { IdentityData identityData = new IdentityData(); @@ -145,4 +158,30 @@ public void getIdentity_withInvalidId_thenFail() { }); assertEquals(ErrorConstants.INVALID_INDIVIDUAL_ID, exception.getMessage()); } + + @Test + public void updateIdentity_withExistingIndividualId_thenPass() { + IdentityData identityData = new IdentityData(); + identityData.setIndividualId("existing-id"); + identityData.setPassword("new-password"); + MockIdentity mockIdentity = new MockIdentity(); + mockIdentity.setIndividualId("existing-id"); + mockIdentity.setIdentityJson("{\"existingField\": \"value\"}"); + when(identityRepository.findById("existing-id")).thenReturn(Optional.of(mockIdentity)); + identityService.updateIdentity(identityData); + verify(identityRepository, times(1)).save(mockIdentity); + Assert.assertNotNull(mockIdentity.getIdentityJson()); + } + + @Test + public void updateIdentity_withNonExistingIndividualId_thenFail() { + IdentityData identityData = new IdentityData(); + identityData.setIndividualId("non-existing-id"); + when(identityRepository.findById("non-existing-id")).thenReturn(Optional.empty()); + MockIdentityException exception = assertThrows(MockIdentityException.class, () -> { + identityService.updateIdentity(identityData); + }); + assertEquals(ErrorConstants.INVALID_INDIVIDUAL_ID, exception.getErrorCode()); + } + } \ No newline at end of file From dd988f2dfa2b48a0b7989a0bdac832dfb6488b84 Mon Sep 17 00:00:00 2001 From: ase-101 Date: Thu, 3 Oct 2024 18:19:31 +0530 Subject: [PATCH 02/30] moved tomcat and prometheus configuration to bootstrap.properties Signed-off-by: ase-101 Signed-off-by: kaifk468 --- .../resources/application-default.properties | 16 -------------- .../src/main/resources/bootstrap.properties | 22 ++++++++++++++----- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/mock-identity-system/src/main/resources/application-default.properties b/mock-identity-system/src/main/resources/application-default.properties index 5c6f3c5b..25080536 100644 --- a/mock-identity-system/src/main/resources/application-default.properties +++ b/mock-identity-system/src/main/resources/application-default.properties @@ -25,22 +25,6 @@ # mosip.api.internal.url # mosip.api.public.url -## Tomcat access logs -server.tomcat.accesslog.enabled=true -server.tomcat.accesslog.directory=/dev -server.tomcat.accesslog.prefix=stdout -server.tomcat.accesslog.buffered=false -server.tomcat.accesslog.suffix= -server.tomcat.accesslog.file-date-format= -server.tomcat.accesslog.pattern={"@timestamp":"%{yyyy-MM-dd'T'HH:mm:ss.SSS'Z'}t","level":"ACCESS","level_value":70000,"traceId":"%{X-B3-TraceId}i","statusCode":%s,"req.requestURI":"%U","bytesSent":%b,"timeTaken":%T,"appName":"${spring.application.name}","req.userAgent":"%{User-Agent}i","req.xForwardedFor":"%{X-Forwarded-For}i","req.referer":"%{Referer}i","req.method":"%m","req.remoteHost":"%a"} -server.tomcat.accesslog.className=io.mosip.kernel.core.logger.config.SleuthValve - -## Prometheus -management.endpoint.metrics.enabled=true -management.endpoints.web.exposure.include=* -management.endpoint.prometheus.enabled=true -management.metrics.export.prometheus.enabled=true - ##----------------------------------------- Database properties -------------------------------------------------------- mosip.mockidentitysystem.database.hostname=${database.host} mosip.mockidentitysystem.database.port=${database.port} diff --git a/mock-identity-system/src/main/resources/bootstrap.properties b/mock-identity-system/src/main/resources/bootstrap.properties index 0255d6e1..cc80ac20 100644 --- a/mock-identity-system/src/main/resources/bootstrap.properties +++ b/mock-identity-system/src/main/resources/bootstrap.properties @@ -12,10 +12,6 @@ health.config.enabled=false server.servlet.context-path=/v1/mock-identity-system management.security.enable=false management.endpoint.health.show-details=always -management.endpoints.web.exposure.include=info,health,refresh,mappings -management.endpoint.metrics.enabled=true -management.endpoint.prometheus.enabled=true -management.metrics.export.prometheus.enabled=true openapi.info.title=${spring.application.name} openapi.info.description=${spring.application.name} @@ -29,4 +25,20 @@ openapi.group.name=${openapi.info.title} openapi.group.paths[0]=/** springdoc.swagger-ui.disable-swagger-default-url=true springdoc.swagger-ui.tagsSorter=alpha -springdoc.swagger-ui.operationsSorter=alpha \ No newline at end of file +springdoc.swagger-ui.operationsSorter=alpha + +## Tomcat access logs +server.tomcat.accesslog.enabled=true +server.tomcat.accesslog.directory=/dev +server.tomcat.accesslog.prefix=stdout +server.tomcat.accesslog.buffered=false +server.tomcat.accesslog.suffix= +server.tomcat.accesslog.file-date-format= +server.tomcat.accesslog.pattern={"@timestamp":"%{yyyy-MM-dd'T'HH:mm:ss.SSS'Z'}t","level":"ACCESS","level_value":70000,"traceId":"%{X-B3-TraceId}i","statusCode":%s,"req.requestURI":"%U","bytesSent":%b,"timeTaken":%T,"appName":"${spring.application.name}","req.userAgent":"%{User-Agent}i","req.xForwardedFor":"%{X-Forwarded-For}i","req.referer":"%{Referer}i","req.method":"%m","req.remoteHost":"%a"} +server.tomcat.accesslog.className=io.mosip.kernel.core.logger.config.SleuthValve + +## Prometheus +management.endpoint.metrics.enabled=true +management.endpoints.web.exposure.include=* +management.endpoint.prometheus.enabled=true +management.metrics.export.prometheus.enabled=true \ No newline at end of file From 29193ac969dbc498b13f8b2e818b92fd18950415 Mon Sep 17 00:00:00 2001 From: ase-101 Date: Fri, 4 Oct 2024 15:01:46 +0530 Subject: [PATCH 03/30] Updated Readme and pom version Signed-off-by: ase-101 Signed-off-by: kaifk468 --- README.md | 3 +++ ...9.3_to_0.9.4_rollback.sql => 0.9.3_to_0.10.0_rollback.sql} | 0 ...0.9.3_to_0.9.4_upgrade.sql => 0.9.3_to_0.10.0_upgrade.sql} | 0 mock-identity-system/README.md | 2 +- mock-identity-system/pom.xml | 4 ++-- mock-relying-party-service/README.md | 3 +++ mock-relying-party-ui/README.md | 3 +++ pom.xml | 2 +- 8 files changed, 13 insertions(+), 4 deletions(-) rename db_upgrade_script/mosip_mockidentitysystem/sql/{0.9.3_to_0.9.4_rollback.sql => 0.9.3_to_0.10.0_rollback.sql} (100%) rename db_upgrade_script/mosip_mockidentitysystem/sql/{0.9.3_to_0.9.4_upgrade.sql => 0.9.3_to_0.10.0_upgrade.sql} (100%) diff --git a/README.md b/README.md index b801b25d..ad97f42a 100644 --- a/README.md +++ b/README.md @@ -58,3 +58,6 @@ Repository contains mock implementations for eSignet. Only for non-production us ## Partner onboarder * Perform Partner onboarding for esignet mock using [steps](partner-onboarder/README.md). + +## License +This project is licensed under the terms of [Mozilla Public License 2.0](LICENSE). \ No newline at end of file diff --git a/db_upgrade_script/mosip_mockidentitysystem/sql/0.9.3_to_0.9.4_rollback.sql b/db_upgrade_script/mosip_mockidentitysystem/sql/0.9.3_to_0.10.0_rollback.sql similarity index 100% rename from db_upgrade_script/mosip_mockidentitysystem/sql/0.9.3_to_0.9.4_rollback.sql rename to db_upgrade_script/mosip_mockidentitysystem/sql/0.9.3_to_0.10.0_rollback.sql diff --git a/db_upgrade_script/mosip_mockidentitysystem/sql/0.9.3_to_0.9.4_upgrade.sql b/db_upgrade_script/mosip_mockidentitysystem/sql/0.9.3_to_0.10.0_upgrade.sql similarity index 100% rename from db_upgrade_script/mosip_mockidentitysystem/sql/0.9.3_to_0.9.4_upgrade.sql rename to db_upgrade_script/mosip_mockidentitysystem/sql/0.9.3_to_0.10.0_upgrade.sql diff --git a/mock-identity-system/README.md b/mock-identity-system/README.md index 2f2393fe..7163527c 100644 --- a/mock-identity-system/README.md +++ b/mock-identity-system/README.md @@ -2,7 +2,7 @@ ## About -This is the mock implementation of IDA system. +This is the mock implementation of MOSIP IDA system. Currently supports below endpoints * create-identity diff --git a/mock-identity-system/pom.xml b/mock-identity-system/pom.xml index 9b2ca072..d7d39db4 100644 --- a/mock-identity-system/pom.xml +++ b/mock-identity-system/pom.xml @@ -5,11 +5,11 @@ io.mosip.esignet.mock esignet-mock-parent - 0.9.5-SNAPSHOT + 0.10.0-SNAPSHOT mock-identity-system - 0.9.5-SNAPSHOT + 0.10.0-SNAPSHOT jar mock-identity-system diff --git a/mock-relying-party-service/README.md b/mock-relying-party-service/README.md index eea92adb..f2d92688 100644 --- a/mock-relying-party-service/README.md +++ b/mock-relying-party-service/README.md @@ -42,3 +42,6 @@ The application run on PORT=8888. ``` $ npm run devstart ``` + +## License +This project is licensed under the terms of [Mozilla Public License 2.0](../LICENSE). \ No newline at end of file diff --git a/mock-relying-party-ui/README.md b/mock-relying-party-ui/README.md index 77745017..a133fb30 100644 --- a/mock-relying-party-ui/README.md +++ b/mock-relying-party-ui/README.md @@ -67,3 +67,6 @@ The application run on PORT=5000 by default. ``` $ npm start ``` + +## License +This project is licensed under the terms of [Mozilla Public License 2.0](../LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index ba2d35f1..e18d41c6 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ 4.0.0 io.mosip.esignet.mock esignet-mock-parent - 0.9.5-SNAPSHOT + 0.10.0-SNAPSHOT pom esignet-mock Parent project of MOSIP e-Signet Mock Services From 6714713a1f5fd67624fca53b098655b4c0858535 Mon Sep 17 00:00:00 2001 From: Mohd Kaif Siddique Date: Tue, 26 Nov 2024 01:35:01 +0530 Subject: [PATCH 04/30] added schema validation for IdentityData Signed-off-by: Mohd Kaif Siddique Signed-off-by: kaifk468 --- mock-identity-system/pom.xml | 35 +++ .../controller/IdentityController.java | 7 +- .../identitysystem/util/ErrorConstants.java | 1 + .../validator/IdentitySchema.java | 23 ++ .../validator/IdentitySchemaValidator.java | 109 +++++++ .../resources/application-default.properties | 5 + .../resources/application-local.properties | 6 + .../mock-identity-create-schema.json | 267 ++++++++++++++++++ .../mock-identity-update-schema.json | 254 +++++++++++++++++ .../controller/IdentityControllerTest.java | 35 ++- 10 files changed, 739 insertions(+), 3 deletions(-) create mode 100644 mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchema.java create mode 100644 mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java create mode 100644 mock-identity-system/src/main/resources/mock-identity-create-schema.json create mode 100644 mock-identity-system/src/main/resources/mock-identity-update-schema.json diff --git a/mock-identity-system/pom.xml b/mock-identity-system/pom.xml index d7d39db4..2f3a5e74 100644 --- a/mock-identity-system/pom.xml +++ b/mock-identity-system/pom.xml @@ -138,6 +138,41 @@ + + + com.networknt + json-schema-validator + 1.5.1 + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-databind + + + + + com.fasterxml.jackson.core + jackson-databind + 2.12.1 + + + com.fasterxml.jackson.core + jackson-core + 2.12.1 + + + com.fasterxml.jackson.core + jackson-annotations + 2.12.1 + diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java index 1b49fa4c..6396bd60 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java @@ -8,8 +8,10 @@ import javax.validation.Valid; import io.mosip.esignet.mock.identitysystem.dto.*; +import io.mosip.esignet.mock.identitysystem.validator.IdentitySchema; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import io.mosip.esignet.mock.identitysystem.exception.MockIdentityException; @@ -21,6 +23,7 @@ @RestController @RequestMapping("/") +@Validated public class IdentityController { @Autowired @@ -29,7 +32,7 @@ public class IdentityController { @PostMapping(value = "identity", consumes = { MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE }) public ResponseWrapper createIdentity - (@Valid @RequestBody RequestWrapper requestWrapper) throws MockIdentityException { + (@Valid @RequestBody @IdentitySchema(isCreate=true) RequestWrapper< IdentityData> requestWrapper) throws MockIdentityException { ResponseWrapper response = new ResponseWrapper(); IdentityStatus identityStatus = new IdentityStatus(); @@ -43,7 +46,7 @@ public class IdentityController { @PutMapping(value = "identity", consumes = { MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE }) public ResponseWrapper updateIdentity - (@Valid @RequestBody RequestWrapper requestWrapper) throws MockIdentityException { + (@Valid @RequestBody @IdentitySchema(isCreate=false) RequestWrapper requestWrapper) throws MockIdentityException { ResponseWrapper response = new ResponseWrapper(); IdentityStatus identityStatus = new IdentityStatus(); diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/util/ErrorConstants.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/util/ErrorConstants.java index f903b905..910e0361 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/util/ErrorConstants.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/util/ErrorConstants.java @@ -40,4 +40,5 @@ public class ErrorConstants { public static final String INVALID_TRUST_FRAMEWORK = "invalid_trust_framework"; public static final String INVALID_VERIFIED_DATE = "invalid_verified_date"; public static final String CLAIM_ALREADY_EXISTS="Claim already exists"; + public static final String INVALID_IDENTITY_DATA= "invalid_identity_data"; } diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchema.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchema.java new file mode 100644 index 00000000..5b4173fb --- /dev/null +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchema.java @@ -0,0 +1,23 @@ +package io.mosip.esignet.mock.identitysystem.validator; + + +import io.mosip.esignet.mock.identitysystem.util.ErrorConstants; + +import javax.validation.Constraint; +import javax.validation.Payload; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE_USE, ElementType.FIELD, ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +@Constraint(validatedBy = IdentitySchemaValidator.class) +public @interface IdentitySchema { + + String message() default ErrorConstants.INVALID_IDENTITY_DATA; + Class[] groups() default {}; + Class[] payload() default {}; + + boolean isCreate(); +} diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java new file mode 100644 index 00000000..7e52f9ba --- /dev/null +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java @@ -0,0 +1,109 @@ +package io.mosip.esignet.mock.identitysystem.validator; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.networknt.schema.JsonSchema; +import com.networknt.schema.JsonSchemaFactory; +import com.networknt.schema.SpecVersion; +import com.networknt.schema.ValidationMessage; +import io.mosip.esignet.mock.identitysystem.dto.IdentityData; +import io.mosip.esignet.mock.identitysystem.dto.RequestWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.Resource; +import org.springframework.core.io.ResourceLoader; +import org.springframework.stereotype.Component; +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; +import java.io.IOException; +import java.io.InputStream; +import java.util.Set; + +@Component +@Slf4j +public class IdentitySchemaValidator implements ConstraintValidator { + + @Value("${mosip.mock.ida.identity.create.schema.url}") + private String createSchemaUrl; + + @Value("${mosip.mock.ida.identity.update.schema.url}") + private String updateSchemaUrl; + private boolean isCreate; + + private volatile JsonSchema cachedCreateSchema; + + private volatile JsonSchema cachedUpdateSchema; + + @Autowired + ObjectMapper objectMapper; + + @Autowired + ResourceLoader resourceLoader; + + @Override + public void initialize(IdentitySchema constraintAnnotation) { + this.isCreate = constraintAnnotation.isCreate(); + } + + @Override + public boolean isValid(Object object, ConstraintValidatorContext context) { + if (!(object instanceof RequestWrapper)) { + return false; + } + RequestWrapper wrapper= (RequestWrapper) object; + Object requestObject = wrapper.getRequest(); + if (!(requestObject instanceof IdentityData)) { + context.disableDefaultConstraintViolation(); + context.buildConstraintViolationWithTemplate("Invalid request object") + .addPropertyNode("request") + .addConstraintViolation(); + return false; + } + IdentityData identityData=(IdentityData) requestObject; + JsonNode identityJsonNode = objectMapper.valueToTree(identityData); + Set errors = isCreate + ? getCachedCreateSchema().validate(identityJsonNode) + : getCachedUpdateSchema().validate(identityJsonNode); + + if (!errors.isEmpty()) { + log.error("Validation failed for claims: {}", errors); + return false; + } + return true; + } + + private JsonSchema getCachedCreateSchema() { + if(cachedCreateSchema !=null ) return cachedCreateSchema; + synchronized (this) { + if (cachedCreateSchema == null) { + InputStream schemaResponse = getResource(createSchemaUrl); + JsonSchemaFactory jsonSchemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V202012); + cachedCreateSchema = jsonSchemaFactory.getSchema(schemaResponse); + } + } + return cachedCreateSchema; + } + + private JsonSchema getCachedUpdateSchema() { + if(cachedUpdateSchema !=null ) return cachedUpdateSchema; + synchronized (this) { + if (cachedUpdateSchema == null) { + InputStream schemaResponse = getResource(updateSchemaUrl); + JsonSchemaFactory jsonSchemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V202012); + cachedUpdateSchema = jsonSchemaFactory.getSchema(schemaResponse); + } + } + return cachedUpdateSchema; + } + + private InputStream getResource(String url) { + try{ + Resource resource = resourceLoader.getResource(url); + return resource.getInputStream(); + }catch (IOException e){ + log.error("Failed to parse data: {}", url, e); + } + throw new RuntimeException("invalid_configuration"); + } +} diff --git a/mock-identity-system/src/main/resources/application-default.properties b/mock-identity-system/src/main/resources/application-default.properties index 25080536..1d2288df 100644 --- a/mock-identity-system/src/main/resources/application-default.properties +++ b/mock-identity-system/src/main/resources/application-default.properties @@ -25,6 +25,11 @@ # mosip.api.internal.url # mosip.api.public.url +##-----------------------------------------Mock-identity-system properties---------------------------------------------- + +mosip.mock.ida.identity.create.schema.url=classpath:/mock-identity-create-schema.json +mosip.mock.ida.identity.update.schema.url=classpath:/mock-identity-update-schema.json + ##----------------------------------------- Database properties -------------------------------------------------------- mosip.mockidentitysystem.database.hostname=${database.host} mosip.mockidentitysystem.database.port=${database.port} diff --git a/mock-identity-system/src/main/resources/application-local.properties b/mock-identity-system/src/main/resources/application-local.properties index 499cdf19..bf63ee80 100644 --- a/mock-identity-system/src/main/resources/application-local.properties +++ b/mock-identity-system/src/main/resources/application-local.properties @@ -1,3 +1,9 @@ +##-----------------------------------------Mock-identity-system properties---------------------------------------------- + +mosip.mock.ida.identity.create.schema.url=classpath:/mock-identity-create-schema.json +mosip.mock.ida.identity.update.schema.url=classpath:/mock-identity-update-schema.json + + ##----------------------------------------- Database properties -------------------------------------------------------- spring.datasource.url=jdbc:postgresql://localhost:5455/mosip_mockidentitysystem?currentSchema=mockidentitysystem diff --git a/mock-identity-system/src/main/resources/mock-identity-create-schema.json b/mock-identity-system/src/main/resources/mock-identity-create-schema.json new file mode 100644 index 00000000..69aa1151 --- /dev/null +++ b/mock-identity-system/src/main/resources/mock-identity-create-schema.json @@ -0,0 +1,267 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "$defs": { + "langField": { + "type": "array", + "items": { + "type": "object", + "properties": { + "language": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "language", + "value" + ], + "additionalProperties": false + } + } + }, + "properties": { + "individualId": { + "type": "string", + "pattern": "^\\+855\\d{9}$" + }, + "fullName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "name": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "nullable": true + }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + + } + } + } + } + ] + }, + "givenName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "familyName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "middleName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "nickName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "preferredUsername": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "gender": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "streetAddress": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + + } + } + } + } + ] + }, + "locality": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "region": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "country": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "pin": { + "type": "string", + "pattern": "\\S" + }, + "preferredLang": { + "type": "string" + }, + "dateOfBirth": { + "type": "string", + "pattern": "\\S" + }, + "postalCode": { + "type": "string", + "pattern": "\\S" + }, + "encodedPhoto": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$" + }, + "phone": { + "type": "string", + "pattern": "\\S" + }, + "zoneInfo": { + "type": "string" + }, + "locale": { + "type": "string", + "pattern": "\\S" + }, + "password": { + "type": "string", + "pattern": "\\S" + } + }, + "required": [ + "individualId", + "fullName", + "name", + "givenName", + "familyName", + "middleName", + "nickName", + "preferredUsername", + "gender", + "streetAddress", + "locality", + "region", + "country", + "pin", + "preferredLang", + "dateOfBirth", + "postalCode", + "encodedPhoto", + "email", + "phone", + "zoneInfo", + "locale", + "password" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/mock-identity-system/src/main/resources/mock-identity-update-schema.json b/mock-identity-system/src/main/resources/mock-identity-update-schema.json new file mode 100644 index 00000000..4db8b953 --- /dev/null +++ b/mock-identity-system/src/main/resources/mock-identity-update-schema.json @@ -0,0 +1,254 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "$defs": { + "langField": { + "type": "array", + "items": { + "type": "object", + "properties": { + "language": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + }, + "required": [ + "language", + "value" + ], + "additionalProperties": false + }, + "nullable": true + } + }, + "properties": { + "individualId": { + "type": "string", + "pattern": "^\\+855\\d{9}$" + }, + "fullName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "name": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + + } + } + } + } + ] + }, + "givenName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "familyName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "middleName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "nickName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "preferredUsername": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "gender": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "streetAddress": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + + } + } + } + } + ] + }, + "locality": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "region": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "country": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "pin": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "preferredLang": { + "type": "string", + "nullable": true + }, + "dateOfBirth": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "postalCode": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "encodedPhoto": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$", + "nullable": true + }, + "phone": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "zoneInfo": { + "type": "string", + "nullable": true + }, + "locale": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "password": { + "type": "string", + "pattern": "\\S", + "nullable": true + } + }, + "required": [ + "individualId" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java index c1985195..3929e28d 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java @@ -55,12 +55,40 @@ public class IdentityControllerTest { @Before public void init() { identityRequest = new IdentityData(); - identityRequest.setIndividualId("123456789"); + identityRequest.setIndividualId("+855826741183"); identityRequest.setEmail("test@gmail.com"); + + List nameList=new ArrayList<>(); + LanguageValue engLangValue= new LanguageValue(); + engLangValue.setValue("Siddharth K Mansour"); + engLangValue.setLanguage("eng"); + LanguageValue arabicLangValue= new LanguageValue(); + arabicLangValue.setLanguage("ara"); + arabicLangValue.setValue("سيدارت ك منصور"); + nameList.add(engLangValue); + nameList.add(arabicLangValue); + identityRequest.setFullName(nameList); + identityRequest.setName(nameList); + identityRequest.setFamilyName(nameList); + identityRequest.setGivenName(nameList); + identityRequest.setPreferredUsername(nameList); + identityRequest.setNickName(nameList); + identityRequest.setPreferredUsername(nameList); + identityRequest.setMiddleName(nameList); + + LanguageValue mockLang = new LanguageValue(); + mockLang.setLanguage("eng"); + mockLang.setValue("mock"); + identityRequest.setGender(Arrays.asList(mockLang)); + identityRequest.setStreetAddress(Arrays.asList(mockLang)); + identityRequest.setLocality(Arrays.asList(mockLang)); + identityRequest.setRegion(Arrays.asList(mockLang)); + LanguageValue langValue = new LanguageValue(); langValue.setLanguage("eng"); langValue.setValue("ind"); identityRequest.setCountry(Arrays.asList(langValue)); + identityRequest.setDateOfBirth("20021990"); identityRequest.setEncodedPhoto("testencodedphoto"); identityRequest.setGender(Arrays.asList(langValue)); @@ -71,6 +99,10 @@ public void init() { identityRequest.setFullName(Arrays.asList(langValue)); identityRequest.setStreetAddress(Arrays.asList(langValue)); identityRequest.setPhone("9090909090"); + identityRequest.setPreferredLang("eng"); + identityRequest.setZoneInfo("local"); + identityRequest.setLocale("eng"); + identityRequest.setPassword("mock-password"); } @Test @@ -105,6 +137,7 @@ public void createIdentity_withInvalidIdentity_returnErrorResponse() throws Exce @Test public void getIdentity_withValidId_returnSuccessResponse() throws Exception { + identityRequest.setIndividualId("123456789"); Mockito.when(identityService.getIdentity(Mockito.anyString())).thenReturn(identityRequest); mockMvc.perform(get("/identity/{individualId}", "123456789") From 5ea5041b1983d0789e65de287ab365a51d049eba Mon Sep 17 00:00:00 2001 From: Mohd Kaif Siddique Date: Fri, 29 Nov 2024 15:59:13 +0530 Subject: [PATCH 05/30] modified schema validation now only one schema required to validate bot create and update identity object Signed-off-by: Mohd Kaif Siddique Signed-off-by: kaifk468 --- .../validator/IdentitySchemaValidator.java | 60 ++--- .../resources/application-default.properties | 4 +- .../resources/application-local.properties | 4 +- ...-schema.json => mock-identity-schema.json} | 2 +- .../mock-identity-update-schema.json | 254 ------------------ .../controller/IdentityControllerTest.java | 2 +- 6 files changed, 30 insertions(+), 296 deletions(-) rename mock-identity-system/src/main/resources/{mock-identity-create-schema.json => mock-identity-schema.json} (99%) delete mode 100644 mock-identity-system/src/main/resources/mock-identity-update-schema.json diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java index 7e52f9ba..c0aee892 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java @@ -2,10 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.networknt.schema.JsonSchema; -import com.networknt.schema.JsonSchemaFactory; -import com.networknt.schema.SpecVersion; -import com.networknt.schema.ValidationMessage; +import com.networknt.schema.*; import io.mosip.esignet.mock.identitysystem.dto.IdentityData; import io.mosip.esignet.mock.identitysystem.dto.RequestWrapper; import lombok.extern.slf4j.Slf4j; @@ -27,13 +24,11 @@ public class IdentitySchemaValidator implements ConstraintValidator exemptedField; private boolean isCreate; - private volatile JsonSchema cachedCreateSchema; - - private volatile JsonSchema cachedUpdateSchema; + private volatile JsonSchema cachedSchema; @Autowired ObjectMapper objectMapper; @@ -54,47 +49,40 @@ public boolean isValid(Object object, ConstraintValidatorContext context) { RequestWrapper wrapper= (RequestWrapper) object; Object requestObject = wrapper.getRequest(); if (!(requestObject instanceof IdentityData)) { - context.disableDefaultConstraintViolation(); - context.buildConstraintViolationWithTemplate("Invalid request object") - .addPropertyNode("request") - .addConstraintViolation(); return false; } IdentityData identityData=(IdentityData) requestObject; JsonNode identityJsonNode = objectMapper.valueToTree(identityData); - Set errors = isCreate - ? getCachedCreateSchema().validate(identityJsonNode) - : getCachedUpdateSchema().validate(identityJsonNode); - - if (!errors.isEmpty()) { - log.error("Validation failed for claims: {}", errors); + Set errors = getCachedSchema().validate(identityJsonNode); + boolean isValid=true; + if(!isCreate){ + for(ValidationMessage validationMessage: errors){ + String field=validationMessage. + getInstanceLocation().getName(0); + // Ignore validation errors with code 1029 (null value) for exempted fields when validating updateIdentity + if(!validationMessage.getCode().equals("1029") || !exemptedField.contains(field)){ + isValid=false; + break; + } + } + } + if (!isValid) { + log.error("Validation failed for IdentityData: {}", errors); return false; } return true; } - private JsonSchema getCachedCreateSchema() { - if(cachedCreateSchema !=null ) return cachedCreateSchema; + private JsonSchema getCachedSchema() { + if(cachedSchema !=null ) return cachedSchema; synchronized (this) { - if (cachedCreateSchema == null) { + if (cachedSchema == null) { InputStream schemaResponse = getResource(createSchemaUrl); JsonSchemaFactory jsonSchemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V202012); - cachedCreateSchema = jsonSchemaFactory.getSchema(schemaResponse); - } - } - return cachedCreateSchema; - } - - private JsonSchema getCachedUpdateSchema() { - if(cachedUpdateSchema !=null ) return cachedUpdateSchema; - synchronized (this) { - if (cachedUpdateSchema == null) { - InputStream schemaResponse = getResource(updateSchemaUrl); - JsonSchemaFactory jsonSchemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V202012); - cachedUpdateSchema = jsonSchemaFactory.getSchema(schemaResponse); + cachedSchema = jsonSchemaFactory.getSchema(schemaResponse); } } - return cachedUpdateSchema; + return cachedSchema; } private InputStream getResource(String url) { diff --git a/mock-identity-system/src/main/resources/application-default.properties b/mock-identity-system/src/main/resources/application-default.properties index 1d2288df..8f0975df 100644 --- a/mock-identity-system/src/main/resources/application-default.properties +++ b/mock-identity-system/src/main/resources/application-default.properties @@ -27,8 +27,8 @@ ##-----------------------------------------Mock-identity-system properties---------------------------------------------- -mosip.mock.ida.identity.create.schema.url=classpath:/mock-identity-create-schema.json -mosip.mock.ida.identity.update.schema.url=classpath:/mock-identity-update-schema.json +mosip.mock.ida.identity.create.schema.url=classpath:/mock-identity-schema.json +mosip.mock.ida.identity.update.exempted.field={"fullName","name","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} ##----------------------------------------- Database properties -------------------------------------------------------- mosip.mockidentitysystem.database.hostname=${database.host} diff --git a/mock-identity-system/src/main/resources/application-local.properties b/mock-identity-system/src/main/resources/application-local.properties index bf63ee80..38d357dc 100644 --- a/mock-identity-system/src/main/resources/application-local.properties +++ b/mock-identity-system/src/main/resources/application-local.properties @@ -1,7 +1,7 @@ ##-----------------------------------------Mock-identity-system properties---------------------------------------------- -mosip.mock.ida.identity.create.schema.url=classpath:/mock-identity-create-schema.json -mosip.mock.ida.identity.update.schema.url=classpath:/mock-identity-update-schema.json +mosip.mock.ida.identity.create.schema.url=classpath:/mock-identity-schema.json +mosip.mock.ida.identity.update.exempted.field={"fullName","name","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} ##----------------------------------------- Database properties -------------------------------------------------------- diff --git a/mock-identity-system/src/main/resources/mock-identity-create-schema.json b/mock-identity-system/src/main/resources/mock-identity-schema.json similarity index 99% rename from mock-identity-system/src/main/resources/mock-identity-create-schema.json rename to mock-identity-system/src/main/resources/mock-identity-schema.json index 69aa1151..bebd989b 100644 --- a/mock-identity-system/src/main/resources/mock-identity-create-schema.json +++ b/mock-identity-system/src/main/resources/mock-identity-schema.json @@ -25,7 +25,7 @@ "properties": { "individualId": { "type": "string", - "pattern": "^\\+855\\d{9}$" + "pattern": "^[0-9]{5,19}$" }, "fullName": { "allOf": [ diff --git a/mock-identity-system/src/main/resources/mock-identity-update-schema.json b/mock-identity-system/src/main/resources/mock-identity-update-schema.json deleted file mode 100644 index 4db8b953..00000000 --- a/mock-identity-system/src/main/resources/mock-identity-update-schema.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "$defs": { - "langField": { - "type": "array", - "items": { - "type": "object", - "properties": { - "language": { - "type": "string", - "nullable": true - }, - "value": { - "type": "string", - "nullable": true - } - }, - "required": [ - "language", - "value" - ], - "additionalProperties": false - }, - "nullable": true - } - }, - "properties": { - "individualId": { - "type": "string", - "pattern": "^\\+855\\d{9}$" - }, - "fullName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "name": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - - } - } - } - } - ] - }, - "givenName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "familyName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "middleName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "nickName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "preferredUsername": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "gender": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "streetAddress": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - - } - } - } - } - ] - }, - "locality": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "region": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "country": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "pin": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "preferredLang": { - "type": "string", - "nullable": true - }, - "dateOfBirth": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "postalCode": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "encodedPhoto": { - "type": "string" - }, - "email": { - "type": "string", - "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$", - "nullable": true - }, - "phone": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "zoneInfo": { - "type": "string", - "nullable": true - }, - "locale": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "password": { - "type": "string", - "pattern": "\\S", - "nullable": true - } - }, - "required": [ - "individualId" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java index 3929e28d..08c32aaa 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java @@ -55,7 +55,7 @@ public class IdentityControllerTest { @Before public void init() { identityRequest = new IdentityData(); - identityRequest.setIndividualId("+855826741183"); + identityRequest.setIndividualId("826741183"); identityRequest.setEmail("test@gmail.com"); List nameList=new ArrayList<>(); From 97faef9f31ec8d00d2ac25f3ba8a45a951fbffa1 Mon Sep 17 00:00:00 2001 From: Mohd Kaif Siddique Date: Tue, 3 Dec 2024 13:13:00 +0530 Subject: [PATCH 06/30] review changes and modified testcases Signed-off-by: Mohd Kaif Siddique Signed-off-by: kaifk468 --- .../controller/IdentityController.java | 33 ++- .../validator/IdentitySchemaValidator.java | 44 ++- .../resources/application-default.properties | 4 +- .../resources/application-local.properties | 6 +- .../controller/IdentityControllerTest.java | 49 +++- .../resources/application-test.properties | 3 + .../src/test/resources/bootstrap.properties | 2 + .../resources/mock-identity-test-schema.json | 267 ++++++++++++++++++ 8 files changed, 379 insertions(+), 29 deletions(-) create mode 100644 mock-identity-system/src/test/resources/application-test.properties create mode 100644 mock-identity-system/src/test/resources/bootstrap.properties create mode 100644 mock-identity-system/src/test/resources/mock-identity-test-schema.json diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java index 6396bd60..aefb57dd 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java @@ -5,12 +5,18 @@ */ package io.mosip.esignet.mock.identitysystem.controller; +import javax.validation.ConstraintViolation; +import javax.validation.ConstraintViolationException; import javax.validation.Valid; import io.mosip.esignet.mock.identitysystem.dto.*; +import io.mosip.esignet.mock.identitysystem.dto.Error; import io.mosip.esignet.mock.identitysystem.validator.IdentitySchema; +import io.mosip.kernel.core.exception.ErrorResponse; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -18,7 +24,9 @@ import io.mosip.esignet.mock.identitysystem.service.IdentityService; import io.mosip.esignet.mock.identitysystem.util.HelperUtil; +import java.util.ArrayList; import java.util.List; +import java.util.Set; @RestController @@ -32,7 +40,7 @@ public class IdentityController { @PostMapping(value = "identity", consumes = { MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE }) public ResponseWrapper createIdentity - (@Valid @RequestBody @IdentitySchema(isCreate=true) RequestWrapper< IdentityData> requestWrapper) throws MockIdentityException { + (@RequestBody @IdentitySchema(isCreate=true) RequestWrapper< IdentityData> requestWrapper) throws MockIdentityException { ResponseWrapper response = new ResponseWrapper(); IdentityStatus identityStatus = new IdentityStatus(); @@ -46,7 +54,7 @@ public class IdentityController { @PutMapping(value = "identity", consumes = { MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE }) public ResponseWrapper updateIdentity - (@Valid @RequestBody @IdentitySchema(isCreate=false) RequestWrapper requestWrapper) throws MockIdentityException { + (@RequestBody @IdentitySchema(isCreate=false) RequestWrapper requestWrapper) throws MockIdentityException { ResponseWrapper response = new ResponseWrapper(); IdentityStatus identityStatus = new IdentityStatus(); @@ -77,4 +85,25 @@ public ResponseWrapper createVerifiedClaim(@Valid @RequestB return response; } + + @ExceptionHandler(ConstraintViolationException.class) + public ResponseEntity handleMethodArgumentNotValidException(ConstraintViolationException ex) { + List errors = new ArrayList<>(); + if(ex != null) { + Set> violations = ((ConstraintViolationException) ex).getConstraintViolations(); + for(ConstraintViolation cv : violations) { + errors.add(new Error(cv.getMessage(), cv.getPropertyPath().toString() + ": " + cv.getMessage())); + } + return new ResponseEntity(getResponseWrapper(errors), HttpStatus.OK); + } + return ResponseEntity.status(HttpStatus.BAD_REQUEST) + .body(errors); + } + + private ResponseWrapper getResponseWrapper(List errors) { + ResponseWrapper responseWrapper = new ResponseWrapper<>(); + responseWrapper.setResponseTime(HelperUtil.getCurrentUTCDateTime()); + responseWrapper.setErrors(errors); + return responseWrapper; + } } diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java index c0aee892..62c6c632 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java @@ -11,6 +11,8 @@ import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; import java.io.IOException; @@ -21,14 +23,14 @@ @Slf4j public class IdentitySchemaValidator implements ConstraintValidator { - @Value("${mosip.mock.ida.identity.create.schema.url}") - private String createSchemaUrl; + @Value("${mosip.mock.ida.identity.schema.url}") + private String identitySchemaUrl; - @Value("#{${mosip.mock.ida.identity.update.exempted.field}}") - private Set exemptedField; + @Value("#{${mosip.mock.ida.update-identity.non-mandatory.fields}}") + private Set nonMandatoryFieldsOnUpdate; private boolean isCreate; - private volatile JsonSchema cachedSchema; + private volatile JsonSchema schema; @Autowired ObjectMapper objectMapper; @@ -36,6 +38,7 @@ public class IdentitySchemaValidator implements ConstraintValidator errors = getCachedSchema().validate(identityJsonNode); + Set errors = getSchema().validate(identityJsonNode); boolean isValid=true; + String errorName=""; if(!isCreate){ for(ValidationMessage validationMessage: errors){ String field=validationMessage. getInstanceLocation().getName(0); // Ignore validation errors with code 1029 (null value) for exempted fields when validating updateIdentity - if(!validationMessage.getCode().equals("1029") || !exemptedField.contains(field)){ + if(!validationMessage.getCode().equals("1029") || !nonMandatoryFieldsOnUpdate.contains(field)){ + errorName="invalid_"+field.toLowerCase(); isValid=false; break; } } + }else if(!errors.isEmpty()){ + isValid=false; } if (!isValid) { + context.disableDefaultConstraintViolation(); + if(StringUtils.isEmpty(errorName)) + errorName="invalid_"+errors.iterator().next().getInstanceLocation().getName(0).toLowerCase(); + context.buildConstraintViolationWithTemplate(errorName) + .addConstraintViolation(); log.error("Validation failed for IdentityData: {}", errors); return false; } return true; } - - private JsonSchema getCachedSchema() { - if(cachedSchema !=null ) return cachedSchema; + private JsonSchema getSchema() { + if(schema !=null ) return schema; synchronized (this) { - if (cachedSchema == null) { - InputStream schemaResponse = getResource(createSchemaUrl); + if (schema == null) { + InputStream schemaResponse = getResource(identitySchemaUrl); JsonSchemaFactory jsonSchemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V202012); - cachedSchema = jsonSchemaFactory.getSchema(schemaResponse); + schema = jsonSchemaFactory.getSchema(schemaResponse); } } - return cachedSchema; + return schema; } private InputStream getResource(String url) { diff --git a/mock-identity-system/src/main/resources/application-default.properties b/mock-identity-system/src/main/resources/application-default.properties index 8f0975df..880c5e75 100644 --- a/mock-identity-system/src/main/resources/application-default.properties +++ b/mock-identity-system/src/main/resources/application-default.properties @@ -27,8 +27,8 @@ ##-----------------------------------------Mock-identity-system properties---------------------------------------------- -mosip.mock.ida.identity.create.schema.url=classpath:/mock-identity-schema.json -mosip.mock.ida.identity.update.exempted.field={"fullName","name","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} +mosip.mock.ida.identity.schema.url=classpath:/mock-identity-schema.json +mosip.mock.ida.update-identity.non-mandatory.fields={"fullName","name","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} ##----------------------------------------- Database properties -------------------------------------------------------- mosip.mockidentitysystem.database.hostname=${database.host} diff --git a/mock-identity-system/src/main/resources/application-local.properties b/mock-identity-system/src/main/resources/application-local.properties index 38d357dc..a450017a 100644 --- a/mock-identity-system/src/main/resources/application-local.properties +++ b/mock-identity-system/src/main/resources/application-local.properties @@ -1,12 +1,12 @@ ##-----------------------------------------Mock-identity-system properties---------------------------------------------- -mosip.mock.ida.identity.create.schema.url=classpath:/mock-identity-schema.json -mosip.mock.ida.identity.update.exempted.field={"fullName","name","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} +mosip.mock.ida.identity.schema.url=classpath:/mock-identity-schema.json +mosip.mock.ida.update-identity.non-mandatory.fields={"fullName","name","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} ##----------------------------------------- Database properties -------------------------------------------------------- -spring.datasource.url=jdbc:postgresql://localhost:5455/mosip_mockidentitysystem?currentSchema=mockidentitysystem +spring.datasource.url=jdbc:postgresql://localhost:5432/mosip_mockidentitysystem?currentSchema=mockidentitysystem spring.datasource.username=postgres spring.datasource.password=postgres spring.datasource.driver-class-name=org.postgresql.Driver diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java index 08c32aaa..00a46c6a 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java @@ -30,7 +30,6 @@ import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.mosip.esignet.mock.identitysystem.service.IdentityService; @@ -113,7 +112,6 @@ public void createIdentity_withValidIdentity_returnSuccessResponse() throws Exce requestWrapper.setRequest(identityRequest); Mockito.doNothing().when(identityService).addIdentity(identityRequest); - mockMvc.perform(post("/identity").content(objectMapper.writeValueAsString(requestWrapper)) .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) .andExpect(jsonPath("$.response.status").value("mock identity data created successfully")); @@ -128,18 +126,41 @@ public void createIdentity_withInvalidIdentity_returnErrorResponse() throws Exce requestWrapper.setRequest(identityRequest); Mockito.doNothing().when(identityService).addIdentity(identityRequest); - mockMvc.perform(post("/identity").content(objectMapper.writeValueAsString(requestWrapper)) .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) .andExpect(jsonPath("$.errors").isNotEmpty()) - .andExpect(jsonPath("$.errors[0].errorCode").value(ErrorConstants.INVALID_INDIVIDUAL_ID)); + .andExpect(jsonPath("$.errors[0].errorCode").value("invalid_individualid")); + } + + @Test + public void createIdentity_withInvalidFullName_returnErrorResponse() throws Exception { + RequestWrapper requestWrapper = new RequestWrapper(); + ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); + requestWrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); + + List nameList=new ArrayList<>(); + LanguageValue engLangValue= new LanguageValue(); + engLangValue.setValue("Siddharth K سيدارت"); + engLangValue.setLanguage("eng"); + LanguageValue arabicLangValue= new LanguageValue(); + arabicLangValue.setLanguage("ara"); + arabicLangValue.setValue("سيدارت ك منصور"); + nameList.add(engLangValue); + nameList.add(arabicLangValue); + identityRequest.setFullName(nameList); + requestWrapper.setRequest(identityRequest); + + Mockito.doNothing().when(identityService).addIdentity(identityRequest); + mockMvc.perform(post("/identity").content(objectMapper.writeValueAsString(requestWrapper)) + .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + .andExpect(jsonPath("$.errors").isNotEmpty()) + .andExpect(jsonPath("$.errors[0].errorCode").value("invalid_fullname")); } @Test public void getIdentity_withValidId_returnSuccessResponse() throws Exception { identityRequest.setIndividualId("123456789"); Mockito.when(identityService.getIdentity(Mockito.anyString())).thenReturn(identityRequest); - mockMvc.perform(get("/identity/{individualId}", "123456789") .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) .andExpect(jsonPath("$.response.individualId").value("123456789")); @@ -163,7 +184,6 @@ public void addVerifiedClaims_withValidDetails_returnSuccessResponse() throws Ex verifiedClaimRequestDto.setVerificationDetail(verificationDetail); requestWrapper.setRequest(verifiedClaimRequestDto); - Mockito.doNothing().when(identityService).addVerifiedClaim(verifiedClaimRequestDto); Mockito.when(identityService.getIdentity(Mockito.anyString())).thenReturn(identityRequest); @@ -185,7 +205,6 @@ public void addVerifiedClaim_withInvalidClaim_returnErrorResponse() throws Exce verifiedClaimRequestDto.setVerificationDetail(verificationDetail); requestWrapper.setRequest(verifiedClaimRequestDto); - Mockito.doNothing().when(identityService).addVerifiedClaim(verifiedClaimRequestDto); mockMvc.perform(post("/identity/add-verified-claim").content(objectMapper.writeValueAsString(requestWrapper)) @@ -202,10 +221,24 @@ public void updateIdentity_withValidIdentity_thenPass() throws Exception { requestWrapper.setRequest(identityRequest); Mockito.doNothing().when(identityService).updateIdentity(identityRequest); - mockMvc.perform(put("/identity").content(objectMapper.writeValueAsString(requestWrapper)) .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) .andExpect(jsonPath("$.response.status").value("mock Identity data updated successfully")); } + @Test + public void updateIdentity_withInValidIdentity_thenFail() throws Exception { + RequestWrapper requestWrapper = new RequestWrapper(); + ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); + requestWrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); + identityRequest.setFullName(null); + requestWrapper.setRequest(identityRequest); + + Mockito.doNothing().when(identityService).updateIdentity(identityRequest); + mockMvc.perform(put("/identity").content(objectMapper.writeValueAsString(requestWrapper)) + .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + .andExpect(jsonPath("$.errors").isNotEmpty()) + .andExpect(jsonPath("$.errors[0].errorCode").value("invalid_fullname")); + } + } diff --git a/mock-identity-system/src/test/resources/application-test.properties b/mock-identity-system/src/test/resources/application-test.properties new file mode 100644 index 00000000..f968ad02 --- /dev/null +++ b/mock-identity-system/src/test/resources/application-test.properties @@ -0,0 +1,3 @@ + +mosip.mock.ida.identity.schema.url=classpath:/mock-identity-test-schema.json +mosip.mock.ida.update-identity.non-mandatory.fields={"name","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} diff --git a/mock-identity-system/src/test/resources/bootstrap.properties b/mock-identity-system/src/test/resources/bootstrap.properties new file mode 100644 index 00000000..b78f2069 --- /dev/null +++ b/mock-identity-system/src/test/resources/bootstrap.properties @@ -0,0 +1,2 @@ + +spring.profiles.active=test \ No newline at end of file diff --git a/mock-identity-system/src/test/resources/mock-identity-test-schema.json b/mock-identity-system/src/test/resources/mock-identity-test-schema.json new file mode 100644 index 00000000..bebd989b --- /dev/null +++ b/mock-identity-system/src/test/resources/mock-identity-test-schema.json @@ -0,0 +1,267 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "$defs": { + "langField": { + "type": "array", + "items": { + "type": "object", + "properties": { + "language": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "language", + "value" + ], + "additionalProperties": false + } + } + }, + "properties": { + "individualId": { + "type": "string", + "pattern": "^[0-9]{5,19}$" + }, + "fullName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "name": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "nullable": true + }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + + } + } + } + } + ] + }, + "givenName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "familyName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "middleName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "nickName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "preferredUsername": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "gender": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "streetAddress": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + + } + } + } + } + ] + }, + "locality": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "region": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "country": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "pin": { + "type": "string", + "pattern": "\\S" + }, + "preferredLang": { + "type": "string" + }, + "dateOfBirth": { + "type": "string", + "pattern": "\\S" + }, + "postalCode": { + "type": "string", + "pattern": "\\S" + }, + "encodedPhoto": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$" + }, + "phone": { + "type": "string", + "pattern": "\\S" + }, + "zoneInfo": { + "type": "string" + }, + "locale": { + "type": "string", + "pattern": "\\S" + }, + "password": { + "type": "string", + "pattern": "\\S" + } + }, + "required": [ + "individualId", + "fullName", + "name", + "givenName", + "familyName", + "middleName", + "nickName", + "preferredUsername", + "gender", + "streetAddress", + "locality", + "region", + "country", + "pin", + "preferredLang", + "dateOfBirth", + "postalCode", + "encodedPhoto", + "email", + "phone", + "zoneInfo", + "locale", + "password" + ], + "additionalProperties": false +} \ No newline at end of file From 0efb497d1f028b907e50fbf404a9b8fd3b762aaf Mon Sep 17 00:00:00 2001 From: kaifk468 Date: Thu, 5 Dec 2024 22:56:09 +0530 Subject: [PATCH 07/30] review changes Signed-off-by: kaifk468 --- .../validator/IdentitySchemaValidator.java | 20 ++++++++----------- .../resources/application-local.properties | 6 ------ 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java index 62c6c632..2c4888d0 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java @@ -46,49 +46,45 @@ public void initialize(IdentitySchema constraintAnnotation) { @Override public boolean isValid(Object object, ConstraintValidatorContext context) { - context.disableDefaultConstraintViolation(); if (!(object instanceof RequestWrapper)) { - context.buildConstraintViolationWithTemplate("Invalid request type") - .addConstraintViolation(); return false; } RequestWrapper wrapper= (RequestWrapper) object; Object requestObject = wrapper.getRequest(); if (!(requestObject instanceof IdentityData)) { - context.disableDefaultConstraintViolation(); - context.buildConstraintViolationWithTemplate("Invalid request object type").addConstraintViolation(); return false; } IdentityData identityData=(IdentityData) requestObject; JsonNode identityJsonNode = objectMapper.valueToTree(identityData); Set errors = getSchema().validate(identityJsonNode); boolean isValid=true; - String errorName=""; + String errorCode=""; if(!isCreate){ for(ValidationMessage validationMessage: errors){ String field=validationMessage. getInstanceLocation().getName(0); // Ignore validation errors with code 1029 (null value) for exempted fields when validating updateIdentity if(!validationMessage.getCode().equals("1029") || !nonMandatoryFieldsOnUpdate.contains(field)){ - errorName="invalid_"+field.toLowerCase(); + errorCode="invalid_"+field.toLowerCase(); isValid=false; break; } } - }else if(!errors.isEmpty()){ - isValid=false; + }else{ + isValid=errors.isEmpty(); } if (!isValid) { + if(StringUtils.isEmpty(errorCode)) + errorCode="invalid_"+errors.iterator().next().getInstanceLocation().getName(0).toLowerCase(); context.disableDefaultConstraintViolation(); - if(StringUtils.isEmpty(errorName)) - errorName="invalid_"+errors.iterator().next().getInstanceLocation().getName(0).toLowerCase(); - context.buildConstraintViolationWithTemplate(errorName) + context.buildConstraintViolationWithTemplate(errorCode) .addConstraintViolation(); log.error("Validation failed for IdentityData: {}", errors); return false; } return true; } + private JsonSchema getSchema() { if(schema !=null ) return schema; synchronized (this) { diff --git a/mock-identity-system/src/main/resources/application-local.properties b/mock-identity-system/src/main/resources/application-local.properties index a450017a..e6dfac3c 100644 --- a/mock-identity-system/src/main/resources/application-local.properties +++ b/mock-identity-system/src/main/resources/application-local.properties @@ -1,9 +1,3 @@ -##-----------------------------------------Mock-identity-system properties---------------------------------------------- - -mosip.mock.ida.identity.schema.url=classpath:/mock-identity-schema.json -mosip.mock.ida.update-identity.non-mandatory.fields={"fullName","name","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} - - ##----------------------------------------- Database properties -------------------------------------------------------- spring.datasource.url=jdbc:postgresql://localhost:5432/mosip_mockidentitysystem?currentSchema=mockidentitysystem From 2f3b96d17bd02d9fcb427d96656735222a055ece Mon Sep 17 00:00:00 2001 From: kaifk468 Date: Tue, 10 Dec 2024 09:14:20 +0530 Subject: [PATCH 08/30] review changes now the error code will multiple errors Signed-off-by: kaifk468 --- .../validator/IdentitySchemaValidator.java | 52 ++++++++++--------- .../resources/application-local.properties | 2 +- .../src/main/resources/bootstrap.properties | 2 +- .../controller/IdentityControllerTest.java | 16 ++++++ 4 files changed, 45 insertions(+), 27 deletions(-) diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java index 2c4888d0..132383e1 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java @@ -11,13 +11,13 @@ import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.stereotype.Component; -import org.springframework.util.StringUtils; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; import java.io.IOException; import java.io.InputStream; import java.util.Set; +import java.util.stream.Collectors; @Component @Slf4j @@ -56,35 +56,37 @@ public boolean isValid(Object object, ConstraintValidatorContext context) { } IdentityData identityData=(IdentityData) requestObject; JsonNode identityJsonNode = objectMapper.valueToTree(identityData); - Set errors = getSchema().validate(identityJsonNode); - boolean isValid=true; - String errorCode=""; - if(!isCreate){ - for(ValidationMessage validationMessage: errors){ - String field=validationMessage. - getInstanceLocation().getName(0); - // Ignore validation errors with code 1029 (null value) for exempted fields when validating updateIdentity - if(!validationMessage.getCode().equals("1029") || !nonMandatoryFieldsOnUpdate.contains(field)){ - errorCode="invalid_"+field.toLowerCase(); - isValid=false; - break; - } - } - }else{ - isValid=errors.isEmpty(); - } - if (!isValid) { - if(StringUtils.isEmpty(errorCode)) - errorCode="invalid_"+errors.iterator().next().getInstanceLocation().getName(0).toLowerCase(); - context.disableDefaultConstraintViolation(); - context.buildConstraintViolationWithTemplate(errorCode) - .addConstraintViolation(); - log.error("Validation failed for IdentityData: {}", errors); + Set validationErrors = validateIdentityData(identityJsonNode); + + // Handle validation errors + if (!validationErrors.isEmpty()) { + addValidationErrorCode(validationErrors,context); return false; } return true; } + private Set validateIdentityData(JsonNode identityJsonNode) { + Set errors = getSchema().validate(identityJsonNode); + // If not a create operation, filter out specific errors + if (!isCreate) { + // Ignore validation errors with code 1029 (null value) and for exempted fields when validating updateIdentity + errors = errors.stream() + .filter(error -> !error.getCode().equals("1029") || + !nonMandatoryFieldsOnUpdate.contains(error. + getInstanceLocation().getName(0))) + .collect(Collectors.toSet()); + } + return errors; + } + + private void addValidationErrorCode(Set errors, ConstraintValidatorContext context) { + context.disableDefaultConstraintViolation(); + errors.forEach(error->context. + buildConstraintViolationWithTemplate("invalid_"+error.getInstanceLocation().getName(0).toLowerCase()) + .addConstraintViolation()); + } + private JsonSchema getSchema() { if(schema !=null ) return schema; synchronized (this) { diff --git a/mock-identity-system/src/main/resources/application-local.properties b/mock-identity-system/src/main/resources/application-local.properties index e6dfac3c..499cdf19 100644 --- a/mock-identity-system/src/main/resources/application-local.properties +++ b/mock-identity-system/src/main/resources/application-local.properties @@ -1,6 +1,6 @@ ##----------------------------------------- Database properties -------------------------------------------------------- -spring.datasource.url=jdbc:postgresql://localhost:5432/mosip_mockidentitysystem?currentSchema=mockidentitysystem +spring.datasource.url=jdbc:postgresql://localhost:5455/mosip_mockidentitysystem?currentSchema=mockidentitysystem spring.datasource.username=postgres spring.datasource.password=postgres spring.datasource.driver-class-name=org.postgresql.Driver diff --git a/mock-identity-system/src/main/resources/bootstrap.properties b/mock-identity-system/src/main/resources/bootstrap.properties index cc80ac20..f5ea042c 100644 --- a/mock-identity-system/src/main/resources/bootstrap.properties +++ b/mock-identity-system/src/main/resources/bootstrap.properties @@ -1,6 +1,6 @@ spring.application.name=mock-identity-system #spring.cloud.config.uri=http://localhost:8888 -spring.profiles.active=local +spring.profiles.active=default,local #spring.cloud.config.label=master spring.cloud.config.name=mock-identity-system spring.main.allow-bean-definition-overriding=true diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java index 00a46c6a..56896d18 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java @@ -132,6 +132,22 @@ public void createIdentity_withInvalidIdentity_returnErrorResponse() throws Exce .andExpect(jsonPath("$.errors[0].errorCode").value("invalid_individualid")); } + @Test + public void createIdentity_withInvalidNameAndLocale_returnErrorResponse() throws Exception { + RequestWrapper requestWrapper = new RequestWrapper(); + ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); + requestWrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); + identityRequest.setName(null); + identityRequest.setLocale(null); + requestWrapper.setRequest(identityRequest); + + Mockito.doNothing().when(identityService).addIdentity(identityRequest); + mockMvc.perform(post("/identity").content(objectMapper.writeValueAsString(requestWrapper)) + .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + .andExpect(jsonPath("$.errors").isNotEmpty()) + .andExpect(jsonPath("$.errors.size()").value(2)); + } + @Test public void createIdentity_withInvalidFullName_returnErrorResponse() throws Exception { RequestWrapper requestWrapper = new RequestWrapper(); From 993d8f3494cec20a2c32c4f41e00ad9b4ebf4b85 Mon Sep 17 00:00:00 2001 From: Piyush7034 <47858366+Piyush7034@users.noreply.github.com> Date: Fri, 4 Oct 2024 22:14:40 +0530 Subject: [PATCH 09/30] Added JsonIgnoreProperties for kyc auth and exchange requests (#269) Signed-off-by: piyush-shukla03_infosys Co-authored-by: piyush-shukla03_infosys Signed-off-by: kaifk468 --- .../esignet/mock/identitysystem/dto/KycAuthRequestDto.java | 2 ++ .../esignet/mock/identitysystem/dto/KycExchangeRequestDto.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/KycAuthRequestDto.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/KycAuthRequestDto.java index 55f0ff8f..404c1680 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/KycAuthRequestDto.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/KycAuthRequestDto.java @@ -5,12 +5,14 @@ */ package io.mosip.esignet.mock.identitysystem.dto; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; import java.util.List; @Data +@JsonIgnoreProperties(ignoreUnknown = true) public class KycAuthRequestDto { private String transactionId; diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/KycExchangeRequestDto.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/KycExchangeRequestDto.java index 5bb4f623..b866dadc 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/KycExchangeRequestDto.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/KycExchangeRequestDto.java @@ -6,12 +6,14 @@ package io.mosip.esignet.mock.identitysystem.dto; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; import java.time.LocalDateTime; import java.util.List; @Data +@JsonIgnoreProperties(ignoreUnknown = true) public class KycExchangeRequestDto { private LocalDateTime requestDateTime; From cfc99a94e6fa9f132aa8484abef958f6552a1114 Mon Sep 17 00:00:00 2001 From: pvsaidurga <132046494+pvsaidurga@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:53:52 +0530 Subject: [PATCH 10/30] [ES-1689] (#271) * [ES-1689] Signed-off-by: Venkata Saidurga Polamraju * [ES-1689] Signed-off-by: Venkata Saidurga Polamraju * [ES-1689] Updated the review comments Signed-off-by: Venkata Saidurga Polamraju --------- Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: kaifk468 --- .../impl/AuthenticationServiceImplTest.java | 329 ++++++++++++++++++ .../service/impl/IdentityServiceTest.java | 91 +++++ 2 files changed, 420 insertions(+) diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java index 571968dc..0dfc90e1 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java @@ -107,6 +107,200 @@ public void kycAuth_withValidKbiChallenge_thenPass() { Assert.assertTrue(kycAuthResponseDto.isAuthStatus()); } + @Test + public void kycAuth_withInvalidIdentity_thenFail() { + KycAuthDto kycAuthDto = new KycAuthDto(); + kycAuthDto.setKbi("eyJmdWxsTmFtZSI6IlNpZGRoYXJ0aCBLIE1hbnNvdXIiLCJkYXRlT2ZCaXJ0aCI6IjE5ODctMTEtMjUifQ=="); + kycAuthDto.setIndividualId("individualId"); + kycAuthDto.setTransactionId("transactionId"); + Mockito.when(identityService.getIdentityV2(Mockito.anyString())).thenReturn(null); + + try{ + authenticationService.kycAuth("relyingPartyId", "clientId", kycAuthDto); + }catch (MockIdentityException e){ + Assert.assertEquals("invalid_individual_id",e.getMessage()); + } + } + + @Test + public void kycAuth_withoutSendOTPInvocation_thenFail() { + List> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string") + ,Map.of("id","fullName","type","text","format","") + ,Map.of("id","dateOfBirth","type","date","format","yyyy-MM-dd")); + ReflectionTestUtils.setField(authenticationService, "fieldDetailList", fieldDetailList); + ReflectionTestUtils.setField(authenticationService, "fieldLang", "eng"); + ReflectionTestUtils.setField(authenticationService,"objectMapper",new ObjectMapper()); + + KycAuthDto kycAuthDto = new KycAuthDto(); + kycAuthDto.setOtp("111111"); + kycAuthDto.setIndividualId("individualId"); + kycAuthDto.setTransactionId("transactionId"); + + IdentityData identityData = new IdentityData(); + identityData.setDateOfBirth("1987/11/25"); + LanguageValue languageValue = new LanguageValue(); + languageValue.setLanguage("eng"); + languageValue.setValue("Siddharth K Mansour"); + identityData.setFullName(List.of(languageValue)); + Mockito.when(identityService.getIdentityV2(Mockito.anyString())).thenReturn(this.identityData); + try{ + authenticationService.kycAuth("relyingPartyId", "clientId", kycAuthDto); + }catch (MockIdentityException e){ + Assert.assertEquals("invalid_transaction",e.getMessage()); + } + } + + @Test + public void kycAuth_withSendOTPInvocation_thenPass() { + List> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string") + ,Map.of("id","fullName","type","text","format","") + ,Map.of("id","dateOfBirth","type","date","format","yyyy-MM-dd")); + ReflectionTestUtils.setField(authenticationService,"otpChannels",Arrays.asList("email","phone")); + ReflectionTestUtils.setField(authenticationService, "fieldDetailList", fieldDetailList); + ReflectionTestUtils.setField(authenticationService, "fieldLang", "eng"); + ReflectionTestUtils.setField(authenticationService,"objectMapper",new ObjectMapper()); + ReflectionTestUtils.setField(authenticationService,"trnHash",new ArrayList<>()); + + KycAuthDto kycAuthDto = new KycAuthDto(); + kycAuthDto.setOtp("111111"); + kycAuthDto.setIndividualId("individualId"); + kycAuthDto.setTransactionId("transactionId"); + + IdentityData identityData = new IdentityData(); + identityData.setDateOfBirth("1987/11/25"); + identityData.setIndividualId("individualId"); + identityData.setEmail("test@email.com"); + identityData.setPhone("1234567890"); + LanguageValue languageValue = new LanguageValue(); + languageValue.setLanguage("eng"); + languageValue.setValue("Siddharth K Mansour"); + identityData.setFullName(List.of(languageValue)); + SendOtpDto sendOtpDto=new SendOtpDto(); + sendOtpDto.setIndividualId("individualId"); + sendOtpDto.setOtpChannels(Arrays.asList("email","phone")); + sendOtpDto.setTransactionId("transactionId"); + + Mockito.when(identityService.getIdentity("individualId")).thenReturn(identityData); + authenticationService.sendOtp("relyingPartyId", "clientId", sendOtpDto); + Mockito.when(identityService.getIdentityV2(Mockito.anyString())).thenReturn(this.identityData); + Mockito.when(authRepository.save(Mockito.any())).thenReturn(new KycAuth()); + KycAuthResponseDto kycAuthResponseDto = authenticationService.kycAuth("relyingPartyId", "clientId", kycAuthDto); + Assert.assertTrue(kycAuthResponseDto.isAuthStatus()); + } + + @Test + public void kycAuth_withInValidTransactionId_thenFail() { + List> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string") + ,Map.of("id","fullName","type","text","format","") + ,Map.of("id","dateOfBirth","type","date","format","yyyy-MM-dd")); + ReflectionTestUtils.setField(authenticationService, "fieldDetailList", fieldDetailList); + ReflectionTestUtils.setField(authenticationService, "fieldLang", "eng"); + ReflectionTestUtils.setField(authenticationService,"objectMapper",new ObjectMapper()); + + KycAuthDto kycAuthDto = new KycAuthDto(); + kycAuthDto.setOtp("111111"); + kycAuthDto.setIndividualId("individualId"); + kycAuthDto.setTransactionId(""); + + IdentityData identityData = new IdentityData(); + identityData.setDateOfBirth("1987/11/25"); + LanguageValue languageValue = new LanguageValue(); + languageValue.setLanguage("eng"); + languageValue.setValue("Siddharth K Mansour"); + identityData.setFullName(List.of(languageValue)); + Mockito.when(identityService.getIdentityV2(Mockito.anyString())).thenReturn(this.identityData); + try{ + authenticationService.kycAuth("relyingPartyId", "clientId", kycAuthDto); + }catch (MockIdentityException e){ + Assert.assertEquals("invalid_transaction_id",e.getMessage()); + } + } + + @Test + public void kycAuth_withValidPinChallenge_thenPass() { + + List> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string") + ,Map.of("id","fullName","type","text","format","") + ,Map.of("id","dateOfBirth","type","date","format","yyyy-MM-dd")); + ReflectionTestUtils.setField(authenticationService, "fieldDetailList", fieldDetailList); + ReflectionTestUtils.setField(authenticationService, "fieldLang", "eng"); + ReflectionTestUtils.setField(authenticationService,"objectMapper",new ObjectMapper()); + + KycAuthDto kycAuthDto = new KycAuthDto(); + kycAuthDto.setPin("111111"); + kycAuthDto.setIndividualId("individualId"); + kycAuthDto.setTransactionId("transactionId"); + + IdentityData identityData = new IdentityData(); + identityData.setDateOfBirth("1987/11/25"); + LanguageValue languageValue = new LanguageValue(); + languageValue.setLanguage("eng"); + languageValue.setValue("Siddharth K Mansour"); + identityData.setFullName(List.of(languageValue)); + Mockito.when(identityService.getIdentityV2(Mockito.anyString())).thenReturn(this.identityData); + Mockito.when(authRepository.save(Mockito.any())).thenReturn(new KycAuth()); + + KycAuthResponseDto kycAuthResponseDto = authenticationService.kycAuth("relyingPartyId", "clientId", kycAuthDto); + Assert.assertTrue(kycAuthResponseDto.isAuthStatus()); + } + + @Test + public void kycAuth_withValidBiometricsChallenge_thenPass() { + + List> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string") + ,Map.of("id","fullName","type","text","format","") + ,Map.of("id","dateOfBirth","type","date","format","yyyy-MM-dd")); + ReflectionTestUtils.setField(authenticationService, "fieldDetailList", fieldDetailList); + ReflectionTestUtils.setField(authenticationService, "fieldLang", "eng"); + ReflectionTestUtils.setField(authenticationService,"objectMapper",new ObjectMapper()); + + KycAuthDto kycAuthDto = new KycAuthDto(); + kycAuthDto.setBiometrics("111111"); + kycAuthDto.setTokens(new ArrayList<>()); + kycAuthDto.setIndividualId("individualId"); + kycAuthDto.setTransactionId("transactionId"); + + IdentityData identityData = new IdentityData(); + identityData.setDateOfBirth("1987/11/25"); + LanguageValue languageValue = new LanguageValue(); + languageValue.setLanguage("eng"); + languageValue.setValue("Siddharth K Mansour"); + identityData.setFullName(List.of(languageValue)); + Mockito.when(identityService.getIdentityV2(Mockito.anyString())).thenReturn(this.identityData); + Mockito.when(authRepository.save(Mockito.any())).thenReturn(new KycAuth()); + + KycAuthResponseDto kycAuthResponseDto = authenticationService.kycAuth("relyingPartyId", "clientId", kycAuthDto); + Assert.assertTrue(kycAuthResponseDto.isAuthStatus()); + } + + @Test + public void kycAuth_withValidPwdChallenge_thenPass() { + + List> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string") + ,Map.of("id","fullName","type","text","format","") + ,Map.of("id","dateOfBirth","type","date","format","yyyy-MM-dd")); + ReflectionTestUtils.setField(authenticationService, "fieldDetailList", fieldDetailList); + ReflectionTestUtils.setField(authenticationService, "fieldLang", "eng"); + ReflectionTestUtils.setField(authenticationService,"objectMapper",new ObjectMapper()); + + KycAuthDto kycAuthDto = new KycAuthDto(); + kycAuthDto.setPassword("Mosip@123"); + kycAuthDto.setIndividualId("individualId"); + kycAuthDto.setTransactionId("transactionId"); + + IdentityData identityData = new IdentityData(); + identityData.setDateOfBirth("1987/11/25"); + identityData.setPassword("Mosip@123"); + LanguageValue languageValue = new LanguageValue(); + languageValue.setLanguage("eng"); + languageValue.setValue("Siddharth K Mansour"); + identityData.setFullName(List.of(languageValue)); + Mockito.when(identityService.getIdentityV2(Mockito.anyString())).thenReturn(this.identityData); + + KycAuthResponseDto kycAuthResponseDto = authenticationService.kycAuth("relyingPartyId", "clientId", kycAuthDto); + Assert.assertNotNull(kycAuthResponseDto); + } + @Test public void kycAuth_withValidKbiChallengeCustomPSUTfield_thenPass() { List> fieldDetailList = List.of(Map.of("id","individualId","type","text","format","string") @@ -195,6 +389,31 @@ public void kycAuth_withInValidKbiChallenge_thenFail() { } } + @Test + public void kycAuth_withEmptyKbiChallenge_thenFail() { + + ReflectionTestUtils.setField(authenticationService, "fieldLang", "eng"); + ReflectionTestUtils.setField(authenticationService,"objectMapper",new ObjectMapper()); + + KycAuthDto kycAuthDto = new KycAuthDto(); + kycAuthDto.setKbi("xsTmFtZSI6IlNpZG0aCBLIiwiZG9iIjoiMTk4Ny0xMS0yNSJ9"); + kycAuthDto.setIndividualId("individualId"); + kycAuthDto.setTransactionId("transactionId"); + + IdentityData identityData = new IdentityData(); + identityData.setDateOfBirth("1987/11/25"); + LanguageValue languageValue = new LanguageValue(); + languageValue.setLanguage("eng"); + languageValue.setValue("Siddharth K Mansour"); + identityData.setFullName(List.of(languageValue)); + Mockito.when(identityService.getIdentityV2(Mockito.anyString())).thenReturn(this.identityData); + try{ + authenticationService.kycAuth("relyingPartyId", "clientId", kycAuthDto); + }catch (MockIdentityException e){ + Assert.assertEquals("auth-failed",e.getMessage()); + } + } + @Test public void sendOtp_validIndividualIdAndOtpChannels_thenPass() throws MockIdentityException { ReflectionTestUtils.setField(authenticationService,"otpChannels",Arrays.asList("email","phone")); @@ -622,6 +841,116 @@ public void kycExchangeV2_withInValidIndividualId_thenFail() throws InvocationTa } } + @Test + public void kycExchangeV2_withDetailAndMatchedClaims_thenPass() { + Map oidcClaimsMap = new HashMap<>(); + oidcClaimsMap.put("name", "name"); + oidcClaimsMap.put("email", "email"); + oidcClaimsMap.put("phone", "phone"); + oidcClaimsMap.put("gender", "gender"); + oidcClaimsMap.put("dateOfBirth", "birthdate"); + oidcClaimsMap.put("encodedPhoto", "picture"); + ReflectionTestUtils.setField(authenticationService, "oidcClaimsMapping", oidcClaimsMap); + ReflectionTestUtils.setField(authenticationService, "objectMapper", new ObjectMapper()); + + // Create an IdentityData object + IdentityData identityData = new IdentityData(); + identityData.setDateOfBirth("1987/11/25"); + LanguageValue languageValueName = new LanguageValue(); + languageValueName.setLanguage("eng"); + languageValueName.setValue("Siddharth K Mansour"); + identityData.setName(List.of(languageValueName)); + + // Convert IdentityData to JsonNode + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode identityDataJsonNode = objectMapper.valueToTree(identityData); + + KycExchangeDto kycExchangeRequestDtoV2 = new KycExchangeDto(); + kycExchangeRequestDtoV2.setIndividualId("individualId"); + kycExchangeRequestDtoV2.setTransactionId("transactionId"); + + Map acceptedClaims = new HashMap<>(); + + ObjectNode birthdate = objectMapper.createObjectNode(); + birthdate.put("essential", true); + acceptedClaims.put("birthdate", birthdate); + + ObjectNode gender = objectMapper.createObjectNode(); + gender.put("essential", false); + acceptedClaims.put("gender", gender); + + // Create a list for verified claims + ArrayNode verifiedClaimsList = objectMapper.createArrayNode(); + + // First verified claim with matching trust framework + ObjectNode verifiedClaim1 = objectMapper.createObjectNode(); + ObjectNode verification1 = objectMapper.createObjectNode(); + verification1.put("trust_framework", "pwd"); + verifiedClaim1.put("verification", verification1); + + ObjectNode claims1 = objectMapper.createObjectNode(); + claims1.put("email", NullNode.getInstance()); + claims1.put("birthdate", NullNode.getInstance()); + verifiedClaim1.put("claims", claims1); + verifiedClaimsList.add(verifiedClaim1); + + // Set up the second verified claim that should not match + ObjectNode verifiedClaim2 = objectMapper.createObjectNode(); + ObjectNode verification2 = objectMapper.createObjectNode(); + verification2.put("trust_framework", "non_matching"); + verifiedClaim2.put("verification", verification2); + + ObjectNode claims2 = objectMapper.createObjectNode(); + claims2.put("name", NullNode.getInstance()); + claims2.put("email", NullNode.getInstance()); + claims2.put("gender", NullNode.getInstance()); + verifiedClaim2.put("claims", claims2); + verifiedClaimsList.add(verifiedClaim2); + + // Add the list of verified claims to the outer map + acceptedClaims.put("verified_claims", verifiedClaimsList); + kycExchangeRequestDtoV2.setAcceptedClaimDetail(acceptedClaims); + kycExchangeRequestDtoV2.setClaimLocales(List.of("eng")); + kycExchangeRequestDtoV2.setRequestDateTime(LocalDateTime.now()); + + KycAuth kycAuth = new KycAuth(); + kycAuth.setKycToken("kycToken"); + kycAuth.setTransactionId("transactionId"); + kycAuth.setIndividualId("individualId"); + kycAuth.setPartnerSpecificUserToken("partnerSpecificUserToken"); + kycAuth.setResponseTime(LocalDateTime.now()); + Optional kycAuthOptional = Optional.of(kycAuth); + Mockito.when(authRepository.findByKycTokenAndValidityAndTransactionIdAndIndividualId(Mockito.any(), + Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(kycAuthOptional); + Mockito.when(authRepository.save(Mockito.any())).thenReturn(new KycAuth()); + + // Mock the identityService to return JsonNode + Mockito.when(identityService.getIdentityV2(Mockito.anyString())).thenReturn(identityDataJsonNode); + + VerifiedClaim verifiedClaim = new VerifiedClaim(); + verifiedClaim.setTrustFramework("pwd"); + verifiedClaim.setClaim("email"); + + VerifiedClaim verifiedClaim4 = new VerifiedClaim(); + verifiedClaim4.setTrustFramework("pwd"); + verifiedClaim4.setClaim("birthdate"); + + List verifiedClaimList = new ArrayList<>(); + verifiedClaimList.add(verifiedClaim); + verifiedClaimList.add(verifiedClaim4); + Optional> verifiedClaimsOptional = Optional.of(verifiedClaimList); + + Mockito.when(verifiedClaimRepository.findByIndividualIdAndClaimAndIsActive(Mockito.anyString(), Mockito.anyString(), Mockito.anyBoolean())) + .thenReturn(verifiedClaimsOptional); + + JWTSignatureResponseDto jwtSignatureResponseDto = new JWTSignatureResponseDto(); + jwtSignatureResponseDto.setJwtSignedData("jwtSignedData"); + Mockito.when(signatureService.jwtSign(Mockito.any())).thenReturn(jwtSignatureResponseDto); + + KycExchangeResponseDto kycExchangeResponseDto = authenticationService.kycExchange("relyingPartyId", "clientId", kycExchangeRequestDtoV2); + Assert.assertEquals("jwtSignedData", kycExchangeResponseDto.getKyc()); + } + @Test public void kycExchangeV2_withOutVerifiedClaims_thenPass() throws InvocationTargetException, IllegalAccessException, NoSuchMethodException { Map oidcClaimsMap=new HashMap<>(); diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/IdentityServiceTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/IdentityServiceTest.java index 48200ecd..92cdf8e1 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/IdentityServiceTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/IdentityServiceTest.java @@ -87,6 +87,63 @@ public void addVerifiedClaim_withValidDetails_thenPass() { identityService.addVerifiedClaim(verifiedClaimRequestDto); } + @Test + public void addVerifiedClaim_withInvalidClaim_thenFail() { + + VerifiedClaimRequestDto verifiedClaimRequestDto = new VerifiedClaimRequestDto(); + verifiedClaimRequestDto.setActive(true); + verifiedClaimRequestDto.setIndividualId("123456"); + Map verificationDetail = new HashMap<>(); + + ObjectNode emailVerification = objectMapper.createObjectNode(); + emailVerification.put("trust_framework", "trust_framework"); + verificationDetail.put("null", emailVerification); + verifiedClaimRequestDto.setVerificationDetail(verificationDetail); + + IdentityData identityData = new IdentityData(); + identityData.setEmail("email@gmail.com"); + identityData.setEncodedPhoto("encodedPhoto"); + + MockIdentity mockIdentity = new MockIdentity(); + mockIdentity.setIndividualId("123456"); + mockIdentity.setIdentityJson("{\"individualId\":\"8267411571\",\"pin\":\"111111\",\"fullName\":[{\"language\":\"fra\",\"value\":\"Siddharth K Mansour\"},{\"language\":\"ara\",\"value\":\"تتگلدكنسَزقهِقِفل دسييسيكدكنوڤو\"},{\"language\":\"eng\",\"value\":\"Siddharth K Mansour\"}],\"email\":\"siddhartha.km@gmail.com\",\"phone\":\"+919427357934\"}"); + Mockito.when(identityRepository.findById(Mockito.anyString())).thenReturn(Optional.of(mockIdentity)); + try{ + identityService.addVerifiedClaim(verifiedClaimRequestDto); + }catch (MockIdentityException e){ + Assert.assertEquals(ErrorConstants.INVALID_CLAIM,e.getErrorCode()); + } + } + + @Test + public void addVerifiedClaim_withInvalidTrustFramework_thenFail() { + + VerifiedClaimRequestDto verifiedClaimRequestDto = new VerifiedClaimRequestDto(); + verifiedClaimRequestDto.setActive(true); + verifiedClaimRequestDto.setIndividualId("123456"); + Map verificationDetail = new HashMap<>(); + + ObjectNode emailVerification = objectMapper.createObjectNode(); + emailVerification.put("trust_framework", " "); + verificationDetail.put("email", emailVerification); + verifiedClaimRequestDto.setVerificationDetail(verificationDetail); + + IdentityData identityData = new IdentityData(); + identityData.setEmail("email@gmail.com"); + identityData.setEncodedPhoto("encodedPhoto"); + + MockIdentity mockIdentity = new MockIdentity(); + mockIdentity.setIndividualId("123456"); + mockIdentity.setIdentityJson("{\"individualId\":\"8267411571\",\"pin\":\"111111\",\"fullName\":[{\"language\":\"fra\",\"value\":\"Siddharth K Mansour\"},{\"language\":\"ara\",\"value\":\"تتگلدكنسَزقهِقِفل دسييسيكدكنوڤو\"},{\"language\":\"eng\",\"value\":\"Siddharth K Mansour\"}],\"email\":\"siddhartha.km@gmail.com\",\"phone\":\"+919427357934\"}"); + Mockito.when(verifiedClaimRepository.findById(Mockito.anyString())).thenReturn(Optional.empty()); + Mockito.when(identityRepository.findById(Mockito.anyString())).thenReturn(Optional.of(mockIdentity)); + try{ + identityService.addVerifiedClaim(verifiedClaimRequestDto); + }catch (MockIdentityException e){ + Assert.assertEquals(ErrorConstants.INVALID_REQUEST,e.getErrorCode()); + } + } + @Test public void addVerifiedClaim_withInValidIndividualId_thenFail() { VerifiedClaimRequestDto verifiedClaimRequestDto = new VerifiedClaimRequestDto(); @@ -148,6 +205,23 @@ public void getIdentity_withValidDetails_thenPass() throws MockIdentityException assertEquals(identityData.getIndividualId(), result.getIndividualId()); } + @Test + public void getIdentity_withInValidIdentityJson_thenFail() throws MockIdentityException, JsonProcessingException { + IdentityData identityData = new IdentityData(); + identityData.setEmail("email@gmail.com"); + identityData.setEncodedPhoto("encodedPhoto"); + MockIdentity mockIdentity = new MockIdentity(); + mockIdentity.setIndividualId("123456"); + mockIdentity.setIdentityJson("{ \\\"name\\\": \\\"John Doe, \\\"age\\\": 30 }"); + when(identityRepository.findById(identityData.getIndividualId())).thenReturn(Optional.of(mockIdentity)); + try { + identityService.getIdentity(identityData.getIndividualId()); + Assert.fail(); + }catch (MockIdentityException e){ + Assert.assertEquals(ErrorConstants.JSON_PROCESSING_ERROR,e.getErrorCode()); + } + } + @Test public void getIdentity_withInvalidId_thenFail() { IdentityData identityData = new IdentityData(); @@ -173,6 +247,23 @@ public void updateIdentity_withExistingIndividualId_thenPass() { Assert.assertNotNull(mockIdentity.getIdentityJson()); } + @Test + public void updateIdentity_withInvalidIdentityJson_thenFail() { + IdentityData identityData = new IdentityData(); + identityData.setIndividualId("existing-id"); + identityData.setPassword("new-password"); + MockIdentity mockIdentity = new MockIdentity(); + mockIdentity.setIndividualId("existing-id"); + mockIdentity.setIdentityJson("{ \\\"name\\\": \\\"John Doe, \\\"age\\\": 30 }"); + when(identityRepository.findById("existing-id")).thenReturn(Optional.of(mockIdentity)); + try { + identityService.updateIdentity(identityData); + Assert.fail(); + }catch (MockIdentityException e){ + Assert.assertEquals(ErrorConstants.JSON_PROCESSING_ERROR,e.getErrorCode()); + } + } + @Test public void updateIdentity_withNonExistingIndividualId_thenFail() { IdentityData identityData = new IdentityData(); From 4c13490acffd5c25399ba249f7196c3e165b31a1 Mon Sep 17 00:00:00 2001 From: Chandra Keshav Mishra Date: Tue, 15 Oct 2024 23:36:57 +0530 Subject: [PATCH 11/30] Release 0.10.x (#275) * ES-842 corrected the verified claims logi (#249) Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * modified getLanguageValuesList method (#250) Signed-off-by: Mohd Kaif Siddique Co-authored-by: Mohd Kaif Siddique Signed-off-by: Chandra Keshav Mishra * [ES-1678] Added a new error message for the ekyc failure in i18n. Signed-off-by: GurukiranP Signed-off-by: Chandra Keshav Mishra * Updated readme and docker compose Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] removed deployment script and updated chart Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] corrected chart lint yaml Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] moved deployment scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updarted chart values for latest changes to remove artifactory and config server dependency Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] moved db-init scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated db-init scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-identity-system scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-relying-party-service scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-relying-party-ui scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added install-all.sh, delete-all.sh, restart-all.sh scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updated installation scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updated README and installation scripts comments Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added changes for partner onboarder to store reports in volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] removed unused secret creation Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [INJICERT-434] optionally support using arbitrary field as PSUT value (#258) * [INJICERT-434] optionally support using individualID as PSUT Purpose: to break Certify <--> Mock DataProviderPlugin dependency wrt OIDCTransaction object stored in Redis Config changes required: * Introduces a config but does not break existing default behaviour, so no explicit change required Signed-off-by: Harsh Vardhan * [INJICERT-434] allow PSUT to set to any configured field * by default the kycAuth response will have the psut field, but this can be configured to have some other user data in the clear if required Breaking changes: None. The changes are backwards compatible Signed-off-by: Harsh Vardhan --------- Signed-off-by: Harsh Vardhan Signed-off-by: Chandra Keshav Mishra * [ES-1689] added test case (#259) Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: Chandra Keshav Mishra * moved tomcat and prometheus configuration to bootstrap.properties Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35987] updated onboarder to support storing reports in nfs volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * Updated Readme and pom version Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] added prompt to install services Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] removed unused clusterRolebinding Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated changes to fix dev testing issues Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated correct onboarder chart version (#272) Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * Added JsonIgnoreProperties for kyc auth and exchange requests (#269) Signed-off-by: piyush-shukla03_infosys Co-authored-by: piyush-shukla03_infosys Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated partner onboarder install script Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * resolved lint failures (#277) Signed-off-by: Chandra Keshav Mishra --------- Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Mohd Kaif Siddique Signed-off-by: GurukiranP Signed-off-by: ckm007 Signed-off-by: Harsh Vardhan Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: piyush-shukla03_infosys Co-authored-by: ase-101 Co-authored-by: Kaif Siddique <74772315+kaifk468@users.noreply.github.com> Co-authored-by: Mohd Kaif Siddique Co-authored-by: GurukiranP Co-authored-by: Harsh Vardhan Co-authored-by: pvsaidurga <132046494+pvsaidurga@users.noreply.github.com> Co-authored-by: Piyush7034 <47858366+Piyush7034@users.noreply.github.com> Co-authored-by: piyush-shukla03_infosys Signed-off-by: kaifk468 --- README.md | 7 +-- deploy/delete-mock.sh | 38 ++++++++------ deploy/mock-identity-system/install.sh | 2 +- deploy/mock-relying-party-service/install.sh | 36 +++++++++---- deploy/mock-relying-party-ui/install.sh | 44 ++++++++++------ deploy/prereq.sh | 11 ++-- helm/mock-identity-system/.gitignore | 2 + helm/mock-identity-system/Chart.yaml | 2 +- .../templates/clusterrolebinding.yaml | 19 ------- helm/mock-identity-system/values.yaml | 2 +- helm/mock-relying-party-service/.gitignore | 2 + helm/mock-relying-party-service/Chart.yaml | 2 +- .../templates/clusterrolebinding.yaml | 19 ------- helm/mock-relying-party-service/values.yaml | 4 +- helm/mock-relying-party-ui/.gitignore | 2 + helm/mock-relying-party-ui/Chart.yaml | 2 +- .../templates/clusterrolebinding.yaml | 19 ------- helm/mock-relying-party-ui/values.yaml | 4 +- partner-onboarder/install.sh | 18 +++---- partner-onboarder/values.yaml | 52 +++++++------------ 20 files changed, 129 insertions(+), 158 deletions(-) create mode 100644 helm/mock-identity-system/.gitignore delete mode 100644 helm/mock-identity-system/templates/clusterrolebinding.yaml create mode 100644 helm/mock-relying-party-service/.gitignore delete mode 100644 helm/mock-relying-party-service/templates/clusterrolebinding.yaml create mode 100644 helm/mock-relying-party-ui/.gitignore delete mode 100644 helm/mock-relying-party-ui/templates/clusterrolebinding.yaml diff --git a/README.md b/README.md index ad97f42a..b12141cb 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ Repository contains mock implementations for eSignet. Only for non-production us |[Postgres Init](https://github.com/mosip/mosip-infra/tree/v1.2.0.1-B3/deployment/v3/external/postgres) | 12.0.1-B3 | |[mock-identity-softhsm](https://github.com/mosip/esignet/blob/v1.0.0/helm/install-all.sh) | 12.0.1-B2 | -### Install Pe-req for mock identity service + +### Install Pe-req for mock services * Install `kubectl` and `helm` utilities. * Run `prereq.sh` to setup below mentioned pre-requisites for mock services. * Setup softhsm for mock-identity in `Softhsm` namespace. @@ -57,7 +58,7 @@ Repository contains mock implementations for eSignet. Only for non-production us ``` ## Partner onboarder -* Perform Partner onboarding for esignet mock using [steps](partner-onboarder/README.md). +* Perform Partner onboarding for esignet mock relying party using [steps](partner-onboarder/README.md) only if mosip-identity plugin is used. ## License -This project is licensed under the terms of [Mozilla Public License 2.0](LICENSE). \ No newline at end of file +This project is licensed under the terms of [Mozilla Public License 2.0](LICENSE). diff --git a/deploy/delete-mock.sh b/deploy/delete-mock.sh index 6efa9455..e76ca9e6 100755 --- a/deploy/delete-mock.sh +++ b/deploy/delete-mock.sh @@ -1,26 +1,29 @@ #!/bin/bash -# Uninstalls esignet mock services. -## Usage: ./delete.sh [kubeconfig] +# Uninstalls all esignet mock service helm charts +## Usage: ./delete-mock.sh [kubeconfig] if [ $# -ge 1 ] ; then export KUBECONFIG=$1 fi -Deleting_All() { - MOCK_NS=mockid - NS=esignet - while true; do - read -p "Are you sure you want to delete esignet mock service helm charts?(Y/n) " yn - if [[ $yn = "Y" ]] || [[ $yn = "y" ]]; - then - helm -n $NS delete mock-relying-party-service || true - helm -n $NS delete mock-relying-party-ui || true - helm -n $MOCK_NS delete mock-identity-system || true - break - else - break - fi +ROOT_DIR=`pwd` + +function deleting_mock() { + + declare -a module=("mock-identity-system" + "mock-relying-party-service" + "mock-relying-party-ui" + ) + + echo Installing esignet mock services + + for i in "${module[@]}" + do + cd $ROOT_DIR/"$i" + ./delete.sh done + + echo All esignet mock services deleted sucessfully. return 0 } @@ -30,4 +33,5 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true set -o nounset ## set -u : exit the script if you try to use an uninitialised variable set -o errtrace # trace ERR through 'time command' and other functions set -o pipefail # trace ERR through pipes -Deleting_All # calling function +deleting_mock # calling function + diff --git a/deploy/mock-identity-system/install.sh b/deploy/mock-identity-system/install.sh index 89b97069..8fa29595 100755 --- a/deploy/mock-identity-system/install.sh +++ b/deploy/mock-identity-system/install.sh @@ -7,7 +7,7 @@ if [ $# -ge 1 ] ; then fi NS=mockid -CHART_VERSION=0.0.1-develop +CHART_VERSION=0.10.0-develop echo Create $NS namespace kubectl create ns $NS diff --git a/deploy/mock-relying-party-service/install.sh b/deploy/mock-relying-party-service/install.sh index d92ae4ef..9cd73a9b 100755 --- a/deploy/mock-relying-party-service/install.sh +++ b/deploy/mock-relying-party-service/install.sh @@ -6,13 +6,28 @@ if [ $# -ge 1 ] ; then export KUBECONFIG=$1 fi -NS=esignet -CHART_VERSION=0.0.1-develop +function installing_mock-relying-party-service() { -echo Create $NS namespace -kubectl create ns $NS + while true; do + read -p "Do you want to install mock relying party service? (y/n): " response + if [[ "$response" == "y" || "$response" == "Y" ]]; then + break + elif [[ "$response" == "n" || "$response" == "N" ]]; then + exit + else + echo "Not a correct response. Please respond with y (yes) or n (no)." + fi + done + + helm repo add mosip https://mosip.github.io/mosip-helm + helm repo update + + NS=esignet + CHART_VERSION=0.10.0-develop + + echo Create $NS namespace + kubectl create ns $NS || true -function installing_mock-relying-party-service() { echo Istio label kubectl label ns $NS istio-injection=enabled --overwrite @@ -36,12 +51,11 @@ function installing_mock-relying-party-service() { ESIGNET_SERVICE_URL=${USER_PROVIDED_ESIGNET_SERVICE_URL:-$DEFAULT_ESIGNET_SERVICE_URL} echo Installing Mock Relying Party Service -# helm -n $NS install mock-relying-party-service mosip/mock-relying-party-service \ - helm -n $NS install mock-relying-party-service ../../helm/mock-relying-party-service/ \ - --set mock_relying_party_service.ESIGNET_SERVICE_URL="$ESIGNET_SERVICE_URL" \ - --set mock_relying_party_service.ESIGNET_AUD_URL="https://$ESIGNET_HOST/v1/esignet/oauth/v2/token" \ - --version $CHART_VERSION $ENABLE_INSECURE \ - -f values.yaml --wait + helm -n $NS install mock-relying-party-service mosip/mock-relying-party-service \ + --set mock_relying_party_service.ESIGNET_SERVICE_URL="$ESIGNET_SERVICE_URL" \ + --set mock_relying_party_service.ESIGNET_AUD_URL="https://$ESIGNET_HOST/v1/esignet/oauth/v2/token" \ + --version $CHART_VERSION $ENABLE_INSECURE \ + -f values.yaml --wait kubectl -n $NS get deploy mock-relying-party-service -o name | xargs -n1 -t kubectl -n $NS rollout status diff --git a/deploy/mock-relying-party-ui/install.sh b/deploy/mock-relying-party-ui/install.sh index 10a00b25..b9c3d8a0 100755 --- a/deploy/mock-relying-party-ui/install.sh +++ b/deploy/mock-relying-party-ui/install.sh @@ -6,26 +6,40 @@ if [ $# -ge 1 ] ; then export KUBECONFIG=$1 fi -NS=esignet -CHART_VERSION=0.0.1-develop +function installing_mock-relying-party-ui() { -read -p "Please provide mock relying party ui domain (eg: healthservices.sandbox.xyz.net ) : " MOCK_UI_HOST + while true; do + read -p "Do you want to install mock relying party ui? (y/n): " response + if [[ "$response" == "y" || "$response" == "Y" ]]; then + break + elif [[ "$response" == "n" || "$response" == "N" ]]; then + exit + else + echo "Not a correct response. Please respond with y (yes) or n (no)." + fi + done -if [ -z "$MOCK_UI_HOST" ]; then - echo "Mock relying party UI Host not provided; EXITING;" - exit 0; -fi + helm repo add mosip https://mosip.github.io/mosip-helm + helm repo update -CHK_MOCK_UI_HOST=$( nslookup "$MOCK_UI_HOST" ) -if [ $? -gt 0 ]; then - echo "Mock relying party UI Host does not exists; EXITING;" - exit 0; -fi + NS=esignet + CHART_VERSION=0.10.0-develop -echo Create $NS namespace -kubectl create ns $NS + read -p "Please provide mock relying party ui domain (eg: healthservices.sandbox.xyz.net ) : " MOCK_UI_HOST + if [ -z "$MOCK_UI_HOST" ]; then + echo "Mock relying party UI Host not provided; EXITING;" + exit 1; + fi + + CHK_MOCK_UI_HOST=$( nslookup "$MOCK_UI_HOST" ) + if [ $? -gt 0 ]; then + echo "Mock relying party UI Host does not exists; EXITING;" + exit 1; + fi + + echo Create $NS namespace + kubectl create ns $NS || true -function installing_mock-relying-party-ui() { echo Istio label kubectl label ns $NS istio-injection=enabled --overwrite diff --git a/deploy/prereq.sh b/deploy/prereq.sh index db8be9d9..d041cf53 100755 --- a/deploy/prereq.sh +++ b/deploy/prereq.sh @@ -8,9 +8,12 @@ fi ROOT_DIR=`pwd` NS=mockid +ESIGNET_NS=esignet SOFTHSM_NS=softhsm SOFTHSM_CHART_VERSION=12.0.1 +kubectl create ns $NS || true +kubectl create ns $ESIGNET_NS || true function prereq_mockid () { echo Create $SOFTHSM_NS namespace @@ -38,10 +41,10 @@ function prereq_mockid () { function prereq_mockrp () { echo "Create secret for mock-relying-party-service-secrets and jwe-userinfo-private-key delete if exists" - kubectl -n $NS delete --ignore-not-found=true secrets mock-relying-party-private-key-jwk - kubectl -n $NS delete --ignore-not-found=true secrets jwe-userinfo-service-secrets - kubectl -n $NS create secret generic mock-relying-party-private-key-jwk --from-literal=client-private-key='' --dry-run=client -o yaml | kubectl apply -f - - kubectl -n $NS create secret generic jwe-userinfo-service-secrets --from-literal=JWE_USERINFO_PRIVATE_KEY='' --dry-run=client -o yaml | kubectl apply -f - + kubectl -n $ESIGNET_NS delete --ignore-not-found=true secrets mock-relying-party-private-key-jwk + kubectl -n $ESIGNET_NS delete --ignore-not-found=true secrets jwe-userinfo-service-secrets + kubectl -n $ESIGNET_NS create secret generic mock-relying-party-private-key-jwk --from-literal=client-private-key='' --dry-run=client -o yaml | kubectl apply -f - + kubectl -n $ESIGNET_NS create secret generic jwe-userinfo-service-secrets --from-literal=jwe-userinfo-private-key='' --dry-run=client -o yaml | kubectl apply -f - return 0 } diff --git a/helm/mock-identity-system/.gitignore b/helm/mock-identity-system/.gitignore new file mode 100644 index 00000000..f791801b --- /dev/null +++ b/helm/mock-identity-system/.gitignore @@ -0,0 +1,2 @@ +charts/ +Chart.lock diff --git a/helm/mock-identity-system/Chart.yaml b/helm/mock-identity-system/Chart.yaml index d47d986b..c79399fa 100644 --- a/helm/mock-identity-system/Chart.yaml +++ b/helm/mock-identity-system/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: mock-identity-system description: A Helm chart for MOSIP mock-identity-system module type: application -version: 0.0.1-develop +version: 0.10.0-develop appVersion: "" dependencies: - name: common diff --git a/helm/mock-identity-system/templates/clusterrolebinding.yaml b/helm/mock-identity-system/templates/clusterrolebinding.yaml deleted file mode 100644 index 081db147..00000000 --- a/helm/mock-identity-system/templates/clusterrolebinding.yaml +++ /dev/null @@ -1,19 +0,0 @@ -kind: ClusterRoleBinding -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ template "common.names.fullname" . }} -subjects: - - kind: ServiceAccount - name: {{ template "mock-identity-system.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} diff --git a/helm/mock-identity-system/values.yaml b/helm/mock-identity-system/values.yaml index dcfa02e8..60bf67a8 100644 --- a/helm/mock-identity-system/values.yaml +++ b/helm/mock-identity-system/values.yaml @@ -53,7 +53,7 @@ service: image: registry: docker.io repository: mosipdev/mock-identity-system - tag: develop + tag: release-0.10.x ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/helm/mock-relying-party-service/.gitignore b/helm/mock-relying-party-service/.gitignore new file mode 100644 index 00000000..e508fa59 --- /dev/null +++ b/helm/mock-relying-party-service/.gitignore @@ -0,0 +1,2 @@ +chart/ +Chart.lock diff --git a/helm/mock-relying-party-service/Chart.yaml b/helm/mock-relying-party-service/Chart.yaml index e2916f43..a98b9d45 100644 --- a/helm/mock-relying-party-service/Chart.yaml +++ b/helm/mock-relying-party-service/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: mock-relying-party-service description: A Helm chart to file server application. type: application -version: 0.0.1-develop +version: 0.10.0-develop appVersion: "" dependencies: - name: common diff --git a/helm/mock-relying-party-service/templates/clusterrolebinding.yaml b/helm/mock-relying-party-service/templates/clusterrolebinding.yaml deleted file mode 100644 index ae9894a7..00000000 --- a/helm/mock-relying-party-service/templates/clusterrolebinding.yaml +++ /dev/null @@ -1,19 +0,0 @@ -kind: ClusterRoleBinding -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ template "common.names.fullname" . }} -subjects: - - kind: ServiceAccount - name: {{ template "mock-relying-party-service.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} diff --git a/helm/mock-relying-party-service/values.yaml b/helm/mock-relying-party-service/values.yaml index 5aadfe42..11efd837 100644 --- a/helm/mock-relying-party-service/values.yaml +++ b/helm/mock-relying-party-service/values.yaml @@ -51,8 +51,8 @@ service: image: registry: docker.io - repository: mosipqa/mock-relying-party-service - tag: develop + repository: mosipdev/mock-relying-party-service + tag: release-0.10.x ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/helm/mock-relying-party-ui/.gitignore b/helm/mock-relying-party-ui/.gitignore new file mode 100644 index 00000000..f791801b --- /dev/null +++ b/helm/mock-relying-party-ui/.gitignore @@ -0,0 +1,2 @@ +charts/ +Chart.lock diff --git a/helm/mock-relying-party-ui/Chart.yaml b/helm/mock-relying-party-ui/Chart.yaml index b7ba0e64..d1abca12 100644 --- a/helm/mock-relying-party-ui/Chart.yaml +++ b/helm/mock-relying-party-ui/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: mock-relying-party-ui description: A Helm chart for MOSIP OIDC UI module type: application -version: 0.0.1-develop +version: 0.10.0-develop appVersion: "" dependencies: - name: common diff --git a/helm/mock-relying-party-ui/templates/clusterrolebinding.yaml b/helm/mock-relying-party-ui/templates/clusterrolebinding.yaml deleted file mode 100644 index 4bb16d41..00000000 --- a/helm/mock-relying-party-ui/templates/clusterrolebinding.yaml +++ /dev/null @@ -1,19 +0,0 @@ -kind: ClusterRoleBinding -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ template "common.names.fullname" . }} -subjects: - - kind: ServiceAccount - name: {{ template "mock-relying-party-ui.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} diff --git a/helm/mock-relying-party-ui/values.yaml b/helm/mock-relying-party-ui/values.yaml index 308bf802..6d0e6289 100644 --- a/helm/mock-relying-party-ui/values.yaml +++ b/helm/mock-relying-party-ui/values.yaml @@ -51,8 +51,8 @@ service: image: registry: docker.io - repository: mosipqa/mock-relying-party-ui - tag: develop + repository: mosipdev/mock-relying-party-ui + tag: release-0.10.x ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' diff --git a/partner-onboarder/install.sh b/partner-onboarder/install.sh index bb8953b4..604d8eb7 100755 --- a/partner-onboarder/install.sh +++ b/partner-onboarder/install.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Onboards mock relying party OIDC helm +# Installs mock relying party onboarder OIDC helm ## Usage: ./install.sh [kubeconfig] if [ $# -ge 1 ] ; then @@ -21,7 +21,7 @@ if [ "$flag" = "n" ]; then fi NS=esignet -CHART_VERSION=0.0.1-develop +CHART_VERSION=1.5.0-es-develop echo Create $NS namespace kubectl create ns $NS || true @@ -91,7 +91,7 @@ function installing_onboarder() { echo "Istio label" kubectl label ns $NS istio-injection=disabled --overwrite -# helm repo update + helm repo update echo "Copy configmaps" COPY_UTIL=../deploy/copy_cm_func.sh @@ -101,12 +101,8 @@ function installing_onboarder() { $COPY_UTIL secret keycloak keycloak $NS $COPY_UTIL secret keycloak-client-secrets keycloak $NS - echo $NFS_OPTION - echo $S3_OPTION - echo $push_reports_to_s3 - echo "Onboarding Mock Relying Party OIDC client" - helm -n $NS install esignet-mock-rp-onboarder ../../mosip-onboarding/helm/partner-onboarder/ \ + helm -n $NS install esignet-mock-rp-onboarder mosip/partner-onboarder \ $NFS_OPTION \ $S3_OPTION \ --set onboarding.variables.push_reports_to_s3=$push_reports_to_s3 \ @@ -115,8 +111,10 @@ function installing_onboarder() { --set extraEnvVarsCM[2]=keycloak-host \ $ENABLE_INSECURE \ -f values.yaml \ - --debug --wait --wait-for-jobs - echo "Partner onboarded successfully and reports are moved to S3 or NFS" + --version $CHART_VERSION \ + --wait --wait-for-jobs + echo "Partner onboarder executed and reports are moved to S3 or NFS please check the same to make sure partner was onboarded sucessfully." + kubectl rollout restart deployment mock-relying-party-service -n esignet return 0 fi } diff --git a/partner-onboarder/values.yaml b/partner-onboarder/values.yaml index 856a24f2..d1344857 100644 --- a/partner-onboarder/values.yaml +++ b/partner-onboarder/values.yaml @@ -1,38 +1,26 @@ -image: - registry: docker.io - repository: mosipdev/partner-onboarder - tag: MOSIP-35987 +#image: +# registry: docker.io +# repository: mosipdev/partner-onboarder +# tag: MOSIP-35987 onboarding: modules: - - name: ida - enabled: false - - name: print - enabled: false - - name: abis - enabled: false - - name: resident - enabled: false - - name: mobileid - enabled: false - - name: digitalcard - enabled: false - - name: esignet - enabled: false - - name: resident-oidc - enabled: false - name: mock-rp-oidc enabled: true - - name: mimoto-keybinding - enabled: false - - name: mimoto-oidc - enabled: false - - name: signup-oidc - enabled: false - +# configmaps: +# s3: +# s3-host: 'http://minio.minio:9000' +# s3-user-key: 'admin' +# s3-region: '' +# onboarder-namespace: +# ns_mimoto: mimoto +# ns_esignet: esignet +# ns_signup: signup +# secrets: +# s3: +# s3-user-secret: 'password' # volumes: # reports: -# enabled: true # name: onboarder-reports # storageClass: nfs-client # accessModes: @@ -40,9 +28,9 @@ onboarding: # size: 10Mi # existingClaim: # # Dir where config and keys are written inside container -# mountDir: "/home/mosip/reports" +# mountDir: /home/mosip/reports # nfs: -# path: '' # Dir within the nfs server where config repo is cloned/maintained locally. -# server: '' # Ip address of nfs server. +# path: "/srv/nfs/sandbox/onboarding" # Dir within the nfs server where config repo is cloned/maintained locally. +# server: "nfs-server" # Ip address of nfs server. # variables: -# push-reports-to-s3: true +# push_reports_to_s3: true \ No newline at end of file From 2fc5baf4bd28275f44fd66e4b531251dee84396b Mon Sep 17 00:00:00 2001 From: GurukiranP Date: Thu, 24 Oct 2024 10:31:16 +0530 Subject: [PATCH 12/30] [ES-1859] Added a new error code in the i18n. Signed-off-by: GurukiranP Signed-off-by: kaifk468 --- mock-relying-party-ui/public/locales/ar.json | 1 + mock-relying-party-ui/public/locales/en.json | 1 + mock-relying-party-ui/public/locales/hi.json | 1 + mock-relying-party-ui/public/locales/km.json | 1 + mock-relying-party-ui/public/locales/kn.json | 1 + mock-relying-party-ui/public/locales/ta.json | 1 + 6 files changed, 6 insertions(+) diff --git a/mock-relying-party-ui/public/locales/ar.json b/mock-relying-party-ui/public/locales/ar.json index 763a77dc..80557282 100644 --- a/mock-relying-party-ui/public/locales/ar.json +++ b/mock-relying-party-ui/public/locales/ar.json @@ -235,6 +235,7 @@ "consent_request_rejected": "تم رفض طلب الموافقة", "transaction_timeout": "لقد انتهت مهلة المعاملة. حاول مرة اخرى", "consent_rejected": "آسفون! لم يكن تسجيل الدخول الخاص بك ناجحًا نظرًا لعدم مشاركة الموافقة.", + "resume_not_applicable": "آسفون! لم يكن تسجيل الدخول الخاص بك ناجحًا نظرًا لعدم مشاركة الموافقة.", "incompatible_browser": "آسفون! يرجى الترقية إلى أحدث إصدار من المتصفح والمحاولة مرة أخرى.", "ekyc_failed": "نحن متأسفون! تعذر إكمال التحقق من eKYC الخاص بك. يرجى إعادة المحاولة لاحقا." } diff --git a/mock-relying-party-ui/public/locales/en.json b/mock-relying-party-ui/public/locales/en.json index 4b220428..4bf443be 100644 --- a/mock-relying-party-ui/public/locales/en.json +++ b/mock-relying-party-ui/public/locales/en.json @@ -236,6 +236,7 @@ "consent_request_rejected": "Consent Request Rejected", "transaction_timeout": "The transaction has timed out. Please try again", "consent_rejected": "We’re sorry! Your login was unsuccessful as consent was not shared.", + "resume_not_applicable": "We’re sorry! Your login was unsuccessful as consent was not shared.", "incompatible_browser": "We’re sorry! Please upgrade to the latest version of the browser & try again.", "ekyc_failed": "We’re sorry! Your eKYC verification could not be completed. Please try again later." } diff --git a/mock-relying-party-ui/public/locales/hi.json b/mock-relying-party-ui/public/locales/hi.json index bd20640a..0d824ae0 100644 --- a/mock-relying-party-ui/public/locales/hi.json +++ b/mock-relying-party-ui/public/locales/hi.json @@ -234,6 +234,7 @@ "consent_request_rejected": "सहमति अनुरोध अस्वीकृत", "transaction_timeout": "लेन-देन का समय समाप्त हो गया है. कृपया पुन: प्रयास करें", "consent_rejected": "हम क्षमा चाहते हैं! आपका लॉगिन असफल रहा क्योंकि सहमति साझा नहीं की गई थी।", + "resume_not_applicable": "हम क्षमा चाहते हैं! आपका लॉगिन असफल रहा क्योंकि सहमति साझा नहीं की गई थी।", "incompatible_browser": "हम क्षमा चाहते हैं! कृपया ब्राउज़र के नवीनतम संस्करण में अपग्रेड करें और पुनः प्रयास करें।", "ekyc_failed": "हमें खेद है! आपका eKYC सत्यापन पूरा नहीं किया जा सका। कृपया बाद में पुनः प्रयास करें." } diff --git a/mock-relying-party-ui/public/locales/km.json b/mock-relying-party-ui/public/locales/km.json index 98073ff4..bce09f5f 100644 --- a/mock-relying-party-ui/public/locales/km.json +++ b/mock-relying-party-ui/public/locales/km.json @@ -236,6 +236,7 @@ "consent_request_rejected": "សំណើការយល់ព្រមត្រូវបានបដិសេធ", "transaction_timeout": "ប្រតិបត្តិការបានអស់ពេលហើយ។ សូម​ព្យាយាម​ម្តង​ទៀត", "consent_rejected": "យើង​សុំទោស! ការចូលរបស់អ្នកមិនបានជោគជ័យទេ ដោយសារការយល់ព្រមមិនត្រូវបានចែករំលែក។", + "resume_not_applicable": "យើង​សុំទោស! ការចូលរបស់អ្នកមិនបានជោគជ័យទេ ដោយសារការយល់ព្រមមិនត្រូវបានចែករំលែក។", "incompatible_browser": "យើង​សុំទោស! សូមដំឡើងកំណែទៅកំណែចុងក្រោយបំផុតនៃកម្មវិធីរុករកតាមអ៊ីនធឺណិត ហើយព្យាយាមម្តងទៀត។", "ekyc_failed": "យើង​សុំទោស! ការផ្ទៀងផ្ទាត់ eKYC របស់អ្នកមិនអាចបញ្ចប់បានទេ។ សូមព្យាយាមម្តងទៀតនៅពេលក្រោយ។" } diff --git a/mock-relying-party-ui/public/locales/kn.json b/mock-relying-party-ui/public/locales/kn.json index beaf0078..71f2ab65 100644 --- a/mock-relying-party-ui/public/locales/kn.json +++ b/mock-relying-party-ui/public/locales/kn.json @@ -234,6 +234,7 @@ "consent_request_rejected": "ಸಮ್ಮತಿ ವಿನಂತಿಯನ್ನು ತಿರಸ್ಕರಿಸಲಾಗಿದೆ", "transaction_timeout": "ವಹಿವಾಟಿನ ಅವಧಿ ಮೀರಿದೆ. ದಯವಿಟ್ಟು ಪುನಃ ಪ್ರಯತ್ನಿಸಿ", "consent_rejected": "ನಮ್ಮನ್ನು ಕ್ಷಮಿಸಿ! ಸಮ್ಮತಿಯನ್ನು ಹಂಚಿಕೊಳ್ಳದ ಕಾರಣ ನಿಮ್ಮ ಲಾಗಿನ್ ವಿಫಲವಾಗಿದೆ.", + "resume_not_applicable": "ನಮ್ಮನ್ನು ಕ್ಷಮಿಸಿ! ಸಮ್ಮತಿಯನ್ನು ಹಂಚಿಕೊಳ್ಳದ ಕಾರಣ ನಿಮ್ಮ ಲಾಗಿನ್ ವಿಫಲವಾಗಿದೆ.", "incompatible_browser": "ನಮ್ಮನ್ನು ಕ್ಷಮಿಸಿ! ದಯವಿಟ್ಟು ಬ್ರೌಸರ್‌ನ ಇತ್ತೀಚಿನ ಆವೃತ್ತಿಗೆ ಅಪ್‌ಗ್ರೇಡ್ ಮಾಡಿ ಮತ್ತು ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ.", "ekyc_failed": "ಕ್ಷಮಿಸಿ! ನಿಮ್ಮ ಇಕೆವೈಸಿ ಪರಿಶೀಲನೆಯನ್ನು ಪೂರ್ಣಗೊಳಿಸಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ. ದಯವಿಟ್ಟು ನಂತರ ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ." } diff --git a/mock-relying-party-ui/public/locales/ta.json b/mock-relying-party-ui/public/locales/ta.json index 397297b0..555e18f5 100644 --- a/mock-relying-party-ui/public/locales/ta.json +++ b/mock-relying-party-ui/public/locales/ta.json @@ -234,6 +234,7 @@ "consent_request_rejected": "ஒப்புதல் கோரிக்கை நிராகரிக்கப்பட்டது", "transaction_timeout": "பரிவர்த்தனை நேரம் முடிந்தது. தயவு செய்து மீண்டும் முயற்சிக்கவும்", "consent_rejected": "நாங்கள் வருந்துகிறோம்! ஒப்புதல் பகிரப்படாததால் உங்கள் உள்நுழைவு தோல்வியடைந்தது.", + "resume_not_applicable": "நாங்கள் வருந்துகிறோம்! ஒப்புதல் பகிரப்படாததால் உங்கள் உள்நுழைவு தோல்வியடைந்தது.", "incompatible_browser": "நாங்கள் வருந்துகிறோம்! உலாவியின் சமீபத்திய பதிப்பிற்கு மேம்படுத்தி மீண்டும் முயற்சிக்கவும்.", "ekyc_failed": "நாங்கள் வருந்துகிறோம்! உங்கள் eKYC சரிபார்ப்பை நிறைவு செய்ய முடியவில்லை. தயவுசெய்து பின்னர் மீண்டும் முயற்சிக்கவும்." } From 22e3a74a55b30613299adb8187ab8fe6cc314603 Mon Sep 17 00:00:00 2001 From: Rakshithb1 Date: Fri, 18 Oct 2024 18:59:32 +0530 Subject: [PATCH 13/30] [MOSIP-35892] Updated helm charts to add range Signed-off-by: Rakshithb1 Signed-off-by: kaifk468 --- .../templates/deployment.yaml | 4 +++- helm/mock-identity-system/values.yaml | 2 +- .../templates/deployment.yaml | 20 ++++++++++--------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/helm/mock-identity-system/templates/deployment.yaml b/helm/mock-identity-system/templates/deployment.yaml index 319d761c..7f453f37 100644 --- a/helm/mock-identity-system/templates/deployment.yaml +++ b/helm/mock-identity-system/templates/deployment.yaml @@ -105,8 +105,10 @@ spec: {{- end }} {{- end }} {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + name: {{ . }} + {{- end }} {{- end }} ports: diff --git a/helm/mock-identity-system/values.yaml b/helm/mock-identity-system/values.yaml index 60bf67a8..59e0a842 100644 --- a/helm/mock-identity-system/values.yaml +++ b/helm/mock-identity-system/values.yaml @@ -283,7 +283,7 @@ extraEnvVarsCM: ## Secret with extra environment variables ## -extraEnvVarsSecret: +extraEnvVarsSecret: [] ## Extra volumes to add to the deployment ## diff --git a/helm/mock-relying-party-ui/templates/deployment.yaml b/helm/mock-relying-party-ui/templates/deployment.yaml index a5db052d..76fa4d32 100644 --- a/helm/mock-relying-party-ui/templates/deployment.yaml +++ b/helm/mock-relying-party-ui/templates/deployment.yaml @@ -132,15 +132,17 @@ spec: {{- end }} envFrom: {{- if .Values.extraEnvVarsCM }} - {{- range .Values.extraEnvVarsCM }} - - configMapRef: - name: {{ . }} - {{- end }} - {{- end }} - {{- if .Values.extraEnvVarsSecret }} - - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} - {{- end }} + {{- range .Values.extraEnvVarsCM }} + - configMapRef: + name: {{ . }} + {{- end }} + {{- end }} + {{- if .Values.extraEnvVarsSecret }} + {{- range .Values.extraEnvVarsSecret }} + - secretRef: + name: {{ . }} + {{- end }} + {{- end }} volumeMounts: - name: nginx-conf mountPath: /etc/nginx/nginx.conf From 724d0d6746047e21e42d3b51b40ee9dddb6ca7c8 Mon Sep 17 00:00:00 2001 From: GurukiranP Date: Tue, 5 Nov 2024 09:57:51 +0530 Subject: [PATCH 14/30] [ES-1842] i18n translation changes. Signed-off-by: GurukiranP Signed-off-by: kaifk468 --- mock-relying-party-ui/public/locales/ar.json | 5 +++-- mock-relying-party-ui/public/locales/en.json | 5 +++-- mock-relying-party-ui/public/locales/hi.json | 5 +++-- mock-relying-party-ui/public/locales/km.json | 5 +++-- mock-relying-party-ui/public/locales/kn.json | 5 +++-- mock-relying-party-ui/public/locales/ta.json | 5 +++-- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/mock-relying-party-ui/public/locales/ar.json b/mock-relying-party-ui/public/locales/ar.json index 80557282..baebf59f 100644 --- a/mock-relying-party-ui/public/locales/ar.json +++ b/mock-relying-party-ui/public/locales/ar.json @@ -235,8 +235,9 @@ "consent_request_rejected": "تم رفض طلب الموافقة", "transaction_timeout": "لقد انتهت مهلة المعاملة. حاول مرة اخرى", "consent_rejected": "آسفون! لم يكن تسجيل الدخول الخاص بك ناجحًا نظرًا لعدم مشاركة الموافقة.", - "resume_not_applicable": "آسفون! لم يكن تسجيل الدخول الخاص بك ناجحًا نظرًا لعدم مشاركة الموافقة.", + "verification_incomplete": "آسفون! لم يكن تسجيل الدخول الخاص بك ناجحًا نظرًا لعدم مشاركة الموافقة.", "incompatible_browser": "آسفون! يرجى الترقية إلى أحدث إصدار من المتصفح والمحاولة مرة أخرى.", - "ekyc_failed": "نحن متأسفون! تعذر إكمال التحقق من eKYC الخاص بك. يرجى إعادة المحاولة لاحقا." + "ekyc_failed": "نحن متأسفون! تعذر إكمال التحقق من eKYC الخاص بك. يرجى إعادة المحاولة لاحقا.", + "identity_verification_failed": "فشل التحقق من eKYC. يرجى المحاولة مرة أخرى." } } diff --git a/mock-relying-party-ui/public/locales/en.json b/mock-relying-party-ui/public/locales/en.json index 4bf443be..dc2c6a74 100644 --- a/mock-relying-party-ui/public/locales/en.json +++ b/mock-relying-party-ui/public/locales/en.json @@ -236,8 +236,9 @@ "consent_request_rejected": "Consent Request Rejected", "transaction_timeout": "The transaction has timed out. Please try again", "consent_rejected": "We’re sorry! Your login was unsuccessful as consent was not shared.", - "resume_not_applicable": "We’re sorry! Your login was unsuccessful as consent was not shared.", + "verification_incomplete": "We’re sorry! Your login was unsuccessful as consent was not shared.", "incompatible_browser": "We’re sorry! Please upgrade to the latest version of the browser & try again.", - "ekyc_failed": "We’re sorry! Your eKYC verification could not be completed. Please try again later." + "ekyc_failed": "We’re sorry! Your eKYC verification could not be completed. Please try again later.", + "identity_verification_failed": "eKYC verification failed. Please try again." } } diff --git a/mock-relying-party-ui/public/locales/hi.json b/mock-relying-party-ui/public/locales/hi.json index 0d824ae0..a35896c8 100644 --- a/mock-relying-party-ui/public/locales/hi.json +++ b/mock-relying-party-ui/public/locales/hi.json @@ -234,8 +234,9 @@ "consent_request_rejected": "सहमति अनुरोध अस्वीकृत", "transaction_timeout": "लेन-देन का समय समाप्त हो गया है. कृपया पुन: प्रयास करें", "consent_rejected": "हम क्षमा चाहते हैं! आपका लॉगिन असफल रहा क्योंकि सहमति साझा नहीं की गई थी।", - "resume_not_applicable": "हम क्षमा चाहते हैं! आपका लॉगिन असफल रहा क्योंकि सहमति साझा नहीं की गई थी।", + "verification_incomplete": "हम क्षमा चाहते हैं! आपका लॉगिन असफल रहा क्योंकि सहमति साझा नहीं की गई थी।", "incompatible_browser": "हम क्षमा चाहते हैं! कृपया ब्राउज़र के नवीनतम संस्करण में अपग्रेड करें और पुनः प्रयास करें।", - "ekyc_failed": "हमें खेद है! आपका eKYC सत्यापन पूरा नहीं किया जा सका। कृपया बाद में पुनः प्रयास करें." + "ekyc_failed": "हमें खेद है! आपका eKYC सत्यापन पूरा नहीं किया जा सका। कृपया बाद में पुनः प्रयास करें.", + "identity_verification_failed": "eKYC सत्यापन विफल रहा. कृपया पुन: प्रयास करें।" } } diff --git a/mock-relying-party-ui/public/locales/km.json b/mock-relying-party-ui/public/locales/km.json index bce09f5f..687b485e 100644 --- a/mock-relying-party-ui/public/locales/km.json +++ b/mock-relying-party-ui/public/locales/km.json @@ -236,8 +236,9 @@ "consent_request_rejected": "សំណើការយល់ព្រមត្រូវបានបដិសេធ", "transaction_timeout": "ប្រតិបត្តិការបានអស់ពេលហើយ។ សូម​ព្យាយាម​ម្តង​ទៀត", "consent_rejected": "យើង​សុំទោស! ការចូលរបស់អ្នកមិនបានជោគជ័យទេ ដោយសារការយល់ព្រមមិនត្រូវបានចែករំលែក។", - "resume_not_applicable": "យើង​សុំទោស! ការចូលរបស់អ្នកមិនបានជោគជ័យទេ ដោយសារការយល់ព្រមមិនត្រូវបានចែករំលែក។", + "verification_incomplete": "យើង​សុំទោស! ការចូលរបស់អ្នកមិនបានជោគជ័យទេ ដោយសារការយល់ព្រមមិនត្រូវបានចែករំលែក។", "incompatible_browser": "យើង​សុំទោស! សូមដំឡើងកំណែទៅកំណែចុងក្រោយបំផុតនៃកម្មវិធីរុករកតាមអ៊ីនធឺណិត ហើយព្យាយាមម្តងទៀត។", - "ekyc_failed": "យើង​សុំទោស! ការផ្ទៀងផ្ទាត់ eKYC របស់អ្នកមិនអាចបញ្ចប់បានទេ។ សូមព្យាយាមម្តងទៀតនៅពេលក្រោយ។" + "ekyc_failed": "យើង​សុំទោស! ការផ្ទៀងផ្ទាត់ eKYC របស់អ្នកមិនអាចបញ្ចប់បានទេ។ សូមព្យាយាមម្តងទៀតនៅពេលក្រោយ។", + "identity_verification_failed": "ការផ្ទៀងផ្ទាត់ eKYC បានបរាជ័យ។ សូមព្យាយាមម្តងទៀត។" } } diff --git a/mock-relying-party-ui/public/locales/kn.json b/mock-relying-party-ui/public/locales/kn.json index 71f2ab65..bf36327c 100644 --- a/mock-relying-party-ui/public/locales/kn.json +++ b/mock-relying-party-ui/public/locales/kn.json @@ -234,8 +234,9 @@ "consent_request_rejected": "ಸಮ್ಮತಿ ವಿನಂತಿಯನ್ನು ತಿರಸ್ಕರಿಸಲಾಗಿದೆ", "transaction_timeout": "ವಹಿವಾಟಿನ ಅವಧಿ ಮೀರಿದೆ. ದಯವಿಟ್ಟು ಪುನಃ ಪ್ರಯತ್ನಿಸಿ", "consent_rejected": "ನಮ್ಮನ್ನು ಕ್ಷಮಿಸಿ! ಸಮ್ಮತಿಯನ್ನು ಹಂಚಿಕೊಳ್ಳದ ಕಾರಣ ನಿಮ್ಮ ಲಾಗಿನ್ ವಿಫಲವಾಗಿದೆ.", - "resume_not_applicable": "ನಮ್ಮನ್ನು ಕ್ಷಮಿಸಿ! ಸಮ್ಮತಿಯನ್ನು ಹಂಚಿಕೊಳ್ಳದ ಕಾರಣ ನಿಮ್ಮ ಲಾಗಿನ್ ವಿಫಲವಾಗಿದೆ.", + "verification_incomplete": "ನಮ್ಮನ್ನು ಕ್ಷಮಿಸಿ! ಸಮ್ಮತಿಯನ್ನು ಹಂಚಿಕೊಳ್ಳದ ಕಾರಣ ನಿಮ್ಮ ಲಾಗಿನ್ ವಿಫಲವಾಗಿದೆ.", "incompatible_browser": "ನಮ್ಮನ್ನು ಕ್ಷಮಿಸಿ! ದಯವಿಟ್ಟು ಬ್ರೌಸರ್‌ನ ಇತ್ತೀಚಿನ ಆವೃತ್ತಿಗೆ ಅಪ್‌ಗ್ರೇಡ್ ಮಾಡಿ ಮತ್ತು ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ.", - "ekyc_failed": "ಕ್ಷಮಿಸಿ! ನಿಮ್ಮ ಇಕೆವೈಸಿ ಪರಿಶೀಲನೆಯನ್ನು ಪೂರ್ಣಗೊಳಿಸಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ. ದಯವಿಟ್ಟು ನಂತರ ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ." + "ekyc_failed": "ಕ್ಷಮಿಸಿ! ನಿಮ್ಮ ಇಕೆವೈಸಿ ಪರಿಶೀಲನೆಯನ್ನು ಪೂರ್ಣಗೊಳಿಸಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ. ದಯವಿಟ್ಟು ನಂತರ ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ.", + "identity_verification_failed": "eKYC ಪರಿಶೀಲನೆ ವಿಫಲವಾಗಿದೆ. ದಯವಿಟ್ಟು ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ." } } diff --git a/mock-relying-party-ui/public/locales/ta.json b/mock-relying-party-ui/public/locales/ta.json index 555e18f5..dccb8524 100644 --- a/mock-relying-party-ui/public/locales/ta.json +++ b/mock-relying-party-ui/public/locales/ta.json @@ -234,8 +234,9 @@ "consent_request_rejected": "ஒப்புதல் கோரிக்கை நிராகரிக்கப்பட்டது", "transaction_timeout": "பரிவர்த்தனை நேரம் முடிந்தது. தயவு செய்து மீண்டும் முயற்சிக்கவும்", "consent_rejected": "நாங்கள் வருந்துகிறோம்! ஒப்புதல் பகிரப்படாததால் உங்கள் உள்நுழைவு தோல்வியடைந்தது.", - "resume_not_applicable": "நாங்கள் வருந்துகிறோம்! ஒப்புதல் பகிரப்படாததால் உங்கள் உள்நுழைவு தோல்வியடைந்தது.", + "verification_incomplete": "நாங்கள் வருந்துகிறோம்! ஒப்புதல் பகிரப்படாததால் உங்கள் உள்நுழைவு தோல்வியடைந்தது.", "incompatible_browser": "நாங்கள் வருந்துகிறோம்! உலாவியின் சமீபத்திய பதிப்பிற்கு மேம்படுத்தி மீண்டும் முயற்சிக்கவும்.", - "ekyc_failed": "நாங்கள் வருந்துகிறோம்! உங்கள் eKYC சரிபார்ப்பை நிறைவு செய்ய முடியவில்லை. தயவுசெய்து பின்னர் மீண்டும் முயற்சிக்கவும்." + "ekyc_failed": "நாங்கள் வருந்துகிறோம்! உங்கள் eKYC சரிபார்ப்பை நிறைவு செய்ய முடியவில்லை. தயவுசெய்து பின்னர் மீண்டும் முயற்சிக்கவும்.", + "identity_verification_failed": "eKYC சரிபார்ப்பு தோல்வியடைந்தது. மீண்டும் முயற்சிக்கவும்." } } From f521362fb816c2c37126fe941b946e7bfdc69982 Mon Sep 17 00:00:00 2001 From: Gk <76690271+gk-4VII@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:50:03 +0530 Subject: [PATCH 15/30] [ES-1899] Added log for testing. (#284) Signed-off-by: GurukiranP Signed-off-by: kaifk468 --- mock-relying-party-service/esignetService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mock-relying-party-service/esignetService.js b/mock-relying-party-service/esignetService.js index 178ff7d7..7874e3ec 100644 --- a/mock-relying-party-service/esignetService.js +++ b/mock-relying-party-service/esignetService.js @@ -119,7 +119,7 @@ const decodeUserInfoResponse = async (userInfoResponse) => { } } } - + console.log("userInfoResponse", response); return await new jose.decodeJwt(response); }; From 2f1fce93821771956416883d9a1135175c59ab9b Mon Sep 17 00:00:00 2001 From: bhumi46 Date: Tue, 19 Nov 2024 11:02:39 +0530 Subject: [PATCH 16/30] [MOSIP-37447] updated install.sh script for mosipid check Signed-off-by: bhumi46 Signed-off-by: kaifk468 --- partner-onboarder/install.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/partner-onboarder/install.sh b/partner-onboarder/install.sh index 604d8eb7..61ba02fa 100755 --- a/partner-onboarder/install.sh +++ b/partner-onboarder/install.sh @@ -89,6 +89,34 @@ function installing_onboarder() { fi done + while true; do + read -p "Is esignet deployed with default plugins? (y/n): " esignet_ans + if [[ "$esignet_ans" == "y" || "$esignet_ans" == "Y" ]]; then + while true; do + read -p "Please confirm with y for MOSIP ID plugins (y/n): " mosipid_ans + if [[ "$mosipid_ans" == "y" || "$mosipid_ans" == "Y" ]]; then + mosipid="true" + MOSIPID_OPTION="--set onboarding.variables.mosipid=$mosipid" + break + elif [[ "$mosipid_ans" == "n" || "$mosipid_ans" == "N" ]]; then + mosipid="false" + MOSIPID_OPTION="--set onboarding.variables.mosipid=$mosipid" + break + else + echo "Invalid response for MOSIP ID plugins. Please respond with y or n." + fi + done + break + elif [[ "$esignet_ans" == "n" || "$esignet_ans" == "N" ]]; then + mosipid="false" + MOSIPID_OPTION="--set onboarding.variables.mosipid=$mosipid" + break + else + echo "Invalid response for esignet. Please respond with y or n." + fi + done + echo "Helm option: $MOSIPID_OPTION" + echo "Istio label" kubectl label ns $NS istio-injection=disabled --overwrite helm repo update From 203cab390c9488fe406c8eeb5d8eb39afdfc2c9a Mon Sep 17 00:00:00 2001 From: bhumi46 Date: Tue, 19 Nov 2024 11:06:20 +0530 Subject: [PATCH 17/30] [MOSIP-37447] updated install.sh script for mosipid check Signed-off-by: bhumi46 Signed-off-by: kaifk468 --- partner-onboarder/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/partner-onboarder/install.sh b/partner-onboarder/install.sh index 61ba02fa..8656cdaa 100755 --- a/partner-onboarder/install.sh +++ b/partner-onboarder/install.sh @@ -133,6 +133,7 @@ function installing_onboarder() { helm -n $NS install esignet-mock-rp-onboarder mosip/partner-onboarder \ $NFS_OPTION \ $S3_OPTION \ + $MOSIPID_OPTION \ --set onboarding.variables.push_reports_to_s3=$push_reports_to_s3 \ --set extraEnvVarsCM[0]=esignet-global \ --set extraEnvVarsCM[1]=keycloak-env-vars \ From 9669d30b064251c19c45a3e064e67a21e0262945 Mon Sep 17 00:00:00 2001 From: GurukiranP Date: Mon, 25 Nov 2024 17:44:21 +0530 Subject: [PATCH 18/30] [ES-1860] Updated package.json and package-lock.json files . Signed-off-by: GurukiranP Signed-off-by: kaifk468 --- mock-relying-party-service/package-lock.json | 14 +- mock-relying-party-ui/package-lock.json | 170 ++++++++++--------- 2 files changed, 100 insertions(+), 84 deletions(-) diff --git a/mock-relying-party-service/package-lock.json b/mock-relying-party-service/package-lock.json index 63ae0840..d90728e4 100644 --- a/mock-relying-party-service/package-lock.json +++ b/mock-relying-party-service/package-lock.json @@ -870,9 +870,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "bin": { "semver": "bin/semver" } @@ -1672,9 +1672,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" }, "send": { "version": "0.18.0", @@ -1808,4 +1808,4 @@ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" } } -} +} \ No newline at end of file diff --git a/mock-relying-party-ui/package-lock.json b/mock-relying-party-ui/package-lock.json index 2fa88a92..c1c8bd71 100644 --- a/mock-relying-party-ui/package-lock.json +++ b/mock-relying-party-ui/package-lock.json @@ -91,9 +91,9 @@ } }, "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -144,9 +144,9 @@ } }, "node_modules/@babel/eslint-parser/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -205,9 +205,9 @@ } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -266,9 +266,9 @@ } }, "node_modules/@babel/helper-define-polyfill-provider/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -1512,9 +1512,9 @@ } }, "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -1723,9 +1723,9 @@ } }, "node_modules/@babel/preset-env/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -4618,9 +4618,9 @@ } }, "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -6803,9 +6803,9 @@ } }, "node_modules/eslint-plugin-react/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -8713,9 +8713,9 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -10848,11 +10848,14 @@ } }, "node_modules/lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { - "node": ">=12" + "node": ">=10" } }, "node_modules/magic-string": { @@ -10878,9 +10881,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -14305,17 +14308,17 @@ } }, "node_modules/semver": { - "version": "7.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", - "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { - "lru-cache": "^7.4.0" + "lru-cache": "^6.0.0" }, "bin": { "semver": "bin/semver.js" }, "engines": { - "node": "^10.0.0 || ^12.0.0 || ^14.0.0 || >=16.0.0" + "node": ">=10" } }, "node_modules/send": { @@ -16698,6 +16701,11 @@ "node": ">=10" } }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", @@ -16788,9 +16796,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" } } }, @@ -16824,9 +16832,9 @@ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" } } }, @@ -16869,9 +16877,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" } } }, @@ -16914,9 +16922,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" } } }, @@ -17715,9 +17723,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" } } }, @@ -17871,9 +17879,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" } } }, @@ -20000,9 +20008,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" } } }, @@ -21702,9 +21710,9 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" } } }, @@ -22967,9 +22975,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" } } }, @@ -24525,9 +24533,12 @@ } }, "lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==" + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } }, "magic-string": { "version": "0.25.9", @@ -24546,9 +24557,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" } } }, @@ -26889,11 +26900,11 @@ } }, "semver": { - "version": "7.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", - "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { - "lru-cache": "^7.4.0" + "lru-cache": "^6.0.0" } }, "send": { @@ -28735,6 +28746,11 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", @@ -28765,4 +28781,4 @@ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" } } -} +} \ No newline at end of file From 2f36c8092f736ab85df6255ac1eb995767d18a4a Mon Sep 17 00:00:00 2001 From: Zeeshan Mehboob <82993262+zesu22@users.noreply.github.com> Date: Mon, 2 Dec 2024 17:20:27 +0530 Subject: [PATCH 19/30] [MODIFIED] redesign userprofile for mobile screen (#295) Signed-off-by: Zeeshan Mehboob Signed-off-by: kaifk468 --- .../public/images/menu_icon.png | Bin 0 -> 179 bytes .../public/images/signout_icon.png | Bin 0 -> 437 bytes .../src/components/ProfileUI.js | 224 +++++------ .../src/components/Sidenav.js | 379 +++++++++++------- 4 files changed, 339 insertions(+), 264 deletions(-) create mode 100644 mock-relying-party-ui/public/images/menu_icon.png create mode 100644 mock-relying-party-ui/public/images/signout_icon.png diff --git a/mock-relying-party-ui/public/images/menu_icon.png b/mock-relying-party-ui/public/images/menu_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..dcb737e33c1c433e61d052f8e727a782ffeb5f4b GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W?!3HGtkJx+wQk(@Ik;M!Q+`=Ht$S`Y;1W=H% zILO_JVcj{Imp~3nx}&cn1H;CC?mvmFK)#2ki(^OyoXj~rHLEP?Bgy9 zBp?UH`K36vF8*>p-yK4&baEAi;akkpMAm4re7sxlpr=rVv)Mc`ghyURZ6gs)`@*yg z2Gl)oldVfcD!+|~ZPwc(eR94?`PVVemxt~876wWqnixodwT&lTI-Sigl~vbP+3C|J zE7~>%9tr^pK#Gv#$PEc!YkhAZ{Cd+6cB6W9bA^ f#6L&La_FfqnTw)Z%5#F{00000NkvXXu0mjf$d0h+ literal 0 HcmV?d00001 diff --git a/mock-relying-party-ui/src/components/ProfileUI.js b/mock-relying-party-ui/src/components/ProfileUI.js index cbfc3f1e..d0f243d9 100644 --- a/mock-relying-party-ui/src/components/ProfileUI.js +++ b/mock-relying-party-ui/src/components/ProfileUI.js @@ -42,132 +42,130 @@ export default function ProfileUI({ let el = ( <> -
-
-
-
-

{t("current_medication")} ({medicationCount})

+
+
+
+

{t("current_medication")} ({medicationCount})

-
-
-
+
-
-

{t("next_appointment")}

-
-
-
    - {appointmentInfo?.appointment?.map((data, index) => ( -
  • -
    -
    -

    - {i18n.t(formattedDate)} -

    -

    - - {data["time"]} -

    -
    - - {t(data["location"])} -
    -
    -
    - Jese Leos image -
    -

    - {t(data["doctorName"])} -

    -

    - {t(data["department"])} -

    -
    +
    +

    {t("next_appointment")}

    +
    +
    +
      + {appointmentInfo?.appointment?.map((data, index) => ( +
    • +
      +
      +

      + {i18n.t(formattedDate)} +

      +

      + + {data["time"]} +

      +
      + + {t(data["location"])} +
      +
      +
      + Jese Leos image +
      +

      + {t(data["doctorName"])} +

      +

      + {t(data["department"])} +

      -
    • - ))} -
    • -
    • -
    -
    + ))} +
  • + +
  • +
diff --git a/mock-relying-party-ui/src/components/Sidenav.js b/mock-relying-party-ui/src/components/Sidenav.js index 0872085f..ef807f70 100644 --- a/mock-relying-party-ui/src/components/Sidenav.js +++ b/mock-relying-party-ui/src/components/Sidenav.js @@ -27,6 +27,7 @@ export default function Sidenav({ const [messagesInfo, setMessagesInfo] = useState([]); const [address, setAddress] = useState(null); const [emailAddress, setEmailAddress] = useState(null); + const [showMenu, setShowMenu] = useState(false); const navigate = useNavigate(); const navigateToLogin = (errorCode, errorDescription) => { @@ -60,12 +61,12 @@ export default function Sidenav({ }, [langOptions]); //Gets fired when changeLanguage got called. - i18n.on('languageChanged', function (lng) { + i18n.on('languageChanged', function (lng) { let lang = langOptions.find((option) => { return option.value === lng; }); setSelectedLang(lang); - }) + }) useEffect(() => { const getSearchParams = async () => { @@ -80,7 +81,17 @@ export default function Sidenav({ getMessages(); getUserDetails(authCode); }; + // hiding or showing the side nav + // according to windows height + const handleResize = () => { + const { innerWidth: width } = window; + setShowMenu(width > 767); + }; + // adding event listener for window resize + window.addEventListener("resize", handleResize); getSearchParams(); + // removing event listener for window resize + return () => window.removeEventListener("resize", handleResize); }, []); const getUserDetails = async (authCode) => { @@ -130,7 +141,7 @@ export default function Sidenav({ var messagesInfo = get_messages(); setMessagesInfo(messagesInfo); }; - const messagesCount = messagesInfo.messages?.length + const messagesCount = messagesInfo.messages?.length const getAddress = (userAddress) => { let address = ""; @@ -183,21 +194,165 @@ export default function Sidenav({ return address.substring(0, address.length - 2); }; + // new message component + const newMessageComponent = () => { + return <> +

+ {t("new_messages")} ({messagesCount}) +

+ {messagesInfo?.messages?.map((message, index) => { + const pastDate = new Date( + currentDate.getTime() - message["days"] * 24 * 60 * 60 * 1000 + ); + const formattedDate = new Intl.DateTimeFormat(i18n.language, { dateStyle: 'full' }).format(pastDate); + return ( +
+
+ Jese Leos image + +
+

+ {t(message["doctorName"])} +

+

+ {i18n.t(formattedDate)} +

+ +

+ {t("hi")} {userInfo?.name} , {t(message["message"])} +

+
+ +
+
+ ); + })} + ; + }; + + // vaccination history component + const vaccinationHistoryComponent = () => { + return <> +
+
+

{t("vaccinations")}

+
+ +
+
+ + + + + + + + + + + {claimInfo?.claimproviders?.map((item, idx) => { + const pastDate = new Date( + currentDate.getTime() - + item["days"] * 24 * 60 * 60 * 1000 + ); + return ( + + + + + + + ); + })} + +
+

{t("vaccination_details")}

+
+ {t("date")} + + {t("vaccination_center")} + + {t("total_cost")} +
+

{t(item["vaccinationName"])}

+
+

{pastDate.toLocaleDateString()}

+
+

{t(item["vaccinationCenter"])}

+
+

{item["totalCost"]}

+
+
+ + }; + let el = ( <> -
- {t("language")} - +
{status === states.LOADING && (
@@ -461,8 +654,8 @@ export default function Sidenav({ {status === states.LOADED && ( <> -
-
+
+
{t("welcome")}, {userInfo?.name} @@ -472,7 +665,7 @@ export default function Sidenav({

-
+
-

+

{userInfo?.name}

@@ -513,7 +706,7 @@ export default function Sidenav({ {isOpen && (
- + {t("email")}:  {emailAddress?.split("@")[0]} @@ -553,132 +746,16 @@ export default function Sidenav({
-
- {component} -
-
-
-

{t("vaccinations")}

-
-
+
+ {component}
-
- - - - - - - - - - - - {claimInfo?.claimproviders?.map((item, idx) => { - const pastDate = new Date( - currentDate.getTime() - - item["days"] * 24 * 60 * 60 * 1000 - ); - return ( - - - - - - - ); - })} - -
-

{t("vaccination_details")}

-
- {t("date")} - - {t("vaccination_center")} - - {t("total_cost")} -
-

{t(item["vaccinationName"])}

-
-

{pastDate.toLocaleDateString()}

-
-

{t(item["vaccinationCenter"])}

-
-

{item["totalCost"]}

-
+
+ {newMessageComponent()}
+ {vaccinationHistoryComponent()}
-
-

- {t("new_messages")} ({messagesCount}) -

- {messagesInfo?.messages?.map((message, index) => { - const pastDate = new Date( - currentDate.getTime() - message["days"] * 24 * 60 * 60 * 1000 - ); - const formattedDate = new Intl.DateTimeFormat(i18n.language, { dateStyle: 'full' }).format(pastDate); - return ( -
-
- Jese Leos image - -
-

- {t(message["doctorName"])} -

-

- {i18n.t(formattedDate)} -

- -

- {t("hi")} {userInfo?.name} , {t(message["message"])} -

-
- -
-
- ); - })} +
+ {newMessageComponent()}
From f5582e96b2788c9fa66180f3dec7cbb8cb4e5a6a Mon Sep 17 00:00:00 2001 From: Zeeshan Mehboob <82993262+zesu22@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:44:36 +0530 Subject: [PATCH 20/30] [MODIFIED] initial rendering, slider in sidenavbar in mobile view (#296) Signed-off-by: Zeeshan Mehboob Signed-off-by: kaifk468 --- mock-relying-party-ui/src/components/Sidenav.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mock-relying-party-ui/src/components/Sidenav.js b/mock-relying-party-ui/src/components/Sidenav.js index ef807f70..791e1c6a 100644 --- a/mock-relying-party-ui/src/components/Sidenav.js +++ b/mock-relying-party-ui/src/components/Sidenav.js @@ -81,15 +81,14 @@ export default function Sidenav({ getMessages(); getUserDetails(authCode); }; + getSearchParams(); // hiding or showing the side nav // according to windows height - const handleResize = () => { - const { innerWidth: width } = window; - setShowMenu(width > 767); - }; + const handleResize = () => setShowMenu(window.innerWidth > 767); + // initial call to handleResize + handleResize(); // adding event listener for window resize window.addEventListener("resize", handleResize); - getSearchParams(); // removing event listener for window resize return () => window.removeEventListener("resize", handleResize); }, []); @@ -335,7 +334,7 @@ export default function Sidenav({ + (showMenu ? "" : "hidden")} aria-label="Sidebar" > -
+
@@ -349,9 +348,11 @@ export default function Sidenav({
Health Portal
-
setShowMenu(current => !current)}>
+
setShowMenu(current => !current)}>
+
+ -
+
Date: Mon, 16 Dec 2024 02:06:08 +0530 Subject: [PATCH 21/30] conflict resolve Signed-off-by: kaifk468 --- README.md | 2 +- deploy/delete-mock.sh | 1 - docker-compose/docker-compose.yml | 2 +- ...ck-relying-party-portal-docker-compose.yml | 4 +- .../controller/IdentityController.java | 5 +- .../identitysystem/dto/CreateIdentity.java | 12 +++ .../mock/identitysystem/dto/IdentityData.java | 4 - .../identitysystem/dto/UpdateIdentity.java | 12 +++ .../impl/AuthenticationServiceImpl.java | 2 + .../mock/identitysystem/validator/IdData.java | 26 ------ .../validator/IdentityDataValidator.java | 43 ---------- .../validator/IdentitySchema.java | 2 +- .../validator/IdentitySchemaValidator.java | 18 ++--- .../resources/application-default.properties | 12 ++- .../resources/application-local.properties | 80 ++----------------- .../main/resources/mock-identity-schema.json | 19 ----- .../controller/IdentityControllerTest.java | 40 ++++++---- .../impl/AuthenticationServiceImplTest.java | 18 +---- .../validator/ValidatorTest.java | 23 ------ .../resources/application-test.properties | 2 +- .../resources/mock-identity-test-schema.json | 19 ----- partner-onboarder/install.sh | 2 +- partner-onboarder/values.yaml | 2 +- 23 files changed, 89 insertions(+), 261 deletions(-) create mode 100644 mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/CreateIdentity.java create mode 100644 mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/UpdateIdentity.java delete mode 100644 mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdData.java delete mode 100644 mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentityDataValidator.java diff --git a/README.md b/README.md index b12141cb..fdef7d5f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ Repository contains mock implementations for eSignet. Only for non-production us |[Postgres Init](https://github.com/mosip/mosip-infra/tree/v1.2.0.1-B3/deployment/v3/external/postgres) | 12.0.1-B3 | |[mock-identity-softhsm](https://github.com/mosip/esignet/blob/v1.0.0/helm/install-all.sh) | 12.0.1-B2 | - ### Install Pe-req for mock services * Install `kubectl` and `helm` utilities. * Run `prereq.sh` to setup below mentioned pre-requisites for mock services. @@ -29,6 +28,7 @@ Repository contains mock implementations for eSignet. Only for non-production us ``` export KUBECONFIG=path/to/kubeconfig.config ``` + * Execute installation script: ``` ./instll-mock.sh diff --git a/deploy/delete-mock.sh b/deploy/delete-mock.sh index e76ca9e6..bcb49ecf 100755 --- a/deploy/delete-mock.sh +++ b/deploy/delete-mock.sh @@ -34,4 +34,3 @@ set -o nounset ## set -u : exit the script if you try to use an uninitialised set -o errtrace # trace ERR through 'time command' and other functions set -o pipefail # trace ERR through pipes deleting_mock # calling function - diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index a720385d..b46f5226 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -19,7 +19,7 @@ services: - 8082:8082 environment: - container_user=mosip - - active_profile_env=local + - active_profile_env=default,local - SPRING_DATASOURCE_URL=jdbc:postgresql://database:5432/mosip_mockidentitysystem?currentSchema=mockidentitysystem - SPRING_DATASOURCE_USERNAME=postgres - SPRING_DATASOURCE_PASSWORD=postgres diff --git a/docker-compose/mock-relying-party-portal-docker-compose.yml b/docker-compose/mock-relying-party-portal-docker-compose.yml index cd4c222c..13fc3098 100644 --- a/docker-compose/mock-relying-party-portal-docker-compose.yml +++ b/docker-compose/mock-relying-party-portal-docker-compose.yml @@ -1,6 +1,6 @@ services: mock-relying-party-service: - image: 'mosipdev/mock-relying-party-service:develop' + image: 'mosipdev/mock-relying-party-service:release-0.10.x' user: root ports: - 8888:8888 @@ -14,7 +14,7 @@ services: mock-relying-party-ui: - image: 'mosipdev/mock-relying-party-ui:develop' + image: 'mosipdev/mock-relying-party-ui:release-0.10.x' user: root ports: - 3000:3000 diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java index aefb57dd..12871f0c 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/controller/IdentityController.java @@ -31,7 +31,6 @@ @RestController @RequestMapping("/") -@Validated public class IdentityController { @Autowired @@ -40,7 +39,7 @@ public class IdentityController { @PostMapping(value = "identity", consumes = { MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE }) public ResponseWrapper createIdentity - (@RequestBody @IdentitySchema(isCreate=true) RequestWrapper< IdentityData> requestWrapper) throws MockIdentityException { + (@RequestBody @Valid RequestWrapper requestWrapper) throws MockIdentityException { ResponseWrapper response = new ResponseWrapper(); IdentityStatus identityStatus = new IdentityStatus(); @@ -54,7 +53,7 @@ public class IdentityController { @PutMapping(value = "identity", consumes = { MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE }) public ResponseWrapper updateIdentity - (@RequestBody @IdentitySchema(isCreate=false) RequestWrapper requestWrapper) throws MockIdentityException { + (@RequestBody @Valid RequestWrapper requestWrapper) throws MockIdentityException { ResponseWrapper response = new ResponseWrapper(); IdentityStatus identityStatus = new IdentityStatus(); diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/CreateIdentity.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/CreateIdentity.java new file mode 100644 index 00000000..9c91b8db --- /dev/null +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/CreateIdentity.java @@ -0,0 +1,12 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ +package io.mosip.esignet.mock.identitysystem.dto; + +import io.mosip.esignet.mock.identitysystem.validator.IdentitySchema; + +@IdentitySchema(action = "CREATE") +public class CreateIdentity extends IdentityData { +} diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/IdentityData.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/IdentityData.java index d28d1e25..3f9cb811 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/IdentityData.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/IdentityData.java @@ -12,11 +12,9 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import io.mosip.esignet.mock.identitysystem.util.ErrorConstants; -import io.mosip.esignet.mock.identitysystem.validator.IdData; import lombok.Data; @Data -@IdData @JsonIgnoreProperties(ignoreUnknown = true) public class IdentityData { @@ -25,8 +23,6 @@ public class IdentityData { String pin; - List name; - List fullName; String preferredLang; diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/UpdateIdentity.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/UpdateIdentity.java new file mode 100644 index 00000000..f891bc95 --- /dev/null +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/UpdateIdentity.java @@ -0,0 +1,12 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ +package io.mosip.esignet.mock.identitysystem.dto; + +import io.mosip.esignet.mock.identitysystem.validator.IdentitySchema; + +@IdentitySchema(action = "UPDATE") +public class UpdateIdentity extends IdentityData { +} diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImpl.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImpl.java index 52175eb2..c593ea41 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImpl.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImpl.java @@ -384,6 +384,7 @@ private KycAuth saveKycAuthTransaction(String transactionId, String relyingParty } private Map buildKycDataBasedOnPolicy(String individualId, JsonNode identityData, Map claims, List locales) { + log.info("Accepted claim details {} for locales : {}", claims, locales); Map kyc = new HashMap<>(); if (CollectionUtils.isEmpty(locales)) { locales = Arrays.asList(defaultLanguage); @@ -392,6 +393,7 @@ private Map buildKycDataBasedOnPolicy(String individualId, JsonN for (Map.Entry claimDetail : claims.entrySet()) { Optional> keyMappingEntry = oidcClaimsMapping.entrySet().stream().filter(entry -> entry.getValue().equals(claimDetail.getKey()) ).findFirst(); + log.info("Mapping for claim {} is found : {}", claimDetail.getKey(), keyMappingEntry.isPresent()); switch (claimDetail.getKey()) { case "verified_claims": diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdData.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdData.java deleted file mode 100644 index 9c08bf7f..00000000 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdData.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.mosip.esignet.mock.identitysystem.validator; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static io.mosip.esignet.mock.identitysystem.util.ErrorConstants.INVALID_REQUEST; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import javax.validation.Constraint; -import javax.validation.Payload; - -@Target({TYPE}) -@Retention(RUNTIME) -@Constraint(validatedBy = IdentityDataValidator.class) -@Documented -public @interface IdData { - - String message() default INVALID_REQUEST; - - Class[] groups() default {}; - - Class[] payload() default {}; - -} diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentityDataValidator.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentityDataValidator.java deleted file mode 100644 index 665932be..00000000 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentityDataValidator.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -package io.mosip.esignet.mock.identitysystem.validator; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.databind.ObjectMapper; - -import io.mosip.esignet.mock.identitysystem.dto.IdentityData; - -@Component -public class IdentityDataValidator implements ConstraintValidator { - - @Value("#{T(java.util.Arrays).asList('${mosip.esignet.mock.supported-fields:}')}") - private List supportedFields; - - @Override - public boolean isValid(IdentityData value, ConstraintValidatorContext context) { - if (value == null) { - return false; - } - - @SuppressWarnings("unchecked") - Map fields = new ObjectMapper().convertValue(value, HashMap.class); - - fields.values().removeIf(Objects::isNull); - - return fields.keySet().containsAll(supportedFields); - } - -} diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchema.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchema.java index 5b4173fb..27ef0caa 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchema.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchema.java @@ -19,5 +19,5 @@ Class[] groups() default {}; Class[] payload() default {}; - boolean isCreate(); + String action(); } diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java index 132383e1..301b0fb1 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/validator/IdentitySchemaValidator.java @@ -6,6 +6,7 @@ import io.mosip.esignet.mock.identitysystem.dto.IdentityData; import io.mosip.esignet.mock.identitysystem.dto.RequestWrapper; import lombok.extern.slf4j.Slf4j; +import org.jose4j.lang.StringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.Resource; @@ -28,7 +29,8 @@ public class IdentitySchemaValidator implements ConstraintValidator nonMandatoryFieldsOnUpdate; - private boolean isCreate; + + private String action; private volatile JsonSchema schema; @@ -41,20 +43,16 @@ public class IdentitySchemaValidator implements ConstraintValidator validationErrors = validateIdentityData(identityJsonNode); @@ -69,7 +67,7 @@ public boolean isValid(Object object, ConstraintValidatorContext context) { private Set validateIdentityData(JsonNode identityJsonNode) { Set errors = getSchema().validate(identityJsonNode); // If not a create operation, filter out specific errors - if (!isCreate) { + if (action.equals("UPDATE")) { // Ignore validation errors with code 1029 (null value) and for exempted fields when validating updateIdentity errors = errors.stream() .filter(error -> !error.getCode().equals("1029") || diff --git a/mock-identity-system/src/main/resources/application-default.properties b/mock-identity-system/src/main/resources/application-default.properties index 880c5e75..33c3511f 100644 --- a/mock-identity-system/src/main/resources/application-default.properties +++ b/mock-identity-system/src/main/resources/application-default.properties @@ -28,7 +28,7 @@ ##-----------------------------------------Mock-identity-system properties---------------------------------------------- mosip.mock.ida.identity.schema.url=classpath:/mock-identity-schema.json -mosip.mock.ida.update-identity.non-mandatory.fields={"fullName","name","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} +mosip.mock.ida.update-identity.non-mandatory.fields={"fullName","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} ##----------------------------------------- Database properties -------------------------------------------------------- mosip.mockidentitysystem.database.hostname=${database.host} @@ -108,14 +108,20 @@ spring.jpa.hibernate.ddl-auto=none spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true mosip.esignet.mock.authenticator.ida.otp-channels=email,phone + mosip.esignet.mock.supported-fields=individualId,pin,givenName,familyName,gender,dateOfBirth,email,phone,streetAddress,locality,region,postalCode,country mosip.mock.ida.kba.default.field-language=eng -mosip.mock.ida.kyc.psut.field=psut + + #Related to health check of hsm mosip.kernel.keymgr.hsm.health.check.enabled=false mosip.kernel.keymgr.hsm.health.key.app-id=MOCK_AUTHENTICATION_SERVICE mosip.kernel.keymgr.hsm.healthkey.ref-id=HEALTH_KEY +## Value to be used as partner specific token, if configured value is psut, token is generated using individualId & partnerId. if it is +# configured to use any other identity fields eg: individualId +mosip.mock.ida.kyc.psut.field=psut + ##---------------------------------kbi Configurations------------------------------------------------------ #We can use any field from the IdentityData for kbi @@ -123,4 +129,4 @@ mosip.esignet.authenticator.auth-factor.kbi.field-details={{"id":"phone", "type" mosip.esignet.authenticator.auth-factor.kbi.field-language=eng mosip.mock.ida.kbi.default.field-language=eng -mosip.mock.ida.identity-openid-claims-mapping={"fullName":"name","name":"name","email":"email","phone":"phone_number","gender":"gender","dateOfBirth":"birthdate","encodedPhoto":"picture"} +mosip.mock.ida.identity-openid-claims-mapping={"fullName":"name","givenName":"given_name","familyName":"family_name","email":"email","phone":"phone_number","gender":"gender","dateOfBirth":"birthdate","encodedPhoto":"picture"} diff --git a/mock-identity-system/src/main/resources/application-local.properties b/mock-identity-system/src/main/resources/application-local.properties index 499cdf19..a1a7491d 100644 --- a/mock-identity-system/src/main/resources/application-local.properties +++ b/mock-identity-system/src/main/resources/application-local.properties @@ -1,76 +1,12 @@ -##----------------------------------------- Database properties -------------------------------------------------------- +##-----------------------------------------local database properties -------------------------------------------------------- -spring.datasource.url=jdbc:postgresql://localhost:5455/mosip_mockidentitysystem?currentSchema=mockidentitysystem -spring.datasource.username=postgres +mosip.mockidentitysystem.database.hostname=localhost +mosip.mockidentitysystem.database.port=5432 +mosip.mockidentitysystem.database.name=mosip_mockidentitysystem +mosip.mockidentitysystem.database.username=postgres spring.datasource.password=postgres -spring.datasource.driver-class-name=org.postgresql.Driver -spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL95Dialect -spring.jpa.show-sql=false -spring.jpa.hibernate.ddl-auto=none -spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true - -#------------------------------------ Key-manager specific properties -------------------------------------------------- -#Crypto asymmetric algorithm name -mosip.kernel.crypto.asymmetric-algorithm-name=RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING -#Crypto symmetric algorithm name -mosip.kernel.crypto.symmetric-algorithm-name=AES/GCM/PKCS5Padding -#Keygenerator asymmetric algorithm name -mosip.kernel.keygenerator.asymmetric-algorithm-name=RSA -#Keygenerator symmetric algorithm name -mosip.kernel.keygenerator.symmetric-algorithm-name=AES -#Asymmetric algorithm key length -mosip.kernel.keygenerator.asymmetric-key-length=2048 -#Symmetric algorithm key length -mosip.kernel.keygenerator.symmetric-key-length=256 -#Encrypted data and encrypted symmetric key separator -mosip.kernel.data-key-splitter=#KEY_SPLITTER# -#GCM tag length -mosip.kernel.crypto.gcm-tag-length=128 -#Hash algo name -mosip.kernel.crypto.hash-algorithm-name=PBKDF2WithHmacSHA512 -#Symmtric key length used in hash -mosip.kernel.crypto.hash-symmetric-key-length=256 -#No of iterations in hash -mosip.kernel.crypto.hash-iteration=100000 -#Sign algo name -mosip.kernel.crypto.sign-algorithm-name=RS256 -#Certificate Sign algo name -mosip.kernel.certificate.sign.algorithm=SHA256withRSA - -mosip.kernel.keymanager.hsm.config-path=local.p12 +## Keymanager configuration mosip.kernel.keymanager.hsm.keystore-type=PKCS12 -mosip.kernel.keymanager.hsm.keystore-pass=local - -mosip.kernel.keymanager.certificate.default.common-name=www.mosip.io -mosip.kernel.keymanager.certificate.default.organizational-unit=MOSIP-TECH-CENTER -mosip.kernel.keymanager.certificate.default.organization=IITB -mosip.kernel.keymanager.certificate.default.location=BANGALORE -mosip.kernel.keymanager.certificate.default.state=KA -mosip.kernel.keymanager.certificate.default.country=IN - -mosip.kernel.keymanager.softhsm.certificate.common-name=www.mosip.io -mosip.kernel.keymanager.softhsm.certificate.organizational-unit=MOSIP -mosip.kernel.keymanager.softhsm.certificate.organization=IITB -mosip.kernel.keymanager.softhsm.certificate.country=IN - -# Application Id for PMS master key. -mosip.kernel.partner.sign.masterkey.application.id=PMS -mosip.kernel.partner.allowed.domains=DEVICE - -mosip.kernel.keymanager-service-validate-url=https://${mosip.hostname}/keymanager/validate -mosip.kernel.keymanager.jwtsign.validate.json=false -mosip.keymanager.dao.enabled=false -crypto.PrependThumbprint.enable=true -## ------------------------------------------- Integrations ------------------------------------------------------------ -#Mock IDA integration props -mosip.esignet.mock.authenticator.ida.otp-channels=email,phone - -#Mock IDA OIDC Specified Cliams -mosip.mock.ida.identity-openid-claims-mapping={"fullName":"name","name":"name","email":"email","phone":"phone_number","gender":"gender","dateOfBirth":"birthdate","encodedPhoto":"picture"} - -##---------------------------------KBI Configurations------------------------------------------------------ -#We can use any field from the IdentityData for KBI -mosip.esignet.authenticator.auth-factor.kbi.field-details={{"id":"phone", "type":"text", "format":""},{"id":"email", "type":"text", "format":""},{"id":"dateOfBirth", "type":"date", "format":"yyyy-MM-dd"}} -mosip.mock.ida.kbi.default.field-language=eng -mosip.mock.ida.kyc.psut.field=psut +mosip.kernel.keymanager.hsm.config-path=mock_local.p12 +mosip.kernel.keymanager.hsm.keystore-pass=localtest diff --git a/mock-identity-system/src/main/resources/mock-identity-schema.json b/mock-identity-system/src/main/resources/mock-identity-schema.json index bebd989b..41081997 100644 --- a/mock-identity-system/src/main/resources/mock-identity-schema.json +++ b/mock-identity-system/src/main/resources/mock-identity-schema.json @@ -41,24 +41,6 @@ } ] }, - "name": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "nullable": true - }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - - } - } - } - } - ] - }, "givenName": { "allOf": [ { "$ref": "#/$defs/langField" }, @@ -241,7 +223,6 @@ "required": [ "individualId", "fullName", - "name", "givenName", "familyName", "middleName", diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java index 56896d18..9bb9f19c 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/controller/IdentityControllerTest.java @@ -57,23 +57,23 @@ public void init() { identityRequest.setIndividualId("826741183"); identityRequest.setEmail("test@gmail.com"); - List nameList=new ArrayList<>(); + List preferredNameList =new ArrayList<>(); LanguageValue engLangValue= new LanguageValue(); engLangValue.setValue("Siddharth K Mansour"); engLangValue.setLanguage("eng"); LanguageValue arabicLangValue= new LanguageValue(); arabicLangValue.setLanguage("ara"); arabicLangValue.setValue("سيدارت ك منصور"); - nameList.add(engLangValue); - nameList.add(arabicLangValue); - identityRequest.setFullName(nameList); - identityRequest.setName(nameList); - identityRequest.setFamilyName(nameList); - identityRequest.setGivenName(nameList); - identityRequest.setPreferredUsername(nameList); - identityRequest.setNickName(nameList); - identityRequest.setPreferredUsername(nameList); - identityRequest.setMiddleName(nameList); + preferredNameList.add(engLangValue); + preferredNameList.add(arabicLangValue); + identityRequest.setFullName(preferredNameList); + identityRequest.setPreferredUsername(preferredNameList); + identityRequest.setFamilyName(preferredNameList); + identityRequest.setGivenName(preferredNameList); + identityRequest.setPreferredUsername(preferredNameList); + identityRequest.setNickName(preferredNameList); + identityRequest.setPreferredUsername(preferredNameList); + identityRequest.setMiddleName(preferredNameList); LanguageValue mockLang = new LanguageValue(); mockLang.setLanguage("eng"); @@ -96,6 +96,8 @@ public void init() { identityRequest.setPin("1289001"); identityRequest.setRegion(Arrays.asList(langValue)); identityRequest.setFullName(Arrays.asList(langValue)); + identityRequest.setGivenName(Arrays.asList(langValue)); + identityRequest.setFamilyName(Arrays.asList(langValue)); identityRequest.setStreetAddress(Arrays.asList(langValue)); identityRequest.setPhone("9090909090"); identityRequest.setPreferredLang("eng"); @@ -112,8 +114,9 @@ public void createIdentity_withValidIdentity_returnSuccessResponse() throws Exce requestWrapper.setRequest(identityRequest); Mockito.doNothing().when(identityService).addIdentity(identityRequest); + mockMvc.perform(post("/identity").content(objectMapper.writeValueAsString(requestWrapper)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) .andExpect(jsonPath("$.response.status").value("mock identity data created successfully")); } @@ -126,8 +129,9 @@ public void createIdentity_withInvalidIdentity_returnErrorResponse() throws Exce requestWrapper.setRequest(identityRequest); Mockito.doNothing().when(identityService).addIdentity(identityRequest); + mockMvc.perform(post("/identity").content(objectMapper.writeValueAsString(requestWrapper)) - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) .andExpect(jsonPath("$.errors").isNotEmpty()) .andExpect(jsonPath("$.errors[0].errorCode").value("invalid_individualid")); } @@ -137,7 +141,7 @@ public void createIdentity_withInvalidNameAndLocale_returnErrorResponse() throws RequestWrapper requestWrapper = new RequestWrapper(); ZonedDateTime requestTime = ZonedDateTime.now(ZoneOffset.UTC); requestWrapper.setRequestTime(requestTime.format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN))); - identityRequest.setName(null); + identityRequest.setFullName(null); identityRequest.setLocale(null); requestWrapper.setRequest(identityRequest); @@ -172,13 +176,14 @@ public void createIdentity_withInvalidFullName_returnErrorResponse() throws Exce .andExpect(jsonPath("$.errors").isNotEmpty()) .andExpect(jsonPath("$.errors[0].errorCode").value("invalid_fullname")); } - + @Test public void getIdentity_withValidId_returnSuccessResponse() throws Exception { identityRequest.setIndividualId("123456789"); Mockito.when(identityService.getIdentity(Mockito.anyString())).thenReturn(identityRequest); + mockMvc.perform(get("/identity/{individualId}", "123456789") - .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) + .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) .andExpect(jsonPath("$.response.individualId").value("123456789")); } @@ -200,6 +205,7 @@ public void addVerifiedClaims_withValidDetails_returnSuccessResponse() throws Ex verifiedClaimRequestDto.setVerificationDetail(verificationDetail); requestWrapper.setRequest(verifiedClaimRequestDto); + Mockito.doNothing().when(identityService).addVerifiedClaim(verifiedClaimRequestDto); Mockito.when(identityService.getIdentity(Mockito.anyString())).thenReturn(identityRequest); @@ -221,6 +227,7 @@ public void addVerifiedClaim_withInvalidClaim_returnErrorResponse() throws Exce verifiedClaimRequestDto.setVerificationDetail(verificationDetail); requestWrapper.setRequest(verifiedClaimRequestDto); + Mockito.doNothing().when(identityService).addVerifiedClaim(verifiedClaimRequestDto); mockMvc.perform(post("/identity/add-verified-claim").content(objectMapper.writeValueAsString(requestWrapper)) @@ -237,6 +244,7 @@ public void updateIdentity_withValidIdentity_thenPass() throws Exception { requestWrapper.setRequest(identityRequest); Mockito.doNothing().when(identityService).updateIdentity(identityRequest); + mockMvc.perform(put("/identity").content(objectMapper.writeValueAsString(requestWrapper)) .contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()) .andExpect(jsonPath("$.response.status").value("mock Identity data updated successfully")); diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java index 0dfc90e1..8b2d8504 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/service/impl/AuthenticationServiceImplTest.java @@ -690,7 +690,7 @@ public void kycExchangeV2_withDetail_thenPass() { LanguageValue languageValueName = new LanguageValue(); languageValueName.setLanguage("eng"); languageValueName.setValue("Siddharth K Mansour"); - identityData.setName(List.of(languageValueName)); + identityData.setFullName(List.of(languageValueName)); @@ -859,7 +859,7 @@ public void kycExchangeV2_withDetailAndMatchedClaims_thenPass() { LanguageValue languageValueName = new LanguageValue(); languageValueName.setLanguage("eng"); languageValueName.setValue("Siddharth K Mansour"); - identityData.setName(List.of(languageValueName)); + identityData.setFullName(List.of(languageValueName)); // Convert IdentityData to JsonNode ObjectMapper objectMapper = new ObjectMapper(); @@ -968,7 +968,7 @@ public void kycExchangeV2_withOutVerifiedClaims_thenPass() throws InvocationTarg LanguageValue languageValueName = new LanguageValue(); languageValueName.setLanguage("eng"); languageValueName.setValue("Siddharth K Mansour"); - identityData.setName(List.of(languageValueName)); + identityData.setFullName(List.of(languageValueName)); KycExchangeRequestDtoV2 kycExchangeRequestDtoV2 = new KycExchangeRequestDtoV2(); kycExchangeRequestDtoV2.setIndividualId("individualId"); @@ -1090,12 +1090,7 @@ public void kycAuth2_withValidKbiChallenge_thenPass() throws Exception { languageValueFullName.setValue("Siddharth K Mansour"); identityData.setFullName(List.of(languageValueFullName)); - LanguageValue languageValueName = new LanguageValue(); - languageValueName.setLanguage("eng"); - languageValueName.setValue("Siddharth"); - identityData.setName(List.of(languageValueName)); - - identityData.setEncodedPhoto("encodedPhoto"); + identityData.setEncodedPhoto("encodedPhoto"); identityData.setDateOfBirth("1987/11/25"); identityData.setEmail("email@gmail.com"); @@ -1160,11 +1155,6 @@ public void kycAuth2_withValidKbiChallenge_and_withOutVerifiedClaim_thenPass() t languageValueFullName.setValue("Siddharth K Mansour"); identityData.setFullName(List.of(languageValueFullName)); - LanguageValue languageValueName = new LanguageValue(); - languageValueName.setLanguage("eng"); - languageValueName.setValue("Siddharth"); - identityData.setName(List.of(languageValueName)); - identityData.setEncodedPhoto("encodedPhoto"); identityData.setDateOfBirth("1987/11/25"); identityData.setEmail("email@gmail.com"); diff --git a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/validator/ValidatorTest.java b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/validator/ValidatorTest.java index 44144728..07dd4deb 100644 --- a/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/validator/ValidatorTest.java +++ b/mock-identity-system/src/test/java/io/mosip/esignet/mock/identitysystem/validator/ValidatorTest.java @@ -35,8 +35,6 @@ public class ValidatorTest { private static final String UTC_DATETIME_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; - @InjectMocks - private IdentityDataValidator identityDataValidator; @Test public void requestTimeValidator_withNullValue_thenFail() { @@ -68,25 +66,4 @@ public void testIsValid_ValidDateJustOutsideNegativeVariation() { assertFalse(requestTimeValidator.isValid(validDate, context)); } - @Test - public void identityDataValidator_withNullValue_thenFail() { - assertFalse(identityDataValidator.isValid(null, context)); - } - - @Test - public void identityDataValidator_withSupportedFieldsPresent_thenPass() { - List supportedFields = Arrays.asList("name", "email", "phone"); - ReflectionTestUtils.setField(identityDataValidator, "supportedFields", supportedFields); - IdentityData identityData = new IdentityData(); - LanguageValue languageValue = new LanguageValue(); - languageValue.setLanguage("en"); - languageValue.setValue("John Doe"); - - identityData.setName(List.of(languageValue)); - identityData.setEmail("john.doe@example.com"); - identityData.setPhone("1234567890"); - - assertTrue(identityDataValidator.isValid(identityData, context)); - } - } diff --git a/mock-identity-system/src/test/resources/application-test.properties b/mock-identity-system/src/test/resources/application-test.properties index f968ad02..5408cc3a 100644 --- a/mock-identity-system/src/test/resources/application-test.properties +++ b/mock-identity-system/src/test/resources/application-test.properties @@ -1,3 +1,3 @@ mosip.mock.ida.identity.schema.url=classpath:/mock-identity-test-schema.json -mosip.mock.ida.update-identity.non-mandatory.fields={"name","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} +mosip.mock.ida.update-identity.non-mandatory.fields={"givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} diff --git a/mock-identity-system/src/test/resources/mock-identity-test-schema.json b/mock-identity-system/src/test/resources/mock-identity-test-schema.json index bebd989b..41081997 100644 --- a/mock-identity-system/src/test/resources/mock-identity-test-schema.json +++ b/mock-identity-system/src/test/resources/mock-identity-test-schema.json @@ -41,24 +41,6 @@ } ] }, - "name": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "nullable": true - }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - - } - } - } - } - ] - }, "givenName": { "allOf": [ { "$ref": "#/$defs/langField" }, @@ -241,7 +223,6 @@ "required": [ "individualId", "fullName", - "name", "givenName", "familyName", "middleName", diff --git a/partner-onboarder/install.sh b/partner-onboarder/install.sh index 8656cdaa..1a3e22cd 100755 --- a/partner-onboarder/install.sh +++ b/partner-onboarder/install.sh @@ -119,7 +119,7 @@ function installing_onboarder() { echo "Istio label" kubectl label ns $NS istio-injection=disabled --overwrite - helm repo update +# helm repo update echo "Copy configmaps" COPY_UTIL=../deploy/copy_cm_func.sh diff --git a/partner-onboarder/values.yaml b/partner-onboarder/values.yaml index d1344857..23d5aea3 100644 --- a/partner-onboarder/values.yaml +++ b/partner-onboarder/values.yaml @@ -33,4 +33,4 @@ onboarding: # path: "/srv/nfs/sandbox/onboarding" # Dir within the nfs server where config repo is cloned/maintained locally. # server: "nfs-server" # Ip address of nfs server. # variables: -# push_reports_to_s3: true \ No newline at end of file +# push_reports_to_s3: true From 06cd25bb4e4f2b4fb78b5e84ddd1d1ae72ebc151 Mon Sep 17 00:00:00 2001 From: kaifk468 Date: Mon, 16 Dec 2024 01:41:56 +0530 Subject: [PATCH 22/30] remvoed @IdData validator Signed-off-by: kaifk468 --- .../mosip/esignet/mock/identitysystem/dto/IdentityData.java | 6 +----- .../src/main/resources/application-default.properties | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/IdentityData.java b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/IdentityData.java index 3f9cb811..a4928f89 100644 --- a/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/IdentityData.java +++ b/mock-identity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/IdentityData.java @@ -8,17 +8,13 @@ import java.util.List; -import javax.validation.constraints.NotBlank; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import io.mosip.esignet.mock.identitysystem.util.ErrorConstants; import lombok.Data; @Data @JsonIgnoreProperties(ignoreUnknown = true) public class IdentityData { - - @NotBlank(message = ErrorConstants.INVALID_INDIVIDUAL_ID) + String individualId; String pin; diff --git a/mock-identity-system/src/main/resources/application-default.properties b/mock-identity-system/src/main/resources/application-default.properties index 33c3511f..2be21e8e 100644 --- a/mock-identity-system/src/main/resources/application-default.properties +++ b/mock-identity-system/src/main/resources/application-default.properties @@ -120,7 +120,7 @@ mosip.kernel.keymgr.hsm.healthkey.ref-id=HEALTH_KEY ## Value to be used as partner specific token, if configured value is psut, token is generated using individualId & partnerId. if it is # configured to use any other identity fields eg: individualId -mosip.mock.ida.kyc.psut.field=psut + ##---------------------------------kbi Configurations------------------------------------------------------ From 717bfda3fc75189c3159bd37ac8817a885f6fce7 Mon Sep 17 00:00:00 2001 From: Mohd Kaif Siddique Date: Tue, 26 Nov 2024 01:35:01 +0530 Subject: [PATCH 23/30] added schema validation for IdentityData Signed-off-by: Mohd Kaif Siddique --- .../mock-identity-create-schema.json | 267 ++++++++++++++++++ .../mock-identity-update-schema.json | 254 +++++++++++++++++ 2 files changed, 521 insertions(+) create mode 100644 mock-identity-system/src/main/resources/mock-identity-create-schema.json create mode 100644 mock-identity-system/src/main/resources/mock-identity-update-schema.json diff --git a/mock-identity-system/src/main/resources/mock-identity-create-schema.json b/mock-identity-system/src/main/resources/mock-identity-create-schema.json new file mode 100644 index 00000000..69aa1151 --- /dev/null +++ b/mock-identity-system/src/main/resources/mock-identity-create-schema.json @@ -0,0 +1,267 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "$defs": { + "langField": { + "type": "array", + "items": { + "type": "object", + "properties": { + "language": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "language", + "value" + ], + "additionalProperties": false + } + } + }, + "properties": { + "individualId": { + "type": "string", + "pattern": "^\\+855\\d{9}$" + }, + "fullName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "name": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "nullable": true + }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + + } + } + } + } + ] + }, + "givenName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "familyName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "middleName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "nickName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "preferredUsername": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "gender": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "streetAddress": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + + } + } + } + } + ] + }, + "locality": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "region": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "country": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "pin": { + "type": "string", + "pattern": "\\S" + }, + "preferredLang": { + "type": "string" + }, + "dateOfBirth": { + "type": "string", + "pattern": "\\S" + }, + "postalCode": { + "type": "string", + "pattern": "\\S" + }, + "encodedPhoto": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$" + }, + "phone": { + "type": "string", + "pattern": "\\S" + }, + "zoneInfo": { + "type": "string" + }, + "locale": { + "type": "string", + "pattern": "\\S" + }, + "password": { + "type": "string", + "pattern": "\\S" + } + }, + "required": [ + "individualId", + "fullName", + "name", + "givenName", + "familyName", + "middleName", + "nickName", + "preferredUsername", + "gender", + "streetAddress", + "locality", + "region", + "country", + "pin", + "preferredLang", + "dateOfBirth", + "postalCode", + "encodedPhoto", + "email", + "phone", + "zoneInfo", + "locale", + "password" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/mock-identity-system/src/main/resources/mock-identity-update-schema.json b/mock-identity-system/src/main/resources/mock-identity-update-schema.json new file mode 100644 index 00000000..4db8b953 --- /dev/null +++ b/mock-identity-system/src/main/resources/mock-identity-update-schema.json @@ -0,0 +1,254 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "$defs": { + "langField": { + "type": "array", + "items": { + "type": "object", + "properties": { + "language": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + }, + "required": [ + "language", + "value" + ], + "additionalProperties": false + }, + "nullable": true + } + }, + "properties": { + "individualId": { + "type": "string", + "pattern": "^\\+855\\d{9}$" + }, + "fullName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "name": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + + } + } + } + } + ] + }, + "givenName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "familyName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "middleName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "nickName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "preferredUsername": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "gender": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "streetAddress": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + + } + } + } + } + ] + }, + "locality": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "region": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "country": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "pin": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "preferredLang": { + "type": "string", + "nullable": true + }, + "dateOfBirth": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "postalCode": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "encodedPhoto": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$", + "nullable": true + }, + "phone": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "zoneInfo": { + "type": "string", + "nullable": true + }, + "locale": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "password": { + "type": "string", + "pattern": "\\S", + "nullable": true + } + }, + "required": [ + "individualId" + ], + "additionalProperties": false +} \ No newline at end of file From 98b7be18102d8165ce5469676f489146f584fef7 Mon Sep 17 00:00:00 2001 From: Mohd Kaif Siddique Date: Fri, 29 Nov 2024 15:59:13 +0530 Subject: [PATCH 24/30] modified schema validation now only one schema required to validate bot create and update identity object Signed-off-by: Mohd Kaif Siddique --- .../mock-identity-create-schema.json | 267 ------------------ .../mock-identity-update-schema.json | 254 ----------------- 2 files changed, 521 deletions(-) delete mode 100644 mock-identity-system/src/main/resources/mock-identity-create-schema.json delete mode 100644 mock-identity-system/src/main/resources/mock-identity-update-schema.json diff --git a/mock-identity-system/src/main/resources/mock-identity-create-schema.json b/mock-identity-system/src/main/resources/mock-identity-create-schema.json deleted file mode 100644 index 69aa1151..00000000 --- a/mock-identity-system/src/main/resources/mock-identity-create-schema.json +++ /dev/null @@ -1,267 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "$defs": { - "langField": { - "type": "array", - "items": { - "type": "object", - "properties": { - "language": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "required": [ - "language", - "value" - ], - "additionalProperties": false - } - } - }, - "properties": { - "individualId": { - "type": "string", - "pattern": "^\\+855\\d{9}$" - }, - "fullName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "name": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "nullable": true - }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - - } - } - } - } - ] - }, - "givenName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "familyName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "middleName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "nickName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "preferredUsername": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "gender": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "streetAddress": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - - } - } - } - } - ] - }, - "locality": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "region": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "country": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "pin": { - "type": "string", - "pattern": "\\S" - }, - "preferredLang": { - "type": "string" - }, - "dateOfBirth": { - "type": "string", - "pattern": "\\S" - }, - "postalCode": { - "type": "string", - "pattern": "\\S" - }, - "encodedPhoto": { - "type": "string" - }, - "email": { - "type": "string", - "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$" - }, - "phone": { - "type": "string", - "pattern": "\\S" - }, - "zoneInfo": { - "type": "string" - }, - "locale": { - "type": "string", - "pattern": "\\S" - }, - "password": { - "type": "string", - "pattern": "\\S" - } - }, - "required": [ - "individualId", - "fullName", - "name", - "givenName", - "familyName", - "middleName", - "nickName", - "preferredUsername", - "gender", - "streetAddress", - "locality", - "region", - "country", - "pin", - "preferredLang", - "dateOfBirth", - "postalCode", - "encodedPhoto", - "email", - "phone", - "zoneInfo", - "locale", - "password" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/mock-identity-system/src/main/resources/mock-identity-update-schema.json b/mock-identity-system/src/main/resources/mock-identity-update-schema.json deleted file mode 100644 index 4db8b953..00000000 --- a/mock-identity-system/src/main/resources/mock-identity-update-schema.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "$defs": { - "langField": { - "type": "array", - "items": { - "type": "object", - "properties": { - "language": { - "type": "string", - "nullable": true - }, - "value": { - "type": "string", - "nullable": true - } - }, - "required": [ - "language", - "value" - ], - "additionalProperties": false - }, - "nullable": true - } - }, - "properties": { - "individualId": { - "type": "string", - "pattern": "^\\+855\\d{9}$" - }, - "fullName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "name": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - - } - } - } - } - ] - }, - "givenName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "familyName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "middleName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "nickName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "preferredUsername": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "gender": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "streetAddress": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - - } - } - } - } - ] - }, - "locality": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "region": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "country": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "pin": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "preferredLang": { - "type": "string", - "nullable": true - }, - "dateOfBirth": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "postalCode": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "encodedPhoto": { - "type": "string" - }, - "email": { - "type": "string", - "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$", - "nullable": true - }, - "phone": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "zoneInfo": { - "type": "string", - "nullable": true - }, - "locale": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "password": { - "type": "string", - "pattern": "\\S", - "nullable": true - } - }, - "required": [ - "individualId" - ], - "additionalProperties": false -} \ No newline at end of file From 0ca3a29b9084f9c774802abf94e8de94e8863c48 Mon Sep 17 00:00:00 2001 From: Chandra Keshav Mishra Date: Tue, 15 Oct 2024 23:36:57 +0530 Subject: [PATCH 25/30] Release 0.10.x (#275) * ES-842 corrected the verified claims logi (#249) Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * modified getLanguageValuesList method (#250) Signed-off-by: Mohd Kaif Siddique Co-authored-by: Mohd Kaif Siddique Signed-off-by: Chandra Keshav Mishra * [ES-1678] Added a new error message for the ekyc failure in i18n. Signed-off-by: GurukiranP Signed-off-by: Chandra Keshav Mishra * Updated readme and docker compose Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] removed deployment script and updated chart Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] corrected chart lint yaml Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] moved deployment scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updarted chart values for latest changes to remove artifactory and config server dependency Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] moved db-init scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated db-init scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-identity-system scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-relying-party-service scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-relying-party-ui scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added install-all.sh, delete-all.sh, restart-all.sh scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updated installation scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updated README and installation scripts comments Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added changes for partner onboarder to store reports in volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] removed unused secret creation Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [INJICERT-434] optionally support using arbitrary field as PSUT value (#258) * [INJICERT-434] optionally support using individualID as PSUT Purpose: to break Certify <--> Mock DataProviderPlugin dependency wrt OIDCTransaction object stored in Redis Config changes required: * Introduces a config but does not break existing default behaviour, so no explicit change required Signed-off-by: Harsh Vardhan * [INJICERT-434] allow PSUT to set to any configured field * by default the kycAuth response will have the psut field, but this can be configured to have some other user data in the clear if required Breaking changes: None. The changes are backwards compatible Signed-off-by: Harsh Vardhan --------- Signed-off-by: Harsh Vardhan Signed-off-by: Chandra Keshav Mishra * [ES-1689] added test case (#259) Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: Chandra Keshav Mishra * moved tomcat and prometheus configuration to bootstrap.properties Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35987] updated onboarder to support storing reports in nfs volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * Updated Readme and pom version Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] added prompt to install services Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] removed unused clusterRolebinding Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated changes to fix dev testing issues Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated correct onboarder chart version (#272) Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * Added JsonIgnoreProperties for kyc auth and exchange requests (#269) Signed-off-by: piyush-shukla03_infosys Co-authored-by: piyush-shukla03_infosys Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated partner onboarder install script Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * resolved lint failures (#277) Signed-off-by: Chandra Keshav Mishra --------- Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Mohd Kaif Siddique Signed-off-by: GurukiranP Signed-off-by: ckm007 Signed-off-by: Harsh Vardhan Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: piyush-shukla03_infosys Co-authored-by: ase-101 Co-authored-by: Kaif Siddique <74772315+kaifk468@users.noreply.github.com> Co-authored-by: Mohd Kaif Siddique Co-authored-by: GurukiranP Co-authored-by: Harsh Vardhan Co-authored-by: pvsaidurga <132046494+pvsaidurga@users.noreply.github.com> Co-authored-by: Piyush7034 <47858366+Piyush7034@users.noreply.github.com> Co-authored-by: piyush-shukla03_infosys --- partner-onboarder/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner-onboarder/install.sh b/partner-onboarder/install.sh index 1a3e22cd..8656cdaa 100755 --- a/partner-onboarder/install.sh +++ b/partner-onboarder/install.sh @@ -119,7 +119,7 @@ function installing_onboarder() { echo "Istio label" kubectl label ns $NS istio-injection=disabled --overwrite -# helm repo update + helm repo update echo "Copy configmaps" COPY_UTIL=../deploy/copy_cm_func.sh From c8a32129931a724c9c2b01a398d18392da31e590 Mon Sep 17 00:00:00 2001 From: Zeeshan Mehboob <82993262+zesu22@users.noreply.github.com> Date: Tue, 3 Dec 2024 23:37:25 +0530 Subject: [PATCH 26/30] [ES-1966] merge code from release to develop (#290) * ES-1638 Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-1638 Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Added docker compose file Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Deleted external configuration file Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Deleted external configuration file Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-842 (#245) Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-1638 Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-1638 (#247) Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-1638 Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-842 corrected the verified claims logi (#249) Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * modified getLanguageValuesList method (#250) Signed-off-by: Mohd Kaif Siddique Co-authored-by: Mohd Kaif Siddique Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [ES-1678] Added a new error message for the ekyc failure in i18n. Signed-off-by: GurukiranP Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * Updated readme and docker compose Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] removed deployment script and updated chart Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] corrected chart lint yaml Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] moved deployment scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] updarted chart values for latest changes to remove artifactory and config server dependency Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] moved db-init scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added updated db-init scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added updated mock-identity-system scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added updated mock-relying-party-service scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added updated mock-relying-party-ui scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added install-all.sh, delete-all.sh, restart-all.sh scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] updated installation scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] updated README and installation scripts comments Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added changes for partner onboarder to store reports in volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] removed unused secret creation Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [INJICERT-434] optionally support using arbitrary field as PSUT value (#258) * [INJICERT-434] optionally support using individualID as PSUT Purpose: to break Certify <--> Mock DataProviderPlugin dependency wrt OIDCTransaction object stored in Redis Config changes required: * Introduces a config but does not break existing default behaviour, so no explicit change required Signed-off-by: Harsh Vardhan * [INJICERT-434] allow PSUT to set to any configured field * by default the kycAuth response will have the psut field, but this can be configured to have some other user data in the clear if required Breaking changes: None. The changes are backwards compatible Signed-off-by: Harsh Vardhan --------- Signed-off-by: Harsh Vardhan Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [ES-1689] added test case (#259) Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * moved tomcat and prometheus configuration to bootstrap.properties Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35987] updated onboarder to support storing reports in nfs volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * Updated Readme and pom version Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [DSD-6382] added prompt to install services Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [DSD-6382] removed unused clusterRolebinding Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [DSD-6382] updated changes to fix dev testing issues Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [DSD-6382] updated correct onboarder chart version (#272) Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * Added JsonIgnoreProperties for kyc auth and exchange requests (#269) Signed-off-by: piyush-shukla03_infosys Co-authored-by: piyush-shukla03_infosys Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [DSD-6382] updated partner onboarder install script Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] removed deployment script and updated chart Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added updated mock-identity-system scripts Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added install-all.sh, delete-all.sh, restart-all.sh scripts Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] updated installation scripts Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] updated README and installation scripts comments Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added changes for partner onboarder to store reports in volume Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [ES-1689] (#271) * [ES-1689] Signed-off-by: Venkata Saidurga Polamraju * [ES-1689] Signed-off-by: Venkata Saidurga Polamraju * [ES-1689] Updated the review comments Signed-off-by: Venkata Saidurga Polamraju --------- Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: Zeeshan Mehboob * [DSD-6445]Updated install.sh Signed-off-by: Rakshitha650 <76676196+Rakshitha650@users.noreply.github.com> Signed-off-by: Zeeshan Mehboob * [DSD-6445]Updated install.sh Signed-off-by: Rakshitha650 <76676196+Rakshitha650@users.noreply.github.com> Signed-off-by: Zeeshan Mehboob * [ES-1842] i18n translation changes. Signed-off-by: GurukiranP Signed-off-by: Zeeshan Mehboob * Fixed the properties file, created only master copy of properties Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Corrected test case and active profile Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Updated the image name Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Release 0.10.x (#275) * ES-842 corrected the verified claims logi (#249) Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * modified getLanguageValuesList method (#250) Signed-off-by: Mohd Kaif Siddique Co-authored-by: Mohd Kaif Siddique Signed-off-by: Chandra Keshav Mishra * [ES-1678] Added a new error message for the ekyc failure in i18n. Signed-off-by: GurukiranP Signed-off-by: Chandra Keshav Mishra * Updated readme and docker compose Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] removed deployment script and updated chart Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] corrected chart lint yaml Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] moved deployment scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updarted chart values for latest changes to remove artifactory and config server dependency Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] moved db-init scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated db-init scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-identity-system scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-relying-party-service scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-relying-party-ui scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added install-all.sh, delete-all.sh, restart-all.sh scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updated installation scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updated README and installation scripts comments Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added changes for partner onboarder to store reports in volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] removed unused secret creation Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [INJICERT-434] optionally support using arbitrary field as PSUT value (#258) * [INJICERT-434] optionally support using individualID as PSUT Purpose: to break Certify <--> Mock DataProviderPlugin dependency wrt OIDCTransaction object stored in Redis Config changes required: * Introduces a config but does not break existing default behaviour, so no explicit change required Signed-off-by: Harsh Vardhan * [INJICERT-434] allow PSUT to set to any configured field * by default the kycAuth response will have the psut field, but this can be configured to have some other user data in the clear if required Breaking changes: None. The changes are backwards compatible Signed-off-by: Harsh Vardhan --------- Signed-off-by: Harsh Vardhan Signed-off-by: Chandra Keshav Mishra * [ES-1689] added test case (#259) Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: Chandra Keshav Mishra * moved tomcat and prometheus configuration to bootstrap.properties Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35987] updated onboarder to support storing reports in nfs volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * Updated Readme and pom version Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] added prompt to install services Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] removed unused clusterRolebinding Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated changes to fix dev testing issues Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated correct onboarder chart version (#272) Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * Added JsonIgnoreProperties for kyc auth and exchange requests (#269) Signed-off-by: piyush-shukla03_infosys Co-authored-by: piyush-shukla03_infosys Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated partner onboarder install script Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * resolved lint failures (#277) Signed-off-by: Chandra Keshav Mishra --------- Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Mohd Kaif Siddique Signed-off-by: GurukiranP Signed-off-by: ckm007 Signed-off-by: Harsh Vardhan Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: piyush-shukla03_infosys Co-authored-by: ase-101 Co-authored-by: Kaif Siddique <74772315+kaifk468@users.noreply.github.com> Co-authored-by: Mohd Kaif Siddique Co-authored-by: GurukiranP Co-authored-by: Harsh Vardhan Co-authored-by: pvsaidurga <132046494+pvsaidurga@users.noreply.github.com> Co-authored-by: Piyush7034 <47858366+Piyush7034@users.noreply.github.com> Co-authored-by: piyush-shukla03_infosys Signed-off-by: Zeeshan Mehboob * [ES-1859] Added a new error code in the i18n. Signed-off-by: GurukiranP Signed-off-by: Zeeshan Mehboob * [MOSIP-35892] Updated helm charts to add range Signed-off-by: Rakshithb1 Signed-off-by: Zeeshan Mehboob * [ES-1842] i18n translation changes. Signed-off-by: GurukiranP Signed-off-by: Zeeshan Mehboob * [ES-1899] Added log for testing. (#284) Signed-off-by: GurukiranP Signed-off-by: Zeeshan Mehboob * [MOSIP-37447] updated install.sh script for mosipid check Signed-off-by: bhumi46 Signed-off-by: Zeeshan Mehboob * [MOSIP-37447] updated install.sh script for mosipid check Signed-off-by: bhumi46 Signed-off-by: Zeeshan Mehboob * [ES-1860] Updated package.json and package-lock.json files . Signed-off-by: GurukiranP Signed-off-by: Zeeshan Mehboob --------- Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob Signed-off-by: Chandra Keshav Mishra Signed-off-by: Mohd Kaif Siddique Signed-off-by: GurukiranP Signed-off-by: ckm007 Signed-off-by: Harsh Vardhan Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: piyush-shukla03_infosys Signed-off-by: Rakshitha650 <76676196+Rakshitha650@users.noreply.github.com> Signed-off-by: Rakshithb1 Signed-off-by: bhumi46 Signed-off-by: Zeeshan Mehboob <82993262+zesu22@users.noreply.github.com> Co-authored-by: ase-101 Co-authored-by: Kaif Siddique <74772315+kaifk468@users.noreply.github.com> Co-authored-by: Mohd Kaif Siddique Co-authored-by: GurukiranP Co-authored-by: ckm007 Co-authored-by: Harsh Vardhan Co-authored-by: pvsaidurga <132046494+pvsaidurga@users.noreply.github.com> Co-authored-by: Piyush7034 <47858366+Piyush7034@users.noreply.github.com> Co-authored-by: piyush-shukla03_infosys Co-authored-by: Rakshitha650 <76676196+Rakshitha650@users.noreply.github.com> Co-authored-by: Rakshithb1 Co-authored-by: Gk <76690271+gk-4VII@users.noreply.github.com> Co-authored-by: bhumi46 --- partner-onboarder/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner-onboarder/install.sh b/partner-onboarder/install.sh index 8656cdaa..1a3e22cd 100755 --- a/partner-onboarder/install.sh +++ b/partner-onboarder/install.sh @@ -119,7 +119,7 @@ function installing_onboarder() { echo "Istio label" kubectl label ns $NS istio-injection=disabled --overwrite - helm repo update +# helm repo update echo "Copy configmaps" COPY_UTIL=../deploy/copy_cm_func.sh From f72ff8fd227566a0fd97fc4b87fef7ceb8b24b02 Mon Sep 17 00:00:00 2001 From: Mohd Kaif Siddique Date: Tue, 26 Nov 2024 01:35:01 +0530 Subject: [PATCH 27/30] added schema validation for IdentityData Signed-off-by: Mohd Kaif Siddique Signed-off-by: kaifk468 --- .../resources/application-default.properties | 5 - .../mock-identity-create-schema.json | 267 ++++++++++++++++++ .../mock-identity-update-schema.json | 254 +++++++++++++++++ 3 files changed, 521 insertions(+), 5 deletions(-) create mode 100644 mock-identity-system/src/main/resources/mock-identity-create-schema.json create mode 100644 mock-identity-system/src/main/resources/mock-identity-update-schema.json diff --git a/mock-identity-system/src/main/resources/application-default.properties b/mock-identity-system/src/main/resources/application-default.properties index 2be21e8e..21187378 100644 --- a/mock-identity-system/src/main/resources/application-default.properties +++ b/mock-identity-system/src/main/resources/application-default.properties @@ -25,11 +25,6 @@ # mosip.api.internal.url # mosip.api.public.url -##-----------------------------------------Mock-identity-system properties---------------------------------------------- - -mosip.mock.ida.identity.schema.url=classpath:/mock-identity-schema.json -mosip.mock.ida.update-identity.non-mandatory.fields={"fullName","givenName","familyName","middleName","nickName","preferredUsername","gender","streetAddress","locality","region","country","pin","preferredLang","dateOfBirth","postalCode","encodedPhoto","email","phone","zoneInfo","locale","password"} - ##----------------------------------------- Database properties -------------------------------------------------------- mosip.mockidentitysystem.database.hostname=${database.host} mosip.mockidentitysystem.database.port=${database.port} diff --git a/mock-identity-system/src/main/resources/mock-identity-create-schema.json b/mock-identity-system/src/main/resources/mock-identity-create-schema.json new file mode 100644 index 00000000..69aa1151 --- /dev/null +++ b/mock-identity-system/src/main/resources/mock-identity-create-schema.json @@ -0,0 +1,267 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "$defs": { + "langField": { + "type": "array", + "items": { + "type": "object", + "properties": { + "language": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "language", + "value" + ], + "additionalProperties": false + } + } + }, + "properties": { + "individualId": { + "type": "string", + "pattern": "^\\+855\\d{9}$" + }, + "fullName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "name": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "nullable": true + }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + + } + } + } + } + ] + }, + "givenName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "familyName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "middleName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "nickName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "preferredUsername": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "gender": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "streetAddress": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + + } + } + } + } + ] + }, + "locality": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "region": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "country": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "pin": { + "type": "string", + "pattern": "\\S" + }, + "preferredLang": { + "type": "string" + }, + "dateOfBirth": { + "type": "string", + "pattern": "\\S" + }, + "postalCode": { + "type": "string", + "pattern": "\\S" + }, + "encodedPhoto": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$" + }, + "phone": { + "type": "string", + "pattern": "\\S" + }, + "zoneInfo": { + "type": "string" + }, + "locale": { + "type": "string", + "pattern": "\\S" + }, + "password": { + "type": "string", + "pattern": "\\S" + } + }, + "required": [ + "individualId", + "fullName", + "name", + "givenName", + "familyName", + "middleName", + "nickName", + "preferredUsername", + "gender", + "streetAddress", + "locality", + "region", + "country", + "pin", + "preferredLang", + "dateOfBirth", + "postalCode", + "encodedPhoto", + "email", + "phone", + "zoneInfo", + "locale", + "password" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/mock-identity-system/src/main/resources/mock-identity-update-schema.json b/mock-identity-system/src/main/resources/mock-identity-update-schema.json new file mode 100644 index 00000000..4db8b953 --- /dev/null +++ b/mock-identity-system/src/main/resources/mock-identity-update-schema.json @@ -0,0 +1,254 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "$defs": { + "langField": { + "type": "array", + "items": { + "type": "object", + "properties": { + "language": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + }, + "required": [ + "language", + "value" + ], + "additionalProperties": false + }, + "nullable": true + } + }, + "properties": { + "individualId": { + "type": "string", + "pattern": "^\\+855\\d{9}$" + }, + "fullName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "name": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + + } + } + } + } + ] + }, + "givenName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "familyName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "middleName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "nickName": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "preferredUsername": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" + } + } + } + } + ] + }, + "gender": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "streetAddress": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + + } + } + } + } + ] + }, + "locality": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "region": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" + } + } + } + } + ] + }, + "country": { + "allOf": [ + { "$ref": "#/$defs/langField" }, + { + "items": { + "properties": { + "value": { + "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" + } + } + } + } + ] + }, + "pin": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "preferredLang": { + "type": "string", + "nullable": true + }, + "dateOfBirth": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "postalCode": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "encodedPhoto": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$", + "nullable": true + }, + "phone": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "zoneInfo": { + "type": "string", + "nullable": true + }, + "locale": { + "type": "string", + "pattern": "\\S", + "nullable": true + }, + "password": { + "type": "string", + "pattern": "\\S", + "nullable": true + } + }, + "required": [ + "individualId" + ], + "additionalProperties": false +} \ No newline at end of file From 4e94a88aca5d0f650481fa51c58b438405948f5e Mon Sep 17 00:00:00 2001 From: Mohd Kaif Siddique Date: Fri, 29 Nov 2024 15:59:13 +0530 Subject: [PATCH 28/30] modified schema validation now only one schema required to validate bot create and update identity object Signed-off-by: Mohd Kaif Siddique Signed-off-by: kaifk468 --- .../mock-identity-create-schema.json | 267 ------------------ .../mock-identity-update-schema.json | 254 ----------------- 2 files changed, 521 deletions(-) delete mode 100644 mock-identity-system/src/main/resources/mock-identity-create-schema.json delete mode 100644 mock-identity-system/src/main/resources/mock-identity-update-schema.json diff --git a/mock-identity-system/src/main/resources/mock-identity-create-schema.json b/mock-identity-system/src/main/resources/mock-identity-create-schema.json deleted file mode 100644 index 69aa1151..00000000 --- a/mock-identity-system/src/main/resources/mock-identity-create-schema.json +++ /dev/null @@ -1,267 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "$defs": { - "langField": { - "type": "array", - "items": { - "type": "object", - "properties": { - "language": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "required": [ - "language", - "value" - ], - "additionalProperties": false - } - } - }, - "properties": { - "individualId": { - "type": "string", - "pattern": "^\\+855\\d{9}$" - }, - "fullName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "name": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "nullable": true - }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - - } - } - } - } - ] - }, - "givenName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "familyName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "middleName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "nickName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "preferredUsername": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "gender": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "streetAddress": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - - } - } - } - } - ] - }, - "locality": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "region": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "country": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "pin": { - "type": "string", - "pattern": "\\S" - }, - "preferredLang": { - "type": "string" - }, - "dateOfBirth": { - "type": "string", - "pattern": "\\S" - }, - "postalCode": { - "type": "string", - "pattern": "\\S" - }, - "encodedPhoto": { - "type": "string" - }, - "email": { - "type": "string", - "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$" - }, - "phone": { - "type": "string", - "pattern": "\\S" - }, - "zoneInfo": { - "type": "string" - }, - "locale": { - "type": "string", - "pattern": "\\S" - }, - "password": { - "type": "string", - "pattern": "\\S" - } - }, - "required": [ - "individualId", - "fullName", - "name", - "givenName", - "familyName", - "middleName", - "nickName", - "preferredUsername", - "gender", - "streetAddress", - "locality", - "region", - "country", - "pin", - "preferredLang", - "dateOfBirth", - "postalCode", - "encodedPhoto", - "email", - "phone", - "zoneInfo", - "locale", - "password" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/mock-identity-system/src/main/resources/mock-identity-update-schema.json b/mock-identity-system/src/main/resources/mock-identity-update-schema.json deleted file mode 100644 index 4db8b953..00000000 --- a/mock-identity-system/src/main/resources/mock-identity-update-schema.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "$defs": { - "langField": { - "type": "array", - "items": { - "type": "object", - "properties": { - "language": { - "type": "string", - "nullable": true - }, - "value": { - "type": "string", - "nullable": true - } - }, - "required": [ - "language", - "value" - ], - "additionalProperties": false - }, - "nullable": true - } - }, - "properties": { - "individualId": { - "type": "string", - "pattern": "^\\+855\\d{9}$" - }, - "fullName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "name": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - - } - } - } - } - ] - }, - "givenName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "familyName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "middleName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "nickName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "preferredUsername": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "gender": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "streetAddress": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - - } - } - } - } - ] - }, - "locality": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "region": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "country": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "pin": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "preferredLang": { - "type": "string", - "nullable": true - }, - "dateOfBirth": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "postalCode": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "encodedPhoto": { - "type": "string" - }, - "email": { - "type": "string", - "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$", - "nullable": true - }, - "phone": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "zoneInfo": { - "type": "string", - "nullable": true - }, - "locale": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "password": { - "type": "string", - "pattern": "\\S", - "nullable": true - } - }, - "required": [ - "individualId" - ], - "additionalProperties": false -} \ No newline at end of file From d95b7ecb0433c1f581861f3288ecbc7fa37b509a Mon Sep 17 00:00:00 2001 From: Chandra Keshav Mishra Date: Tue, 15 Oct 2024 23:36:57 +0530 Subject: [PATCH 29/30] Release 0.10.x (#275) * ES-842 corrected the verified claims logi (#249) Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * modified getLanguageValuesList method (#250) Signed-off-by: Mohd Kaif Siddique Co-authored-by: Mohd Kaif Siddique Signed-off-by: Chandra Keshav Mishra * [ES-1678] Added a new error message for the ekyc failure in i18n. Signed-off-by: GurukiranP Signed-off-by: Chandra Keshav Mishra * Updated readme and docker compose Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] removed deployment script and updated chart Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] corrected chart lint yaml Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] moved deployment scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updarted chart values for latest changes to remove artifactory and config server dependency Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] moved db-init scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated db-init scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-identity-system scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-relying-party-service scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-relying-party-ui scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added install-all.sh, delete-all.sh, restart-all.sh scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updated installation scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updated README and installation scripts comments Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added changes for partner onboarder to store reports in volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] removed unused secret creation Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [INJICERT-434] optionally support using arbitrary field as PSUT value (#258) * [INJICERT-434] optionally support using individualID as PSUT Purpose: to break Certify <--> Mock DataProviderPlugin dependency wrt OIDCTransaction object stored in Redis Config changes required: * Introduces a config but does not break existing default behaviour, so no explicit change required Signed-off-by: Harsh Vardhan * [INJICERT-434] allow PSUT to set to any configured field * by default the kycAuth response will have the psut field, but this can be configured to have some other user data in the clear if required Breaking changes: None. The changes are backwards compatible Signed-off-by: Harsh Vardhan --------- Signed-off-by: Harsh Vardhan Signed-off-by: Chandra Keshav Mishra * [ES-1689] added test case (#259) Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: Chandra Keshav Mishra * moved tomcat and prometheus configuration to bootstrap.properties Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35987] updated onboarder to support storing reports in nfs volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * Updated Readme and pom version Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] added prompt to install services Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] removed unused clusterRolebinding Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated changes to fix dev testing issues Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated correct onboarder chart version (#272) Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * Added JsonIgnoreProperties for kyc auth and exchange requests (#269) Signed-off-by: piyush-shukla03_infosys Co-authored-by: piyush-shukla03_infosys Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated partner onboarder install script Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * resolved lint failures (#277) Signed-off-by: Chandra Keshav Mishra --------- Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Mohd Kaif Siddique Signed-off-by: GurukiranP Signed-off-by: ckm007 Signed-off-by: Harsh Vardhan Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: piyush-shukla03_infosys Co-authored-by: ase-101 Co-authored-by: Kaif Siddique <74772315+kaifk468@users.noreply.github.com> Co-authored-by: Mohd Kaif Siddique Co-authored-by: GurukiranP Co-authored-by: Harsh Vardhan Co-authored-by: pvsaidurga <132046494+pvsaidurga@users.noreply.github.com> Co-authored-by: Piyush7034 <47858366+Piyush7034@users.noreply.github.com> Co-authored-by: piyush-shukla03_infosys Signed-off-by: kaifk468 --- partner-onboarder/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner-onboarder/install.sh b/partner-onboarder/install.sh index 1a3e22cd..8656cdaa 100755 --- a/partner-onboarder/install.sh +++ b/partner-onboarder/install.sh @@ -119,7 +119,7 @@ function installing_onboarder() { echo "Istio label" kubectl label ns $NS istio-injection=disabled --overwrite -# helm repo update + helm repo update echo "Copy configmaps" COPY_UTIL=../deploy/copy_cm_func.sh From ca064d409daf5cb873b4adc1f7528ea55005d0c0 Mon Sep 17 00:00:00 2001 From: Zeeshan Mehboob <82993262+zesu22@users.noreply.github.com> Date: Tue, 3 Dec 2024 23:37:25 +0530 Subject: [PATCH 30/30] [ES-1966] merge code from release to develop (#290) * ES-1638 Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-1638 Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Added docker compose file Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Deleted external configuration file Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Deleted external configuration file Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-842 (#245) Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-1638 Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-1638 (#247) Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-1638 Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * ES-842 corrected the verified claims logi (#249) Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * modified getLanguageValuesList method (#250) Signed-off-by: Mohd Kaif Siddique Co-authored-by: Mohd Kaif Siddique Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [ES-1678] Added a new error message for the ekyc failure in i18n. Signed-off-by: GurukiranP Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * Updated readme and docker compose Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] removed deployment script and updated chart Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] corrected chart lint yaml Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] moved deployment scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] updarted chart values for latest changes to remove artifactory and config server dependency Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] moved db-init scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added updated db-init scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added updated mock-identity-system scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added updated mock-relying-party-service scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added updated mock-relying-party-ui scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added install-all.sh, delete-all.sh, restart-all.sh scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] updated installation scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] updated README and installation scripts comments Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added changes for partner onboarder to store reports in volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] removed unused secret creation Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [INJICERT-434] optionally support using arbitrary field as PSUT value (#258) * [INJICERT-434] optionally support using individualID as PSUT Purpose: to break Certify <--> Mock DataProviderPlugin dependency wrt OIDCTransaction object stored in Redis Config changes required: * Introduces a config but does not break existing default behaviour, so no explicit change required Signed-off-by: Harsh Vardhan * [INJICERT-434] allow PSUT to set to any configured field * by default the kycAuth response will have the psut field, but this can be configured to have some other user data in the clear if required Breaking changes: None. The changes are backwards compatible Signed-off-by: Harsh Vardhan --------- Signed-off-by: Harsh Vardhan Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [ES-1689] added test case (#259) Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * moved tomcat and prometheus configuration to bootstrap.properties Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35987] updated onboarder to support storing reports in nfs volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * Updated Readme and pom version Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [DSD-6382] added prompt to install services Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [DSD-6382] removed unused clusterRolebinding Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [DSD-6382] updated changes to fix dev testing issues Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [DSD-6382] updated correct onboarder chart version (#272) Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * Added JsonIgnoreProperties for kyc auth and exchange requests (#269) Signed-off-by: piyush-shukla03_infosys Co-authored-by: piyush-shukla03_infosys Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [DSD-6382] updated partner onboarder install script Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] removed deployment script and updated chart Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added updated mock-identity-system scripts Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added install-all.sh, delete-all.sh, restart-all.sh scripts Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] updated installation scripts Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] updated README and installation scripts comments Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [MOSIP-35816] added changes for partner onboarder to store reports in volume Signed-off-by: ckm007 Signed-off-by: Zeeshan Mehboob * [ES-1689] (#271) * [ES-1689] Signed-off-by: Venkata Saidurga Polamraju * [ES-1689] Signed-off-by: Venkata Saidurga Polamraju * [ES-1689] Updated the review comments Signed-off-by: Venkata Saidurga Polamraju --------- Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: Zeeshan Mehboob * [DSD-6445]Updated install.sh Signed-off-by: Rakshitha650 <76676196+Rakshitha650@users.noreply.github.com> Signed-off-by: Zeeshan Mehboob * [DSD-6445]Updated install.sh Signed-off-by: Rakshitha650 <76676196+Rakshitha650@users.noreply.github.com> Signed-off-by: Zeeshan Mehboob * [ES-1842] i18n translation changes. Signed-off-by: GurukiranP Signed-off-by: Zeeshan Mehboob * Fixed the properties file, created only master copy of properties Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Corrected test case and active profile Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Updated the image name Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob * Release 0.10.x (#275) * ES-842 corrected the verified claims logi (#249) Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * modified getLanguageValuesList method (#250) Signed-off-by: Mohd Kaif Siddique Co-authored-by: Mohd Kaif Siddique Signed-off-by: Chandra Keshav Mishra * [ES-1678] Added a new error message for the ekyc failure in i18n. Signed-off-by: GurukiranP Signed-off-by: Chandra Keshav Mishra * Updated readme and docker compose Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] removed deployment script and updated chart Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] corrected chart lint yaml Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] moved deployment scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updarted chart values for latest changes to remove artifactory and config server dependency Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] moved db-init scripts to deploy Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated db-init scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-identity-system scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-relying-party-service scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added updated mock-relying-party-ui scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added install-all.sh, delete-all.sh, restart-all.sh scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updated installation scripts Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] updated README and installation scripts comments Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] added changes for partner onboarder to store reports in volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35816] removed unused secret creation Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [INJICERT-434] optionally support using arbitrary field as PSUT value (#258) * [INJICERT-434] optionally support using individualID as PSUT Purpose: to break Certify <--> Mock DataProviderPlugin dependency wrt OIDCTransaction object stored in Redis Config changes required: * Introduces a config but does not break existing default behaviour, so no explicit change required Signed-off-by: Harsh Vardhan * [INJICERT-434] allow PSUT to set to any configured field * by default the kycAuth response will have the psut field, but this can be configured to have some other user data in the clear if required Breaking changes: None. The changes are backwards compatible Signed-off-by: Harsh Vardhan --------- Signed-off-by: Harsh Vardhan Signed-off-by: Chandra Keshav Mishra * [ES-1689] added test case (#259) Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: Chandra Keshav Mishra * moved tomcat and prometheus configuration to bootstrap.properties Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [MOSIP-35987] updated onboarder to support storing reports in nfs volume Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * Updated Readme and pom version Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] added prompt to install services Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] removed unused clusterRolebinding Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated changes to fix dev testing issues Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated correct onboarder chart version (#272) Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * Added JsonIgnoreProperties for kyc auth and exchange requests (#269) Signed-off-by: piyush-shukla03_infosys Co-authored-by: piyush-shukla03_infosys Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra * [DSD-6382] updated partner onboarder install script Signed-off-by: ckm007 Signed-off-by: Chandra Keshav Mishra * resolved lint failures (#277) Signed-off-by: Chandra Keshav Mishra --------- Signed-off-by: ase-101 Signed-off-by: Chandra Keshav Mishra Signed-off-by: Mohd Kaif Siddique Signed-off-by: GurukiranP Signed-off-by: ckm007 Signed-off-by: Harsh Vardhan Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: piyush-shukla03_infosys Co-authored-by: ase-101 Co-authored-by: Kaif Siddique <74772315+kaifk468@users.noreply.github.com> Co-authored-by: Mohd Kaif Siddique Co-authored-by: GurukiranP Co-authored-by: Harsh Vardhan Co-authored-by: pvsaidurga <132046494+pvsaidurga@users.noreply.github.com> Co-authored-by: Piyush7034 <47858366+Piyush7034@users.noreply.github.com> Co-authored-by: piyush-shukla03_infosys Signed-off-by: Zeeshan Mehboob * [ES-1859] Added a new error code in the i18n. Signed-off-by: GurukiranP Signed-off-by: Zeeshan Mehboob * [MOSIP-35892] Updated helm charts to add range Signed-off-by: Rakshithb1 Signed-off-by: Zeeshan Mehboob * [ES-1842] i18n translation changes. Signed-off-by: GurukiranP Signed-off-by: Zeeshan Mehboob * [ES-1899] Added log for testing. (#284) Signed-off-by: GurukiranP Signed-off-by: Zeeshan Mehboob * [MOSIP-37447] updated install.sh script for mosipid check Signed-off-by: bhumi46 Signed-off-by: Zeeshan Mehboob * [MOSIP-37447] updated install.sh script for mosipid check Signed-off-by: bhumi46 Signed-off-by: Zeeshan Mehboob * [ES-1860] Updated package.json and package-lock.json files . Signed-off-by: GurukiranP Signed-off-by: Zeeshan Mehboob --------- Signed-off-by: ase-101 Signed-off-by: Zeeshan Mehboob Signed-off-by: Chandra Keshav Mishra Signed-off-by: Mohd Kaif Siddique Signed-off-by: GurukiranP Signed-off-by: ckm007 Signed-off-by: Harsh Vardhan Signed-off-by: Venkata Saidurga Polamraju Signed-off-by: piyush-shukla03_infosys Signed-off-by: Rakshitha650 <76676196+Rakshitha650@users.noreply.github.com> Signed-off-by: Rakshithb1 Signed-off-by: bhumi46 Signed-off-by: Zeeshan Mehboob <82993262+zesu22@users.noreply.github.com> Co-authored-by: ase-101 Co-authored-by: Kaif Siddique <74772315+kaifk468@users.noreply.github.com> Co-authored-by: Mohd Kaif Siddique Co-authored-by: GurukiranP Co-authored-by: ckm007 Co-authored-by: Harsh Vardhan Co-authored-by: pvsaidurga <132046494+pvsaidurga@users.noreply.github.com> Co-authored-by: Piyush7034 <47858366+Piyush7034@users.noreply.github.com> Co-authored-by: piyush-shukla03_infosys Co-authored-by: Rakshitha650 <76676196+Rakshitha650@users.noreply.github.com> Co-authored-by: Rakshithb1 Co-authored-by: Gk <76690271+gk-4VII@users.noreply.github.com> Co-authored-by: bhumi46 Signed-off-by: kaifk468 --- partner-onboarder/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner-onboarder/install.sh b/partner-onboarder/install.sh index 8656cdaa..1a3e22cd 100755 --- a/partner-onboarder/install.sh +++ b/partner-onboarder/install.sh @@ -119,7 +119,7 @@ function installing_onboarder() { echo "Istio label" kubectl label ns $NS istio-injection=disabled --overwrite - helm repo update +# helm repo update echo "Copy configmaps" COPY_UTIL=../deploy/copy_cm_func.sh