Skip to content

Commit

Permalink
chore: adjust roles for ssi endpoints (#125)
Browse files Browse the repository at this point in the history
Adjusted the roles for the ssi endpoints
Rename response properties for the get endpoints of ssi

Refs: CPLP-2853
Reviewed-By: Norbert Truchsess <[email protected]>
  • Loading branch information
Phil91 authored Jul 11, 2023
1 parent 2d12091 commit 4c4f0ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public Task<IEnumerable<SsiCertificateData>> GetSsiCertificationData() =>
/// <response code="204">Successfully created the use case particiation.</response>
[HttpPost]
[Consumes("multipart/form-data")]
[Authorize(Roles = "add_use_case_participation")]
[Authorize(Roles = "request_ssicredential")]
[Authorize(Policy = PolicyTypes.ValidIdentity)]
[Authorize(Policy = PolicyTypes.ValidCompany)]
[Route("useCaseParticipation")]
Expand All @@ -217,7 +217,7 @@ public async Task<NoContentResult> CreateUseCaseParticipation([FromForm] UseCase
/// <response code="204">Successfully created the ssi certificate.</response>
[HttpPost]
[Consumes("multipart/form-data")]
[Authorize(Roles = "add_ssi_certificate")]
[Authorize(Roles = "request_ssicredential")]
[Authorize(Policy = PolicyTypes.ValidIdentity)]
[Authorize(Policy = PolicyTypes.ValidCompany)]
[Route("certificates")]
Expand All @@ -238,7 +238,7 @@ public async Task<NoContentResult> CreateSsiCertificate([FromForm] SsiCertificat
/// <param name="sorting">Defines the sorting of the list</param>
/// <response code="200">Collection of the credentials.</response>
[HttpGet]
[Authorize(Roles = "admin_credential_decision")]
[Authorize(Roles = "decision_ssicredential")]
[Authorize(Policy = PolicyTypes.ValidIdentity)]
[Route("credentials", Name = nameof(GetCredentials))]
[ProducesResponseType(typeof(IEnumerable<CredentialDetailData>), StatusCodes.Status200OK)]
Expand All @@ -258,7 +258,7 @@ public async Task<NoContentResult> CreateSsiCertificate([FromForm] SsiCertificat
/// <returns>No Content</returns>
/// <response code="204">Successfully approved the credentials.</response>
[HttpPut]
[Authorize(Roles = "admin_credential_decision")]
[Authorize(Roles = "decision_ssicredential")]
[Authorize(Policy = PolicyTypes.ValidIdentity)]
[Route("credentials/{credentialId}/approval")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
Expand All @@ -276,7 +276,7 @@ public async Task<NoContentResult> ApproveCredential([FromRoute] Guid credential
/// <returns>No Content</returns>
/// <response code="204">Successfully rejected the credentials.</response>
[HttpPut]
[Authorize(Roles = "admin_credential_decision")]
[Authorize(Roles = "decision_ssicredential")]
[Authorize(Policy = PolicyTypes.ValidIdentity)]
[Route("credentials/{credentialId}/reject")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ namespace Org.Eclipse.TractusX.Portal.Backend.Administration.Service.Models;
public record UseCaseParticipationCreationData
(
Guid VerifiedCredentialExternalTypeDetailId,
VerifiedCredentialTypeId CredentialTypeId,
VerifiedCredentialTypeId CredentialType,
IFormFile Document
);

public record SsiCertificateCreationData
(
VerifiedCredentialTypeId CredentialTypeId,
VerifiedCredentialTypeId CredentialType,
IFormFile Document
);

0 comments on commit 4c4f0ec

Please sign in to comment.