Skip to content

Commit

Permalink
[ES-1033] added Verified Claim Detail
Browse files Browse the repository at this point in the history
Signed-off-by: Venkata Saidurga Polamraju <saidurgacsea@gmail.com>
  • Loading branch information
pvsaidurga committed Jun 3, 2024
1 parent f026a2b commit a9919e0
Show file tree
Hide file tree
Showing 31 changed files with 150 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.core.exception.EsignetException;
import lombok.extern.slf4j.Slf4j;
import org.modelmapper.Converter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.core.exception.EsignetException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
package io.mosip.esignet;

import io.mosip.esignet.api.dto.ClaimDetail;
import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.Claim.ClaimDetail;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.api.spi.AuditPlugin;
import io.mosip.esignet.core.dto.UserConsent;
import io.mosip.esignet.core.dto.UserConsentRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
package io.mosip.esignet.core.dto;

import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.Claim.Claims;
import lombok.Data;

import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
package io.mosip.esignet.core.dto;

import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.core.validator.OIDCDisplay;
import io.mosip.esignet.core.validator.OIDCPrompt;
import io.mosip.esignet.core.validator.OIDCResponseType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
package io.mosip.esignet.core.dto;

import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.api.util.ConsentAction;
import io.mosip.esignet.core.util.LinkCodeQueue;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.mosip.esignet.core.dto;

import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.Claim.Claims;
import lombok.Data;

import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
package io.mosip.esignet.api.dto;

import io.mosip.esignet.api.dto.Claim.Claims;
import lombok.Data;
import lombok.NoArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 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.api.dto;
package io.mosip.esignet.api.dto.Claim;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.esignet.api.dto;
package io.mosip.esignet.api.dto.Claim;

import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 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.api.dto;
package io.mosip.esignet.api.dto.Claim;

import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.mosip.esignet.api.dto.Claim;

import lombok.Data;

@Data
public class DocumentDetails {
private FilterCriteria type;
private String documentNumber;
private String dateOfIssuance;
private String dateOfExpiry;
private Issuer issuer;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.mosip.esignet.api.dto.Claim;

import io.mosip.esignet.api.util.ErrorConstants;
import io.mosip.esignet.api.util.EvidenceType;
import lombok.Data;

import javax.validation.constraints.NotBlank;

@Data
public class Evidence {

@NotBlank(message = ErrorConstants.INVALID_EVIDENCE_TYPE)
private EvidenceType type;
private FilterCriteria method;
private DocumentDetails documentDetails;
private FilterTime time;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.mosip.esignet.api.dto.Claim;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class FilterCriteria {
private String value;
private String[] values;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package io.mosip.esignet.api.dto.Claim;

import lombok.Data;

@Data
public class FilterTime {

private int maxAge;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.mosip.esignet.api.dto.Claim;

import lombok.Data;

@Data
public class Issuer {
private String name;
private String country;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.mosip.esignet.api.dto.Claim;

import io.mosip.esignet.api.util.ErrorConstants;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.util.List;

@Data
public class Verification {

@NotBlank(message=ErrorConstants.INVALID_TRUST_FRAMEWORK)
private FilterCriteria trust_framework;
private FilterTime time;
private FilterCriteria assurance_level;
private List<Evidence> evidence;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.mosip.esignet.api.dto.Claim;

import io.mosip.esignet.api.util.ErrorConstants;
import lombok.Data;

import javax.validation.constraints.NotBlank;

@Data
public class VerifiedClaimDetail {

@NotBlank
private Verification verification;

@NotBlank(message = ErrorConstants.INVALID_CLAIMS)
private Claims claims;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
package io.mosip.esignet.api.dto;

import io.mosip.esignet.api.dto.Claim.ClaimMetadata;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/
package io.mosip.esignet.api.dto;

import io.mosip.esignet.api.dto.Claim.ClaimMetadata;
import lombok.Data;

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

@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ public class ErrorConstants {
public static final String VCI_EXCHANGE_FAILED = "vci_exchange_failed";
public static final String NOT_IMPLEMENTED = "not_implemented";
public static final String INVALID_CHALLENGE_LENGTH = "invalid_challenge_length";
public static final String INVALID_CLAIMS = "invalid_claims";
public static final String INVALID_TRUST_FRAMEWORK = "invalid_trust_framework";
public static final String INVALID_EVIDENCE_TYPE = "invalid_evidence_type";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.mosip.esignet.api.util;

public enum EvidenceType {
DOCUMENT("document"),
ELECTRONIC_RECORD("electronic_record"),
VOUCH("vouch"),
ELECTRONIC_SIGNATURE("electronic_signature");
String value;

EvidenceType(String value) {
this.value = value;
}

public String getValue() {
return this.value;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import com.nimbusds.jwt.SignedJWT;
import io.mosip.esignet.TestUtil;
import io.mosip.esignet.api.dto.AuthChallenge;
import io.mosip.esignet.api.dto.ClaimDetail;
import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.KycAuthDto;
import io.mosip.esignet.api.dto.Claim.ClaimDetail;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.api.spi.AuditPlugin;
import io.mosip.esignet.api.spi.Authenticator;
import io.mosip.esignet.core.dto.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
import com.nimbusds.jwt.JWTClaimsSet;
import com.nimbusds.jwt.SignedJWT;
import io.mosip.esignet.api.dto.AuthChallenge;
import io.mosip.esignet.api.dto.ClaimDetail;
import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.KycAuthDto;
import io.mosip.esignet.api.dto.Claim.ClaimDetail;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.api.spi.AuditPlugin;
import io.mosip.esignet.api.spi.Authenticator;
import io.mosip.esignet.core.dto.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
package io.mosip.esignet.services;

import io.mosip.esignet.api.dto.*;
import io.mosip.esignet.api.dto.Claim.ClaimDetail;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.api.exception.KycAuthException;
import io.mosip.esignet.api.exception.SendOtpException;
import io.mosip.esignet.api.spi.AuditPlugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
package io.mosip.esignet.services;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.mosip.esignet.api.dto.ClaimDetail;
import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.Claim.ClaimDetail;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.api.dto.KycAuthResult;
import io.mosip.esignet.api.dto.SendOtpResult;
import io.mosip.esignet.api.spi.AuditPlugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import com.nimbusds.jose.*;
import com.nimbusds.jose.crypto.RSASSAVerifier;
import com.nimbusds.jwt.SignedJWT;
import io.mosip.esignet.api.dto.ClaimDetail;
import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.Claim.ClaimDetail;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.api.spi.AuditPlugin;
import io.mosip.esignet.api.util.Action;
import io.mosip.esignet.api.util.ActionStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@


import io.mosip.esignet.api.dto.*;
import io.mosip.esignet.api.dto.Claim.ClaimDetail;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.api.exception.KycAuthException;
import io.mosip.esignet.api.exception.SendOtpException;
import io.mosip.esignet.api.spi.AuditPlugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import io.mosip.esignet.api.dto.AuthChallenge;
import io.mosip.esignet.api.dto.ClaimDetail;
import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.Claim.ClaimDetail;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.api.dto.KycAuthResult;
import io.mosip.esignet.api.exception.KycAuthException;
import io.mosip.esignet.api.spi.AuditPlugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import com.nimbusds.jose.jwk.JWK;
import com.nimbusds.jose.jwk.JWKSet;
import com.nimbusds.jose.util.Base64URL;
import io.mosip.esignet.api.dto.ClaimDetail;
import io.mosip.esignet.api.dto.Claims;
import io.mosip.esignet.api.dto.Claim.ClaimDetail;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.api.spi.AuditPlugin;
import io.mosip.esignet.api.util.ConsentAction;
import io.mosip.esignet.core.constants.ErrorConstants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@


import io.mosip.esignet.api.dto.*;
import io.mosip.esignet.api.dto.Claim.ClaimDetail;
import io.mosip.esignet.api.dto.Claim.Claims;
import io.mosip.esignet.api.exception.KycAuthException;
import io.mosip.esignet.api.exception.SendOtpException;
import io.mosip.esignet.api.spi.AuditPlugin;
Expand Down

0 comments on commit a9919e0

Please sign in to comment.