-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOSIP-36344: create new end point for getting ca certificates (root/i… (
#326) * MOSIP-36344: create new end point for getting ca certificates (root/intermediate) Signed-off-by: nagendra0721 <[email protected]> * MOSIP-36344: create new end point for getting ca certificates (root/iintermediate) --------- Signed-off-by: nagendra0721 <[email protected]>
- Loading branch information
1 parent
be7b027
commit 71a558d
Showing
18 changed files
with
512 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
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,7 @@ | ||
\c mosip_keymgr | ||
|
||
ALTER TABLE IF EXISTS keymgr.ca_cert_store | ||
ADD COLUMN ca_cert_type character varying(25); | ||
|
||
COMMENT ON COLUMN keymgr.ca_cert_store.ca_cert_type | ||
IS 'CA_Certificate Type: Specifies the type of CA_Certificate e.g., Root, Intermediate, end-entity'; |
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
6 changes: 6 additions & 0 deletions
6
...ce/src/main/java/io/mosip/kernel/partnercertservice/constant/CaCertificateTypeConsts.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,6 @@ | ||
package io.mosip.kernel.partnercertservice.constant; | ||
|
||
public enum CaCertificateTypeConsts { | ||
ROOT, | ||
INTERMEDIATE | ||
} |
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
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
106 changes: 106 additions & 0 deletions
106
...ervice/src/main/java/io/mosip/kernel/partnercertservice/dto/CaCertTypeListRequestDto.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,106 @@ | ||
package io.mosip.kernel.partnercertservice.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.mosip.kernel.keymanagerservice.constant.KeymanagerConstant; | ||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* Partner Certificate Download Request DTO | ||
* | ||
* @author Nagendra | ||
*/ | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@ApiModel(description = "Model representation request to list partner certificate based on certificate type.") | ||
public class CaCertTypeListRequestDto { | ||
|
||
/** | ||
* Certificate Type | ||
*/ | ||
@ApiModelProperty(notes = "Partner Certificate Type", required = false) | ||
String caCertificateType; | ||
|
||
/** | ||
* Domain Name | ||
*/ | ||
@ApiModelProperty(notes = "Domain Name", required = true) | ||
@NotBlank(message = KeymanagerConstant.INVALID_REQUEST) | ||
String partnerDomain; | ||
|
||
@ApiModelProperty(notes = "Flag to force exclude the mosip CA Certificates", example = "false", required = false) | ||
private Boolean excludeMosipCA; | ||
|
||
/** | ||
* Sort Direction: ASC, DESC | ||
*/ | ||
@ApiModelProperty(notes = "Sort Direction", required = false) | ||
String sortOrder; | ||
/** | ||
* Page Number | ||
*/ | ||
@ApiModelProperty(notes = "Page Number", required = false) | ||
@NotNull(message = KeymanagerConstant.INVALID_REQUEST) | ||
int pageNumber; | ||
|
||
/** | ||
* Number of Certificate | ||
*/ | ||
@ApiModelProperty(notes = "Number of Certificate", required = false) | ||
@NotNull(message = KeymanagerConstant.INVALID_REQUEST) | ||
int pageSize; | ||
|
||
/** | ||
* CA Certificate Id | ||
*/ | ||
@ApiModelProperty(notes = "CA Certificate Id", required = false) | ||
private String certId; | ||
|
||
/** | ||
* Ca Certificate Issued To | ||
*/ | ||
@ApiModelProperty(notes = "Issued To", required = false) | ||
private String issuedTo; | ||
|
||
/** | ||
* Ca Certificate Issued By | ||
*/ | ||
@ApiModelProperty(notes = "Issued By", required = false) | ||
private String issuedBy; | ||
|
||
/** | ||
* Ca Certificate Valid From | ||
*/ | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") | ||
@ApiModelProperty(notes = "Valid From", required = false) | ||
private LocalDateTime validFromDate; | ||
|
||
/** | ||
* Ca Certificate Valid Till | ||
*/ | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") | ||
@ApiModelProperty(notes = "Valid Till", required = false) | ||
private LocalDateTime validTillDate; | ||
|
||
/** | ||
* Ca Certificate uploaded time | ||
*/ | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") | ||
@ApiModelProperty(notes = "Upload Time", required = false) | ||
private LocalDateTime uploadTime; | ||
|
||
/** | ||
* Sort By Field Name | ||
*/ | ||
@ApiModelProperty(notes = "Sort By Field", required = false) | ||
private String sortByFieldName; | ||
} |
78 changes: 78 additions & 0 deletions
78
...rvice/src/main/java/io/mosip/kernel/partnercertservice/dto/CaCertTypeListResponseDto.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,78 @@ | ||
package io.mosip.kernel.partnercertservice.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* DTO class for List the CA Certificate Based on the Certificate Type. | ||
* | ||
*/ | ||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@ApiModel(description = "certificate Dto class representation") | ||
public class CaCertTypeListResponseDto { | ||
|
||
/** | ||
* CA Certificate Type | ||
*/ | ||
@ApiModelProperty(notes = "CA Certificate Type", required = true) | ||
private String caCertificateType; | ||
|
||
/** | ||
* Partner Domain. | ||
*/ | ||
@ApiModelProperty(notes = "Partner Domain", required = true) | ||
private String partnerDomain; | ||
|
||
/** | ||
* CA Certificate Id | ||
*/ | ||
@ApiModelProperty(notes = "CA Certificate Id", required = true) | ||
private String certId; | ||
|
||
/** | ||
* Ca Certificate Issued To | ||
*/ | ||
@ApiModelProperty(notes = "Issued To", required = true) | ||
private String issuedTo; | ||
|
||
/** | ||
* Ca Certificate Issued By | ||
*/ | ||
@ApiModelProperty(notes = "Issued By", required = true) | ||
private String issuedBy; | ||
|
||
/** | ||
* Ca Certificate Valid From | ||
*/ | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") | ||
@ApiModelProperty(notes = "Valid From", required = true) | ||
private LocalDateTime validFromDate; | ||
|
||
/** | ||
* Ca Certificate Valid Till | ||
*/ | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") | ||
@ApiModelProperty(notes = "Valid Till", required = true) | ||
private LocalDateTime validTillDate; | ||
|
||
/** | ||
* Ca Certificate uploaded time | ||
*/ | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") | ||
@ApiModelProperty(notes = "Upload Time", required = true) | ||
private LocalDateTime uploadTime; | ||
|
||
/** | ||
* Ca certificate status | ||
*/ | ||
@ApiModelProperty(notes = "status", required = true) | ||
private boolean status; | ||
} |
39 changes: 39 additions & 0 deletions
39
...e/src/main/java/io/mosip/kernel/partnercertservice/dto/CaCertificateChainResponseDto.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,39 @@ | ||
package io.mosip.kernel.partnercertservice.dto; | ||
|
||
import io.swagger.annotations.ApiModel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@ApiModel(description = "Class representing All Partner Certificate Data Response") | ||
public class CaCertificateChainResponseDto { | ||
|
||
/** | ||
* Page Number | ||
*/ | ||
private int pageNumber; | ||
|
||
/** | ||
* Number of records in the Page | ||
*/ | ||
private int pageSize; | ||
|
||
/** | ||
* Total Number of Records | ||
*/ | ||
private long totalRecords; | ||
|
||
/** | ||
* Total number of Pages | ||
*/ | ||
private int totalPages; | ||
|
||
/** | ||
* Field for CA Certificate | ||
*/ | ||
private CaCertTypeListResponseDto[] allPartnerCertificates; | ||
|
||
} |
Oops, something went wrong.