-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INJICERT-13] VCI Segregation from eSignet (#10)
* [INJICERT-13] VCI Segregation from eSignet Signed-off-by: Challarao <[email protected]> * [INJICERT-13] kernel core dependency version upgrade to java 21 Signed-off-by: Challarao <[email protected]> * [INJICERT-13] removed unused methods and classes Signed-off-by: Challarao <[email protected]> * [INJICERT-13] changed esignet reference for jwt uri to certify Signed-off-by: Challarao <[email protected]> * [INJICERT-13] removed vci service impl module and refactored code Signed-off-by: Challarao <[email protected]> * [INJICERT-13] moved dependencies to parent and added license to all files Signed-off-by: Challarao <[email protected]>
- Loading branch information
1 parent
8e79f5e
commit 492cebf
Showing
73 changed files
with
3,566 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
# other directories | ||
target/ | ||
.idea/ | ||
*.p12 | ||
*.iml | ||
.settings/ | ||
.setting/ | ||
.mvn/ | ||
.project/ | ||
helm/*/Chart.lock | ||
helm/*/charts/ |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- 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/. --> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.mosip.certify</groupId> | ||
<artifactId>certify-parent</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<groupId>io.mosip.certify</groupId> | ||
<artifactId>certify-core</artifactId> | ||
<name>certify-core</name> | ||
<version>${project.parent.version}</version> | ||
<description>Certify Core Library</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springdoc</groupId> | ||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> | ||
<version>${springdoc-openapi-webmvc-ui-version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-validator</groupId> | ||
<artifactId>commons-validator</artifactId> | ||
<version>${commons.validator.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.mosip.certify</groupId> | ||
<artifactId>certify-integration-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
29 changes: 29 additions & 0 deletions
29
certify-core/src/main/java/io/mosip/certify/core/config/LocalAuthenticationEntryPoint.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,29 @@ | ||
/* | ||
* 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.certify.core.config; | ||
|
||
import java.io.IOException; | ||
import jakarta.servlet.ServletException; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.security.core.AuthenticationException; | ||
import org.springframework.security.web.AuthenticationEntryPoint; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.servlet.HandlerExceptionResolver; | ||
|
||
@Component | ||
public class LocalAuthenticationEntryPoint implements AuthenticationEntryPoint { | ||
@Autowired | ||
private HandlerExceptionResolver handlerExceptionResolver; | ||
|
||
public LocalAuthenticationEntryPoint() { | ||
} | ||
|
||
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { | ||
this.handlerExceptionResolver.resolveException(request, response, (Object)null, authException); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
certify-core/src/main/java/io/mosip/certify/core/constants/Constants.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,16 @@ | ||
/* | ||
* 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.certify.core.constants; | ||
|
||
public class Constants { | ||
|
||
public static final String UTC_DATETIME_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; | ||
public static final String SPACE = " "; | ||
|
||
public static final String C_NONCE = "c_nonce"; | ||
public static final String C_NONCE_EXPIRES_IN = "c_nonce_expires_in"; | ||
public static final String CLIENT_ID = "client_id"; | ||
} |
25 changes: 25 additions & 0 deletions
25
certify-core/src/main/java/io/mosip/certify/core/constants/ErrorConstants.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,25 @@ | ||
/* | ||
* 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.certify.core.constants; | ||
|
||
public class ErrorConstants { | ||
|
||
public static final String INVALID_REQUEST="invalid_request"; | ||
public static final String INVALID_SCOPE="invalid_scope"; | ||
public static final String INVALID_AUTH_TOKEN="invalid_token"; | ||
public static final String INVALID_ALGORITHM = "invalid_algorithm"; | ||
public static final String UNKNOWN_ERROR = "unknown_error"; | ||
public static final String UNSUPPORTED_VC_FORMAT = "unsupported_credential_format"; | ||
public static final String INVALID_VC_FORMAT = "invalid_vc_format"; | ||
public static final String INVALID_PROOF = "invalid_proof"; | ||
public static final String UNSUPPORTED_PROOF_TYPE = "unsupported_proof_type"; | ||
public static final String UNSUPPORTED_VC_TYPE = "unsupported_credential_type"; | ||
public static final String VC_ISSUANCE_FAILED = "vc_issuance_failed"; | ||
public static final String PROOF_HEADER_INVALID_TYP = "proof_header_invalid_typ"; | ||
public static final String PROOF_HEADER_INVALID_ALG = "proof_header_invalid_alg"; | ||
public static final String PROOF_HEADER_INVALID_KEY = "proof_header_invalid_key"; | ||
public static final String PROOF_HEADER_AMBIGUOUS_KEY = "proof_header_ambiguous_key"; | ||
} |
29 changes: 29 additions & 0 deletions
29
certify-core/src/main/java/io/mosip/certify/core/dto/CredentialDefinition.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,29 @@ | ||
/* | ||
* 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.certify.core.dto; | ||
|
||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.mosip.certify.core.constants.ErrorConstants; | ||
import lombok.Data; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotEmpty; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Data | ||
public class CredentialDefinition { | ||
|
||
@JsonProperty("@context") | ||
private List<@NotBlank(message = ErrorConstants.INVALID_REQUEST) String> context; | ||
|
||
@NotEmpty(message = ErrorConstants.INVALID_REQUEST) | ||
private List<@NotBlank(message = ErrorConstants.INVALID_REQUEST) String> type; | ||
|
||
private Map<String, Object> credentialSubject; | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
certify-core/src/main/java/io/mosip/certify/core/dto/CredentialMetadata.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,23 @@ | ||
/* | ||
* 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.certify.core.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@Data | ||
public class CredentialMetadata { | ||
|
||
private String id; | ||
private String format; | ||
private String scope; | ||
private List<String> proof_types_supported; | ||
private List<String> types; | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
certify-core/src/main/java/io/mosip/certify/core/dto/CredentialProof.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,31 @@ | ||
/* | ||
* 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.certify.core.dto; | ||
|
||
import io.mosip.certify.core.constants.ErrorConstants; | ||
import lombok.Data; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
|
||
@Data | ||
public class CredentialProof { | ||
|
||
/** | ||
* The proof object MUST contain a proof_type claim of type JSON string denoting the concrete proof type. | ||
*/ | ||
@NotBlank(message = ErrorConstants.UNSUPPORTED_PROOF_TYPE) | ||
private String proof_type; | ||
|
||
/** | ||
* When proof_type is jwt, a proof object MUST include a jwt claim | ||
*/ | ||
private String jwt; | ||
|
||
/** | ||
* When proof_type is cwt, a proof object MUST include a cwt claim | ||
*/ | ||
private String cwt; | ||
} |
45 changes: 45 additions & 0 deletions
45
certify-core/src/main/java/io/mosip/certify/core/dto/CredentialRequest.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,45 @@ | ||
/* | ||
* 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.certify.core.dto; | ||
|
||
import io.mosip.certify.core.constants.ErrorConstants; | ||
import jakarta.validation.Valid; | ||
import lombok.Data; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
|
||
@Data | ||
public class CredentialRequest { | ||
|
||
/** | ||
* REQUIRED. Format of the Credential to be issued. | ||
*/ | ||
@NotBlank(message = ErrorConstants.INVALID_VC_FORMAT) | ||
private String format; | ||
|
||
/** | ||
* OPTIONAL. | ||
* JSON object containing proof of possession of the key material the issued Credential shall be bound to. | ||
*/ | ||
@Valid | ||
@NotNull(message = ErrorConstants.INVALID_PROOF) | ||
private CredentialProof proof; | ||
|
||
/** | ||
* "format": jwt_vc_json | jwt_vc_json-ld | ldp_vc | ||
* REQUIRED | ||
* JSON object containing (and isolating) the detailed description of the credential type. | ||
* This object MUST be processed using full JSON-LD processing. | ||
* It consists of the following sub claims: | ||
* @context: REQUIRED. JSON array | ||
* types: REQUIRED. JSON array. This claim contains the type values the Wallet shall request | ||
* in the subsequent Credential Request. | ||
*/ | ||
@Valid | ||
@NotNull(message = ErrorConstants.INVALID_REQUEST) | ||
private CredentialDefinition credential_definition; | ||
} |
44 changes: 44 additions & 0 deletions
44
certify-core/src/main/java/io/mosip/certify/core/dto/CredentialResponse.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,44 @@ | ||
/* | ||
* 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.certify.core.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class CredentialResponse<T> { | ||
|
||
/** | ||
* JSON string denoting the format of the issued Credential. | ||
*/ | ||
private String format; | ||
|
||
/** | ||
* Contains issued Credential. MUST be present when acceptance_token is not returned. | ||
* MAY be a JSON string or a JSON object, depending on the Credential format. | ||
*/ | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
private T credential; | ||
|
||
/** | ||
* A JSON string containing a security token subsequently used to obtain a Credential. | ||
* MUST be present when credential is not returned | ||
*/ | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
private String acceptance_token; | ||
|
||
/** | ||
* JSON string containing a nonce to be used to create a proof of possession of key material | ||
*/ | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
private String c_nonce; | ||
|
||
/** | ||
* JSON integer denoting the lifetime in seconds of the c_nonce | ||
*/ | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
private Integer c_nonce_expires_in; | ||
} |
20 changes: 20 additions & 0 deletions
20
certify-core/src/main/java/io/mosip/certify/core/dto/Error.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,20 @@ | ||
/* | ||
* 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.certify.core.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class Error { | ||
|
||
private String errorCode; | ||
private String errorMessage; | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
certify-core/src/main/java/io/mosip/certify/core/dto/ParsedAccessToken.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,20 @@ | ||
/* | ||
* 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.certify.core.dto; | ||
|
||
import lombok.Data; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Map; | ||
|
||
@Data | ||
@Component | ||
public class ParsedAccessToken { | ||
|
||
private Map<String, Object> claims; | ||
private String accessTokenHash; | ||
private boolean isActive; | ||
} |
Oops, something went wrong.