Skip to content

Commit

Permalink
ES-1043
Browse files Browse the repository at this point in the history
Signed-off-by: ase-101 <[email protected]>
  • Loading branch information
ase-101 committed May 23, 2024
1 parent 2a591a2 commit 4f8743f
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.mosip.esignet.api.dto;

import lombok.Data;

@Data
public class ClaimMetadata {

private String trustFramework;
private String assuranceLevel;
private String verificationProcessName;
private long verificationCompletedOn;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@ public class KycAuthDto {
private String individualId;

private List<AuthChallenge> challengeList;

private boolean claimMetadataRequired;

public KycAuthDto(String transactionId, String individualId, List<AuthChallenge> challengeList) {
this.transactionId = transactionId;
this.individualId = individualId;
this.challengeList = challengeList;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@
package io.mosip.esignet.api.spi;

import java.util.List;
import java.util.Map;

import io.mosip.esignet.api.dto.KycAuthDto;
import io.mosip.esignet.api.dto.KycAuthResult;
import io.mosip.esignet.api.dto.KycExchangeDto;
import io.mosip.esignet.api.dto.KycExchangeResult;
import io.mosip.esignet.api.dto.KycSigningCertificateData;
import io.mosip.esignet.api.dto.SendOtpDto;
import io.mosip.esignet.api.dto.SendOtpResult;
import io.mosip.esignet.api.dto.*;
import io.mosip.esignet.api.exception.KycAuthException;
import io.mosip.esignet.api.exception.KycExchangeException;
import io.mosip.esignet.api.exception.KycSigningCertificateException;
Expand Down Expand Up @@ -66,4 +61,10 @@ SendOtpResult sendOtp(String relyingPartyId, String clientId, SendOtpDto sendOtp
*/
List<KycSigningCertificateData> getAllKycSigningCertificates() throws KycSigningCertificateException;

/**
* Fetch claims metadata
* @param kycToken
* @return
*/
Map<String, List<ClaimMetadata>> getClaimMetadata(String partnerSpecificUserToken, String kycToken);
}
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ public List<KycSigningCertificateData> getAllKycSigningCertificates() {
return certs;
}

@Override
public Map<String, List<ClaimMetadata>> getClaimMetadata(String partnerSpecificUserToken, String kycToken) {
return Map.of();
}

private boolean authenticateUser(String transactionId, String individualId, AuthChallenge authChallenge) {
switch (authChallenge.getAuthFactorType()) {
case "PIN" :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ private String getAuthCode(String transactionId,String state, String nonce) thro
}

private ResponseWrapper<AuthResponse> authenticate(String transactionId) throws Exception {
KycAuthDto kycAuthDto = new KycAuthDto();
AuthRequest kycAuthDto = new AuthRequest();
kycAuthDto.setIndividualId("8267411571");
AuthChallenge authChallenge = new AuthChallenge();
authChallenge.setAuthFactorType("PIN");
Expand All @@ -287,7 +287,7 @@ private ResponseWrapper<AuthResponse> authenticate(String transactionId) throws
kycAuthDto.setChallengeList(Arrays.asList(authChallenge));
kycAuthDto.setTransactionId(transactionId);

RequestWrapper<KycAuthDto> wrapper = new RequestWrapper<>();
RequestWrapper<AuthRequest> wrapper = new RequestWrapper<>();
wrapper.setRequestTime(ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN)));
wrapper.setRequest(kycAuthDto);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ private ResponseWrapper<AuthCodeResponse> getAuthCodeWithInvalidClaim(String tra
}

private ResponseWrapper<AuthResponse> authenticateWithInvalidPin(String transactionId) throws Exception {
KycAuthDto kycAuthDto = new KycAuthDto();
AuthRequest kycAuthDto = new AuthRequest();
kycAuthDto.setIndividualId("8267411571");
AuthChallenge authChallenge = new AuthChallenge();
authChallenge.setAuthFactorType("PIN");
Expand All @@ -407,7 +407,7 @@ private ResponseWrapper<AuthResponse> authenticateWithInvalidPin(String transact
kycAuthDto.setChallengeList(Arrays.asList(authChallenge));
kycAuthDto.setTransactionId(transactionId);

RequestWrapper<KycAuthDto> wrapper = new RequestWrapper<>();
RequestWrapper<AuthRequest> wrapper = new RequestWrapper<>();
wrapper.setRequestTime(ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN)));
wrapper.setRequest(kycAuthDto);

Expand All @@ -423,7 +423,7 @@ private ResponseWrapper<AuthResponse> authenticateWithInvalidPin(String transact
}

private ResponseWrapper<AuthResponse> authenticate(String transactionId) throws Exception {
KycAuthDto kycAuthDto = new KycAuthDto();
AuthRequest kycAuthDto = new AuthRequest();
kycAuthDto.setIndividualId("8267411571");
AuthChallenge authChallenge = new AuthChallenge();
authChallenge.setAuthFactorType("PIN");
Expand All @@ -432,7 +432,7 @@ private ResponseWrapper<AuthResponse> authenticate(String transactionId) throws
kycAuthDto.setChallengeList(Arrays.asList(authChallenge));
kycAuthDto.setTransactionId(transactionId);

RequestWrapper<KycAuthDto> wrapper = new RequestWrapper<>();
RequestWrapper<AuthRequest> wrapper = new RequestWrapper<>();
wrapper.setRequestTime(ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern(UTC_DATETIME_PATTERN)));
wrapper.setRequest(kycAuthDto);

Expand Down

0 comments on commit 4f8743f

Please sign in to comment.