-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #285 from ase-101/release-0.10.x
ES-842 Corrected the properties and updated the test case accordingly
- Loading branch information
Showing
15 changed files
with
100 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...dentity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/CreateIdentity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.IdData; | ||
|
||
@IdData(action = "CREATE") | ||
public class CreateIdentity extends IdentityData { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...dentity-system/src/main/java/io/mosip/esignet/mock/identitysystem/dto/UpdateIdentity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.IdData; | ||
|
||
@IdData(action = "UPDATE") | ||
public class UpdateIdentity extends IdentityData { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,6 @@ | |
|
||
Class<? extends Payload>[] payload() default {}; | ||
|
||
String action() default "CREATE"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 8 additions & 72 deletions
80
mock-identity-system/src/main/resources/application-local.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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=5455 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 protected]"); | ||
|
||
|
@@ -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 protected]"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,19 +74,43 @@ public void identityDataValidator_withNullValue_thenFail() { | |
} | ||
|
||
@Test | ||
public void identityDataValidator_withSupportedFieldsPresent_thenPass() { | ||
List<String> supportedFields = Arrays.asList("name", "email", "phone"); | ||
ReflectionTestUtils.setField(identityDataValidator, "supportedFields", supportedFields); | ||
public void identityDataValidator_withValidInputForCreateAction_thenPass() { | ||
List<String> supportedFields = Arrays.asList("fullName", "email", "phone"); | ||
ReflectionTestUtils.setField(identityDataValidator, "action", "CREATE"); | ||
ReflectionTestUtils.setField(identityDataValidator, "createRequiredFields", supportedFields); | ||
IdentityData identityData = new IdentityData(); | ||
LanguageValue languageValue = new LanguageValue(); | ||
languageValue.setLanguage("en"); | ||
languageValue.setValue("John Doe"); | ||
|
||
identityData.setName(List.of(languageValue)); | ||
identityData.setFullName(List.of(languageValue)); | ||
identityData.setEmail("[email protected]"); | ||
identityData.setPhone("1234567890"); | ||
identityData.setEncodedPhoto("encoded-photo"); | ||
|
||
assertTrue(identityDataValidator.isValid(identityData, context)); | ||
} | ||
|
||
@Test | ||
public void identityDataValidator_withValidInputForUpdateAction_thenPass() { | ||
List<String> supportedFields = Arrays.asList("individualId"); | ||
ReflectionTestUtils.setField(identityDataValidator, "action", "UPDATE"); | ||
ReflectionTestUtils.setField(identityDataValidator, "updateRequiredFields", supportedFields); | ||
IdentityData identityData = new IdentityData(); | ||
identityData.setIndividualId("individualId"); | ||
|
||
assertTrue(identityDataValidator.isValid(identityData, context)); | ||
} | ||
|
||
@Test | ||
public void identityDataValidator_withInvalidInputForUpdateAction_thenFail() { | ||
List<String> supportedFields = Arrays.asList("individualId", "email"); | ||
ReflectionTestUtils.setField(identityDataValidator, "action", "UPDATE"); | ||
ReflectionTestUtils.setField(identityDataValidator, "updateRequiredFields", supportedFields); | ||
IdentityData identityData = new IdentityData(); | ||
identityData.setIndividualId("individualId"); | ||
|
||
assertFalse(identityDataValidator.isValid(identityData, context)); | ||
} | ||
|
||
} |