Compare commits
3 Commits
main
...
feature/im
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46ebccf797 | ||
|
|
614cc00290 | ||
|
|
f6595ed1df |
@@ -7,9 +7,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Core.Blueprint.Storage" Version="0.3.0-alpha0049" />
|
||||
<PackageReference Include="Core.Cerberos.Adapters" Version="0.3.0-alpha0042" />
|
||||
<PackageReference Include="Lib.Architecture.BuildingBlocks" Version="0.9.0-alpha0001" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="3.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -17,4 +14,8 @@
|
||||
<ProjectReference Include="..\Core.Cerberos.External\Core.Cerberos.External.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="UseCases\Users\Ports\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -7,7 +7,8 @@ namespace Core.Cerberos.Application.UseCases.Modules.Ports
|
||||
ICommandSuccessPort<ModuleAdapter>,
|
||||
ICommandSuccessPort<List<ModuleAdapter>>,
|
||||
INoContentPort, IBusinessErrorPort, ITimeoutPort, IValidationErrorPort,
|
||||
INotFoundPort, IForbiddenPort, IUnauthorizedPort, IInternalServerErrorPort
|
||||
INotFoundPort, IForbiddenPort, IUnauthorizedPort, IInternalServerErrorPort,
|
||||
IBadRequestPort
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ namespace Core.Cerberos.Application.UseCases.Permissions.Ports
|
||||
ICommandSuccessPort<PermissionAdapter>,
|
||||
ICommandSuccessPort<List<PermissionAdapter>>,
|
||||
INoContentPort, IBusinessErrorPort, ITimeoutPort, IValidationErrorPort,
|
||||
INotFoundPort, IForbiddenPort, IUnauthorizedPort, IInternalServerErrorPort
|
||||
INotFoundPort, IForbiddenPort, IUnauthorizedPort, IInternalServerErrorPort,
|
||||
IBadRequestPort
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@ namespace Core.Cerberos.Application.UseCases.Roles.Ports
|
||||
public interface IRolePort : IBasePort,
|
||||
ICommandSuccessPort<RoleAdapter>, ICommandSuccessPort<List<RoleAdapter>>,
|
||||
INoContentPort, IBusinessErrorPort, ITimeoutPort, IValidationErrorPort,
|
||||
INotFoundPort, IForbiddenPort, IUnauthorizedPort, IInternalServerErrorPort
|
||||
INotFoundPort, IForbiddenPort, IUnauthorizedPort, IInternalServerErrorPort,
|
||||
IBadRequestPort
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@ namespace Core.Cerberos.Application.UseCases.Users.Ports
|
||||
ICommandSuccessPort<TokenAdapter>,
|
||||
ICommandSuccessPort<BlobDownloadUriAdapter>,
|
||||
INoContentPort, IBusinessErrorPort, ITimeoutPort, IValidationErrorPort,
|
||||
INotFoundPort, IForbiddenPort, IUnauthorizedPort, IInternalServerErrorPort
|
||||
INotFoundPort, IForbiddenPort, IUnauthorizedPort, IInternalServerErrorPort,
|
||||
IBadRequestPort
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
IComponentHandler<LoginUserRequest>,
|
||||
IComponentHandler<LogoutUserRequest>,
|
||||
IComponentHandler<ValidateUserExistenceRequest>,
|
||||
IComponentHandler<GetTokenAdapterRequest>,
|
||||
IComponentHandler<GetConsentFormPDFRequest>,
|
||||
IComponentHandler<AcceptUserConsentFormRequest>
|
||||
IComponentHandler<GetTokenAdapterRequest>
|
||||
{
|
||||
private readonly IUserPort _port;
|
||||
private readonly IValidator<ChangeUserStatusRequest> _changeUserStatusValidator;
|
||||
@@ -380,48 +378,6 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
var result = await _cerberosDALService.GetTokenAdapter(command.Email, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
_port.NoContentSuccess();
|
||||
return;
|
||||
}
|
||||
|
||||
_port.Success(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ApiResponseHelper.EvaluatePort(ex, _port);
|
||||
}
|
||||
}
|
||||
|
||||
public async ValueTask ExecuteAsync(GetConsentFormPDFRequest command, CancellationToken cancellationToken = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var _result = await _cerberosDALService.GetConsentFormPDFAsync(cancellationToken).ConfigureAwait(false);
|
||||
if (_result == null)
|
||||
{
|
||||
_port.NoContentSuccess();
|
||||
return;
|
||||
}
|
||||
_port.Success(_result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ApiResponseHelper.EvaluatePort(ex, _port);
|
||||
}
|
||||
}
|
||||
|
||||
public async ValueTask ExecuteAsync(AcceptUserConsentFormRequest command, CancellationToken cancellationToken = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.AcceptUserConsentFormAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
_port.NoContentSuccess();
|
||||
|
||||
@@ -52,12 +52,6 @@ namespace Core.Cerberos.External.Clients
|
||||
[Delete("/v1/User/" + Routes.RemoveProject)]
|
||||
Task<UserAdapter> RemoveProjectToUserAsync([FromRoute] string userId, [FromRoute] string projectId, CancellationToken cancellationToken = default);
|
||||
|
||||
[Get("/v1/User/GetConsentFormPDF")]
|
||||
Task<BlobDownloadUriAdapter> GetConsentFormPDFAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
[Patch("/v1/User/AcceptUserConsentForm")]
|
||||
Task<UserAdapter> AcceptUserConsentFormAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
[Get("/v1/Role")]
|
||||
Task<IEnumerable<RoleAdapter>> GetAllRolesAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Core.Blueprint.Storage" Version="0.3.0-alpha0049" />
|
||||
<PackageReference Include="Core.Cerberos.Adapters" Version="0.3.0-alpha0042" />
|
||||
<PackageReference Include="Lib.Architecture.BuildingBlocks" Version="0.9.0-alpha0001" />
|
||||
<PackageReference Include="Blueprint.Storage" Version="0.0.1" />
|
||||
<PackageReference Include="BuildingBlocks.Library" Version="0.0.1" />
|
||||
<PackageReference Include="Cerberos.Building.Blocks" Version="0.0.3" />
|
||||
<PackageReference Include="Refit" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ***********************************************************************
|
||||
// <copyright file="AuthenticatedHttpClientHandler.cs">
|
||||
// Heath
|
||||
// AgileWebs
|
||||
// </copyright>
|
||||
// ***********************************************************************
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ***********************************************************************
|
||||
// <copyright file="HttpContextTokenProvider.cs">
|
||||
// Heath
|
||||
// AgileWebs
|
||||
// </copyright>
|
||||
// ***********************************************************************
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ***********************************************************************
|
||||
// <copyright file="ITokenProvider.cs">
|
||||
// Heath
|
||||
// AgileWebs
|
||||
// </copyright>
|
||||
// ***********************************************************************
|
||||
|
||||
|
||||
@@ -388,45 +388,5 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
|
||||
return port.ViewModel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Consent Form PDF.
|
||||
/// </summary>
|
||||
[HttpGet]
|
||||
[Route("GetConsentFormPDF")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Permission("UserManagement.Read")]
|
||||
public async Task<IActionResult> GetConsentFormPDFAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
await getConsentFormPDFHandler.ExecuteAsync(new GetConsentFormPDFRequest { }, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return port.ViewModel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accept user consent form.
|
||||
/// </summary>
|
||||
[HttpPatch("AcceptUserConsentForm")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = $"{Schemes.HeathScheme}, {Schemes.AzureScheme}")]
|
||||
public async Task<IActionResult> AcceptUserConsentFormAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
await acceptUserConsentFormHandler.ExecuteAsync(new AcceptUserConsentFormRequest { }, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return port.ViewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Core.Cerberos.Adapters" Version="0.3.0-alpha0042" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Core.Cerberos.Application\Core.Cerberos.Application.csproj" />
|
||||
<ProjectReference Include="..\Core.Cerberos.External\Core.Cerberos.External.csproj" />
|
||||
|
||||
@@ -84,8 +84,6 @@ builder.Host.ConfigureServices((context, services) =>
|
||||
services.AddScoped<IComponentHandler<RemoveProjectFromUserRequest>, UserHandler>();
|
||||
services.AddScoped<IComponentHandler<ValidateUserExistenceRequest>, UserHandler>();
|
||||
services.AddScoped<IComponentHandler<GetTokenAdapterRequest>, UserHandler>();
|
||||
services.AddScoped<IComponentHandler<GetConsentFormPDFRequest>, UserHandler>();
|
||||
services.AddScoped<IComponentHandler<AcceptUserConsentFormRequest>, UserHandler>();
|
||||
|
||||
|
||||
services.AddValidatorsFromAssemblyContaining<CreateUserValidator>();
|
||||
|
||||
Reference in New Issue
Block a user