Skip to content

Commit 4124acc

Browse files
authored
Merge branch 'mosip:develop' into develop
2 parents 1f6987c + cf44910 commit 4124acc

File tree

12 files changed

+527
-42
lines changed

12 files changed

+527
-42
lines changed

mock-plugin/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>io.mosip.esignet</groupId>
77
<artifactId>mock-plugin</artifactId>
8-
<version>1.3.3-SNAPSHOT</version>
8+
<version>1.3.4-SNAPSHOT</version>
99
<name>mock-plugin</name>
1010
<packaging>jar</packaging>
1111
<description>Mockup of a wrapper implementation that is used to showcase the integration with e-Signet</description>
@@ -86,8 +86,8 @@
8686
<spring.boot.version>2.3.6.RELEASE</spring.boot.version>
8787

8888
<kernel-keymanager-service.version>1.2.2.0-SNAPSHOT</kernel-keymanager-service.version>
89-
<esignet.version>1.6.1-SNAPSHOT</esignet.version>
90-
<esignet-signup.version>1.2.1-SNAPSHOT</esignet-signup.version>
89+
<esignet.version>1.7.0-SNAPSHOT</esignet.version>
90+
<esignet-signup.version>1.3.0-SNAPSHOT</esignet-signup.version>
9191

9292
<sonar.exclusions>**/dto/**,**/entity/**,**/exception/**,**/spi/**,**/advice/**,**/config/**</sonar.exclusions>
9393
<sonar.cpd.exclusions>**/dto/**,**/entity/**,**/config/**</sonar.cpd.exclusions>

mock-plugin/src/test/java/io/mosip/signup/plugin/mock/service/MockIdentityVerifierPluginImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void verify_withValidIdentityVerificationDto_thenPass() throws IdentityVe
6868

6969
KafkaTemplate<String, IdentityVerificationResult> kafkaTemplate = Mockito.mock(KafkaTemplate.class);
7070
ReflectionTestUtils.setField(mockIdentityVerifierPlugin, "kafkaTemplate", kafkaTemplate);
71-
71+
ReflectionTestUtils.setField(mockIdentityVerifierPlugin, "resultTopic", "ANALYZE_FRAMES_RESULT");
7272

7373
mockIdentityVerifierPlugin.verify(transactionId, identityVerificationDto);
7474

mosip-identity-plugin/pom.xml

Lines changed: 147 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55

66
<groupId>io.mosip.esignet</groupId>
7-
<version>1.3.3-SNAPSHOT</version>
7+
<version>1.3.4-SNAPSHOT</version>
88
<artifactId>mosip-identity-plugin</artifactId>
99
<name>mosip-identity-plugin</name>
1010
<description>e-Signet Integration Implementation for MOSIP ID system</description>
@@ -86,14 +86,136 @@
8686
<spring.boot.version>2.3.6.RELEASE</spring.boot.version>
8787

8888
<kernel-keymanager-service.version>1.2.2.0-SNAPSHOT</kernel-keymanager-service.version>
89-
<esignet.version>1.6.1-SNAPSHOT</esignet.version>
90-
<esignet-signup.version>1.2.1-SNAPSHOT</esignet-signup.version>
89+
<esignet.version>1.7.0-SNAPSHOT</esignet.version>
90+
<esignet-signup.version>1.3.0-SNAPSHOT</esignet-signup.version>
9191

9292
<sonar.exclusions>**/dto/**,**/entity/**,**/exception/**,**/spi/**,**/advice/**,**/config/**</sonar.exclusions>
9393
<sonar.cpd.exclusions>**/dto/**,**/entity/**,**/config/**</sonar.cpd.exclusions>
9494
</properties>
9595

9696
<dependencies>
97+
98+
<dependency>
99+
<groupId>org.json</groupId>
100+
<artifactId>json</artifactId>
101+
<version>20240303</version>
102+
</dependency>
103+
104+
<dependency>
105+
<groupId>com.jayway.jsonpath</groupId>
106+
<artifactId>json-path</artifactId>
107+
<version>2.9.0</version>
108+
<exclusions>
109+
<exclusion>
110+
<groupId>org.slf4j</groupId>
111+
<artifactId>slf4j-api</artifactId>
112+
</exclusion>
113+
</exclusions>
114+
</dependency>
115+
116+
<dependency>
117+
<groupId>io.mosip.biometric.util</groupId>
118+
<artifactId>biometrics-util</artifactId>
119+
<version>1.2.0.3</version>
120+
<exclusions>
121+
<exclusion>
122+
<groupId>com.fasterxml.jackson.core</groupId>
123+
<artifactId>*</artifactId>
124+
</exclusion>
125+
<exclusion>
126+
<groupId>com.fasterxml.jackson.dataformat</groupId>
127+
<artifactId>*</artifactId>
128+
</exclusion>
129+
<exclusion>
130+
<groupId>com.fasterxml.jackson.module</groupId>
131+
<artifactId>*</artifactId>
132+
</exclusion>
133+
<exclusion>
134+
<groupId>org.slf4j</groupId>
135+
<artifactId>slf4j-api</artifactId>
136+
</exclusion>
137+
<exclusion>
138+
<groupId>org.hibernate.validator</groupId>
139+
<artifactId>hibernate-validator</artifactId>
140+
</exclusion>
141+
</exclusions>
142+
</dependency>
143+
144+
<dependency>
145+
<groupId>com.fasterxml.jackson.dataformat</groupId>
146+
<artifactId>jackson-dataformat-xml</artifactId>
147+
<version>2.11.3</version>
148+
</dependency>
149+
150+
<dependency>
151+
<groupId>io.mosip.kernel</groupId>
152+
<artifactId>kernel-biometrics-api</artifactId>
153+
<version>1.2.0.3</version>
154+
<exclusions>
155+
<exclusion>
156+
<groupId>org.slf4j</groupId>
157+
<artifactId>slf4j-api</artifactId>
158+
</exclusion>
159+
<exclusion>
160+
<groupId>org.springframework.boot</groupId>
161+
<artifactId>spring-boot-starter-actuator</artifactId>
162+
</exclusion>
163+
<exclusion>
164+
<groupId>org.springframework.boot</groupId>
165+
<artifactId>spring-boot-starter</artifactId>
166+
</exclusion>
167+
<exclusion>
168+
<groupId>org.springframework.boot</groupId>
169+
<artifactId>spring-boot-starter-test</artifactId>
170+
</exclusion>
171+
<exclusion>
172+
<groupId>org.springframework.cloud</groupId>
173+
<artifactId>spring-cloud-starter-config</artifactId>
174+
</exclusion>
175+
<exclusion>
176+
<groupId>org.springframework.cloud</groupId>
177+
<artifactId>spring-cloud-starter-sleuth</artifactId>
178+
</exclusion>
179+
<exclusion>
180+
<groupId>org.springframework.data</groupId>
181+
<artifactId>spring-data-jpa</artifactId>
182+
</exclusion>
183+
<exclusion>
184+
<groupId>org.springframework.boot</groupId>
185+
<artifactId>spring-boot-starter-security</artifactId>
186+
</exclusion>
187+
<exclusion>
188+
<groupId>org.apache.tomcat.embed</groupId>
189+
<artifactId>tomcat-embed-core</artifactId>
190+
</exclusion>
191+
<exclusion>
192+
<groupId>javax.validation</groupId>
193+
<artifactId>validation-api</artifactId>
194+
</exclusion>
195+
<exclusion>
196+
<groupId>io.micrometer</groupId>
197+
<artifactId>micrometer-core</artifactId>
198+
</exclusion>
199+
<exclusion>
200+
<groupId>io.micrometer</groupId>
201+
<artifactId>micrometer-registry-prometheus</artifactId>
202+
</exclusion>
203+
</exclusions>
204+
</dependency>
205+
206+
<dependency>
207+
<groupId>org.springframework.boot</groupId>
208+
<artifactId>spring-boot-starter-test</artifactId>
209+
<version>2.3.6.RELEASE</version>
210+
<scope>test</scope>
211+
</dependency>
212+
213+
<dependency>
214+
<groupId>io.mosip.kernel</groupId>
215+
<artifactId>kernel-cbeffutil-api</artifactId>
216+
<version>1.2.0.3</version>
217+
</dependency>
218+
97219
<dependency>
98220
<groupId>junit</groupId>
99221
<artifactId>junit</artifactId>
@@ -253,6 +375,27 @@
253375

254376
<build>
255377
<plugins>
378+
379+
<plugin>
380+
<artifactId>maven-assembly-plugin</artifactId>
381+
<version>3.7.1</version>
382+
<configuration>
383+
<descriptorRefs>
384+
<descriptorRef>jar-with-dependencies</descriptorRef>
385+
</descriptorRefs>
386+
<appendAssemblyId>false</appendAssemblyId>
387+
</configuration>
388+
<executions>
389+
<execution>
390+
<id>make-assembly</id>
391+
<phase>package</phase>
392+
<goals>
393+
<goal>single</goal>
394+
</goals>
395+
</execution>
396+
</executions>
397+
</plugin>
398+
256399
<plugin>
257400
<groupId>org.apache.maven.plugins</groupId>
258401
<artifactId>maven-surefire-plugin</artifactId>
@@ -329,6 +472,7 @@
329472
</executions>
330473
<configuration>
331474
<doclint>none</doclint>
475+
<sourcepath>src/main/java</sourcepath>
332476
</configuration>
333477
</plugin>
334478
<plugin>

mosip-identity-plugin/src/main/java/io/mosip/esignet/plugin/mosipid/service/IdaAuthenticatorImpl.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ public KycAuthResult doKycAuth(String relyingPartyId, String clientId, KycAuthDt
111111
@Override
112112
public KycExchangeResult doKycExchange(String relyingPartyId, String clientId, KycExchangeDto kycExchangeDto)
113113
throws KycExchangeException {
114+
return kycExchange(relyingPartyId,clientId,kycExchangeDto,false);
115+
}
116+
117+
private KycExchangeResult kycExchange(String relyingPartyId, String clientId, KycExchangeDto kycExchangeDto,boolean isV2)
118+
throws KycExchangeException {
114119
log.info("Started to build kyc-exchange request with transactionId : {} && clientId : {}",
115120
kycExchangeDto.getTransactionId(), clientId);
116121
try {
@@ -129,7 +134,7 @@ public KycExchangeResult doKycExchange(String relyingPartyId, String clientId, K
129134
idaKycExchangeRequest.setRespType(kycExchangeDto.getUserInfoResponseType()); //may be either JWT or JWE
130135
idaKycExchangeRequest.setIndividualId(kycExchangeDto.getIndividualId());
131136

132-
if(kycExchangeDto instanceof VerifiedKycExchangeDto){
137+
if(isV2){
133138
setClaims((VerifiedKycExchangeDto) kycExchangeDto, idaKycExchangeRequest);
134139
}
135140

@@ -138,7 +143,7 @@ public KycExchangeResult doKycExchange(String relyingPartyId, String clientId, K
138143
//set signature header, body and invoke kyc exchange endpoint
139144
String requestBody = objectMapper.writeValueAsString(idaKycExchangeRequest);
140145
RequestEntity requestEntity = RequestEntity
141-
.post(UriComponentsBuilder.fromUriString((kycExchangeDto instanceof VerifiedKycExchangeDto) ?
146+
.post(UriComponentsBuilder.fromUriString((isV2) ?
142147
kycExchangeUrlV2 : kycExchangeUrl).pathSegment(relyingPartyId,
143148
clientId).build().toUri())
144149
.contentType(MediaType.APPLICATION_JSON_UTF8)
@@ -179,11 +184,7 @@ private void setClaims(VerifiedKycExchangeDto kycExchangeDto, IdaKycExchangeRequ
179184
idaKycExchangeRequest.setVerifiedConsentedClaims(verifiedClaimsList);
180185
}
181186

182-
Map<String, JsonNode> unVerifiedConsentedClaims = getUnVerifiedConsentedClaims(acceptedClaimDetails);
183-
if(!CollectionUtils.isEmpty(unVerifiedConsentedClaims)){
184-
Map<String, Object> unVerifiedConsentedClaim = objectMapper.convertValue(unVerifiedConsentedClaims, new TypeReference<>() {});
185-
idaKycExchangeRequest.setUnVerifiedConsentedClaims(unVerifiedConsentedClaim);
186-
}
187+
idaKycExchangeRequest.setUnVerifiedConsentedClaims(getUnVerifiedConsentedClaims(acceptedClaimDetails));
187188
}
188189
}
189190

@@ -367,7 +368,7 @@ private IdaKycAuthRequest getIdaKycAuthRequest(KycAuthDto kycAuthDto, boolean cl
367368

368369
@Override
369370
public KycExchangeResult doVerifiedKycExchange(String relyingPartyId, String clientId, VerifiedKycExchangeDto kycExchangeDto) throws KycExchangeException {
370-
return doKycExchange(relyingPartyId, clientId, kycExchangeDto);
371+
return kycExchange(relyingPartyId, clientId, kycExchangeDto,true);
371372
}
372373

373374
/**
@@ -376,7 +377,7 @@ public KycExchangeResult doVerifiedKycExchange(String relyingPartyId, String cli
376377
* @return un verified consented claims
377378
*/
378379
@NotNull // This is added to not return null either return un verified claims map or empty map
379-
private Map<String, JsonNode> getUnVerifiedConsentedClaims(Map<String, JsonNode> acceptedClaimDetails) {
380+
private Map<String, Object> getUnVerifiedConsentedClaims(Map<String, JsonNode> acceptedClaimDetails) {
380381
Map<String, JsonNode> unVerifiedConsentedClaims = new HashMap<>();
381382
if(!CollectionUtils.isEmpty(acceptedClaimDetails)) {
382383
for(Map.Entry<String, JsonNode> entry : acceptedClaimDetails.entrySet()) {
@@ -387,6 +388,6 @@ private Map<String, JsonNode> getUnVerifiedConsentedClaims(Map<String, JsonNode>
387388
}
388389
}
389390
}
390-
return unVerifiedConsentedClaims;
391+
return objectMapper.convertValue(unVerifiedConsentedClaims, new TypeReference<>() {});
391392
}
392393
}

mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/dto/IdentityRequest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ public class IdentityRequest {
1616
private String registrationId;
1717
private JsonNode identity;
1818
private List<VerificationMetadata> verifiedAttributes;
19+
private JsonNode documents;
1920
}

0 commit comments

Comments
 (0)