Skip to content

Commit

Permalink
MOSIP-38450: Admin API review comments (#1087)
Browse files Browse the repository at this point in the history
* MOSIP-38450: Admin API review comments

Signed-off-by: Swetha K <[email protected]>

* MOSIP-38450: Admin API review comments

Signed-off-by: Swetha K <[email protected]>

* MOSIP-38450: Admin API review comments

Signed-off-by: Swetha K <[email protected]>

* MOSIP-38450: Admin API review comments

Signed-off-by: Swetha K <[email protected]>

* MOSIP-38450: Admin API review comments

Signed-off-by: Swetha K <[email protected]>

* MOSIP-38450: Admin API review comments

Signed-off-by: Swetha K <[email protected]>

---------

Signed-off-by: Swetha K <[email protected]>
Co-authored-by: Swetha K <[email protected]>
  • Loading branch information
SwethaKrish4 and Swetha K authored Jan 10, 2025
1 parent 42e311b commit a94b42e
Show file tree
Hide file tree
Showing 33 changed files with 407 additions and 300 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import io.mosip.pms.partner.request.dto.SbiAndDeviceMappingRequestDto;
import io.mosip.pms.device.response.dto.DeviceDetailResponseDto;
import io.mosip.pms.partner.util.PartnerHelper;
import io.mosip.pms.partner.util.RequestValidator;
import io.mosip.pms.common.util.RequestValidator;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Content;
Expand Down Expand Up @@ -283,7 +283,7 @@ public ResponseWrapperV2<Boolean> approveOrRejectMappingDeviceToSbi(@PathVariabl
}

@PreAuthorize("hasAnyRole(@authorizedRoles.getGetalldevicedetails())")
@GetMapping(value = "/search/v2")
@GetMapping(value = "/v2")
@Operation(summary = "This endpoint retrieves a list of all the Devices.",
description = "Avaiable since release-1.3.x. This endpoint supports pagination, sorting, and filtering. It is configured for the role PARTNER_ADMIN.")
@io.swagger.v3.oas.annotations.responses.ApiResponses(value = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import io.mosip.pms.device.response.dto.*;
import io.mosip.pms.partner.response.dto.FtmCertificateDownloadResponseDto;
import io.mosip.pms.partner.util.PartnerHelper;
import io.mosip.pms.partner.util.RequestValidator;
import io.mosip.pms.common.util.RequestValidator;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import io.mosip.pms.device.response.dto.SbiDetailsResponseDto;
import io.mosip.pms.device.dto.SbiDetailsDto;
import io.mosip.pms.partner.util.PartnerHelper;
import io.mosip.pms.partner.util.RequestValidator;
import io.mosip.pms.common.util.RequestValidator;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public enum ErrorCode {
PARTNER_DOES_NOT_BELONG_TO_THE_USER("PMS_CERTIFICATE_ERROR_007", "The given partner ID does not belong to the user.So unable to get the original partner certificates"),
CERTIFICATE_FETCH_ERROR("PMS_CERTIFICATE_ERROR_008","Error while fetching certificate."),
DEACTIVATED_PARTNER_CERTIFICATE_DOWNLOAD_ERROR("PMS_CERTIFICATE_ERROR_009","Unable to download the certificate for a deactivated partner"),
CA_CERTIFICATES_FETCH_ERROR("PMS_CERTIFICATE_ERROR_010", "Error while fetching CA certificates."),
DOWNLOAD_CA_CERTIFICATE_ERROR("PMS_CERTIFICATE_ERROR_011", "Error while downloading CA certificate."),
TRUST_CERTIFICATES_FETCH_ERROR("PMS_CERTIFICATE_ERROR_010", "Error while fetching trust certificates."),
DOWNLOAD_TRUST_CERTIFICATE_ERROR("PMS_CERTIFICATE_ERROR_011", "Error while downloading trust certificates."),
INVALID_CERTIFICATE_ID("PMS_CERTIFICATE_ERROR_012", "Certificate id is null or empty"),
POLICY_GROUP_NOT_EXISTS("PMS_POLICY_ERROR_001","Policy Group does not exists."),
PARTNER_POLICY_FETCH_ERROR("PMS_POLICY_ERROR_002","Error while fetching partner policies."),
Expand All @@ -108,11 +108,6 @@ public enum ErrorCode {
INVALID_DEVICE_PARTNER_TYPE("PMS_DEVICE_ERROR_003", "Invalid partner type."),
DEVICES_LIST_FOR_SBI_FETCH_ERROR("PMS_SF_ERROR_001", "Error while fetching devices list for SBI."),
INVALID_REQUEST_PARAM("PMS_REQUEST_ERROR_001", "Invalid request."),
INVALID_REQUEST_ID("PMS_REQUEST_ERROR_002", "Invalid Request Id"),
INVALID_REQUEST_VERSION("PMS_REQUEST_ERROR_003", "Request version is invalid"),
INVALID_REQUEST_DATETIME("PMS_REQUEST_ERROR_004", "Invalid request time"),
INVALID_REQUEST_BODY("PMS_REQUEST_ERROR_005", "Request body is invalid"),
INVALID_REQUEST_DATETIME_NOT_CURRENT_DATE("PMS_REQUEST_ERROR_006", "Request date should be current date"),
SBI_DEVICE_MAPPING_ALREADY_EXIST("PMS_DEVICE_ERROR_004", "SBI and Device mapping already exists."),
SBI_NOT_EXISTS("PMS_DEVICE_ERROR_005", "SBI do not exists."),
DEVICE_NOT_EXISTS("PMS_DEVICE_ERROR_006", "Device do not exists."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,19 +371,19 @@ public ResponseWrapperV2<List<CertificateDto>> getPartnerCertificatesDetails() {
return partnerService.getPartnerCertificatesDetails();
}

@PreAuthorize("hasAnyRole(@authorizedRoles.getGetpartnersv4())")
@GetMapping(value = "/v4")
@PreAuthorize("hasAnyRole(@authorizedRoles.getGetpartnersv3())")
@GetMapping(value = "/v3")
@Operation(summary = "This endpoint retrieves a list of Partners associated with the logged in user, based on the query parameters",
description = "Avaiable since release-1.3.x. It is configured for role any of the partner type or PARTNER_ADMIN.")
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(schema = @Schema(hidden = true))),
@ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(schema = @Schema(hidden = true)))})
public ResponseWrapperV2<List<PartnerDtoV4>> getPartnersV4(
public ResponseWrapperV2<List<PartnerDtoV3>> getPartnersV3(
@RequestParam(name = "status") String status,
@RequestParam(name = "policyGroupAvailable", required = false) Boolean policyGroupAvailable,
@RequestParam(name = "partnerType", required = false) String partnerType) {

return partnerService.getPartnersV4(status, policyGroupAvailable, partnerType);
return partnerService.getPartnersV3(status, policyGroupAvailable, partnerType);
}

@PreAuthorize("hasAnyRole(@authorizedRoles.getGetapikeysforauthpartners())")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public class AuthorizedRolesDto {

private List<String> patchpartnerspolicyapikeystatus;

private List<String> getallpartners;
private List<String> getadminpartners;

//MISP License controller

Expand Down Expand Up @@ -189,10 +189,10 @@ public class AuthorizedRolesDto {

private List<String> getalldevicedetails;

private List<String> getallcacertificates;
private List<String> gettrustcertificates;

private List<String> getdownloadrootcertificate;
private List<String> getdownloadtrustcertificates;

private List<String> getpartnersv4;
private List<String> getpartnersv3;

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@Data
@Getter
@Setter
public class PartnerDtoV4 {
public class PartnerDtoV3 {
@Schema(description = "Unique identifier for the partner", example = "partner123")
private String partnerId;

Expand Down
Loading

0 comments on commit a94b42e

Please sign in to comment.