remove cerberos by thalos
This commit is contained in:
parent
46ebccf797
commit
82ebe4408b
@ -1,6 +0,0 @@
|
||||
@Core.Cerberos.Service.API_HostAddress = http://localhost:5145
|
||||
|
||||
GET {{Core.Cerberos.Service.API_HostAddress}}/weatherforecast/
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
@ -11,7 +11,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Core.Cerberos.External\Core.Cerberos.External.csproj" />
|
||||
<ProjectReference Include="..\Core.Thalos.External\Core.Thalos.External.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -1,9 +1,9 @@
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Application.UseCases.Modules.Ports;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Application.UseCases.Modules.Ports;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Adapter
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Adapter
|
||||
{
|
||||
public class ModulePort : BasePresenter, IModulePort
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Input
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Input
|
||||
{
|
||||
public class ChangeModuleStatusRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Input
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Input
|
||||
{
|
||||
public class CreateModuleRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Input
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Input
|
||||
{
|
||||
public class GetAllModulesByListRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Input
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Input
|
||||
{
|
||||
public class GetAllModulesRequest : ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Input
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Input
|
||||
{
|
||||
public class GetModuleRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Input
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Input
|
||||
{
|
||||
public class UpdateModuleRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,13 +1,13 @@
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Application.UseCases.Modules.Input;
|
||||
using Core.Cerberos.Application.UseCases.Modules.Ports;
|
||||
using Core.Cerberos.External.Clients;
|
||||
using Core.Cerberos.External.Clients.Requests;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Application.UseCases.Modules.Input;
|
||||
using Core.Thalos.Application.UseCases.Modules.Ports;
|
||||
using Core.Thalos.External.Clients;
|
||||
using Core.Thalos.External.Clients.Requests;
|
||||
using FluentValidation;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Lib.Architecture.BuildingBlocks.Helpers;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules
|
||||
namespace Core.Thalos.Application.UseCases.Modules
|
||||
{
|
||||
public class ModuleHandler :
|
||||
IComponentHandler<ChangeModuleStatusRequest>,
|
||||
@ -22,7 +22,7 @@ namespace Core.Cerberos.Application.UseCases.Modules
|
||||
private readonly IValidator<CreateModuleRequest> _registerModuleValidator;
|
||||
private readonly IValidator<UpdateModuleRequest> _updateModuleValidator;
|
||||
private readonly IValidator<GetAllModulesByListRequest> _modulesByListValidator;
|
||||
private readonly ICerberosServiceClient _cerberosDALService;
|
||||
private readonly IThalosServiceClient _thalosDALService;
|
||||
|
||||
public ModuleHandler(
|
||||
IModulePort port,
|
||||
@ -30,13 +30,13 @@ namespace Core.Cerberos.Application.UseCases.Modules
|
||||
IValidator<CreateModuleRequest> registerModuleValidator,
|
||||
IValidator<UpdateModuleRequest> updateModuleValidator,
|
||||
IValidator<GetAllModulesByListRequest> modulesByListValidator,
|
||||
ICerberosServiceClient cerberosDALService)
|
||||
IThalosServiceClient thalosDALService)
|
||||
{
|
||||
_port = port ?? throw new ArgumentNullException(nameof(port));
|
||||
_changeModuleStatusValidator = changeModuleStatusValidator ?? throw new ArgumentNullException(nameof(changeModuleStatusValidator));
|
||||
_registerModuleValidator = registerModuleValidator ?? throw new ArgumentNullException(nameof(registerModuleValidator));
|
||||
_updateModuleValidator = updateModuleValidator ?? throw new ArgumentNullException(nameof(updateModuleValidator));
|
||||
_cerberosDALService = cerberosDALService ?? throw new ArgumentNullException(nameof(cerberosDALService));
|
||||
_thalosDALService = thalosDALService ?? throw new ArgumentNullException(nameof(thalosDALService));
|
||||
_modulesByListValidator = modulesByListValidator ?? throw new ArgumentNullException(nameof(modulesByListValidator));
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ namespace Core.Cerberos.Application.UseCases.Modules
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.GetModuleByIdAsync(command.Id, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.GetModuleByIdAsync(command.Id, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -68,7 +68,7 @@ namespace Core.Cerberos.Application.UseCases.Modules
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var _result = await _cerberosDALService.GetAllModulesAsync().ConfigureAwait(false);
|
||||
var _result = await _thalosDALService.GetAllModulesAsync().ConfigureAwait(false);
|
||||
if (!_result.Any())
|
||||
{
|
||||
_port.NoContentSuccess();
|
||||
@ -94,7 +94,7 @@ namespace Core.Cerberos.Application.UseCases.Modules
|
||||
return;
|
||||
}
|
||||
|
||||
var _result = await _cerberosDALService.GetAllModulesByListAsync(command.Modules, cancellationToken).ConfigureAwait(false);
|
||||
var _result = await _thalosDALService.GetAllModulesByListAsync(command.Modules, cancellationToken).ConfigureAwait(false);
|
||||
if (!_result.Any())
|
||||
{
|
||||
_port.NoContentSuccess();
|
||||
@ -120,7 +120,7 @@ namespace Core.Cerberos.Application.UseCases.Modules
|
||||
return;
|
||||
}
|
||||
|
||||
var result = await _cerberosDALService.ChangeStatusModuleAsync(command.Id, command.Status, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.ChangeStatusModuleAsync(command.Id, command.Status, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -158,7 +158,7 @@ namespace Core.Cerberos.Application.UseCases.Modules
|
||||
Application = command.Application,
|
||||
};
|
||||
|
||||
var result = await _cerberosDALService.CreateModuleAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.CreateModuleAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -200,7 +200,7 @@ namespace Core.Cerberos.Application.UseCases.Modules
|
||||
|
||||
string id = command.Id;
|
||||
|
||||
var result = await _cerberosDALService.UpdateModuleAsync(request, id, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.UpdateModuleAsync(request, id, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Thalos.Adapters;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Ports
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Ports
|
||||
{
|
||||
public interface IModulePort : IBasePort,
|
||||
ICommandSuccessPort<ModuleAdapter>,
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Modules.Input;
|
||||
using Core.Thalos.Application.UseCases.Modules.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Validator
|
||||
{
|
||||
public class ChangeModuleStatusValidator : AbstractValidator<ChangeModuleStatusRequest>
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Modules.Input;
|
||||
using Core.Thalos.Application.UseCases.Modules.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Validator
|
||||
{
|
||||
public class CreateModuleValidator : AbstractValidator<CreateModuleRequest>
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Modules.Input;
|
||||
using Core.Thalos.Application.UseCases.Modules.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Validator
|
||||
{
|
||||
public class GetAllModulesByListValidator : AbstractValidator<GetAllModulesByListRequest>
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Modules.Input;
|
||||
using Core.Thalos.Application.UseCases.Modules.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Modules.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Modules.Validator
|
||||
{
|
||||
public class UpdateModuleValidator : AbstractValidator<UpdateModuleRequest>
|
||||
{
|
||||
@ -1,9 +1,9 @@
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Ports;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Ports;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions.Adapter
|
||||
namespace Core.Thalos.Application.UseCases.Permissions.Adapter
|
||||
{
|
||||
public class PermissionPort : BasePresenter, IPermissionPort
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions.Input
|
||||
namespace Core.Thalos.Application.UseCases.Permissions.Input
|
||||
{
|
||||
public class ChangePermissionStatusRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters.Common.Constants;
|
||||
using Core.Thalos.Adapters.Common.Constants;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions.Input
|
||||
namespace Core.Thalos.Application.UseCases.Permissions.Input
|
||||
{
|
||||
public class CreatePermissionRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions.Input
|
||||
namespace Core.Thalos.Application.UseCases.Permissions.Input
|
||||
{
|
||||
public class GetAllPermissionsByListRequest : ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions.Input
|
||||
namespace Core.Thalos.Application.UseCases.Permissions.Input
|
||||
{
|
||||
public class GetAllPermissionsRequest : ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions.Input
|
||||
namespace Core.Thalos.Application.UseCases.Permissions.Input
|
||||
{
|
||||
public class GetPermissionRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,8 +1,8 @@
|
||||
using Core.Cerberos.Adapters.Common.Constants;
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Constants;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions.Input
|
||||
namespace Core.Thalos.Application.UseCases.Permissions.Input
|
||||
{
|
||||
public class UpdatePermissionRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,13 +1,13 @@
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Input;
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Ports;
|
||||
using Core.Cerberos.External.Clients;
|
||||
using Core.Cerberos.External.Clients.Requests;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Input;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Ports;
|
||||
using Core.Thalos.External.Clients;
|
||||
using Core.Thalos.External.Clients.Requests;
|
||||
using FluentValidation;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Lib.Architecture.BuildingBlocks.Helpers;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions
|
||||
namespace Core.Thalos.Application.UseCases.Permissions
|
||||
{
|
||||
public class PermissionHandler :
|
||||
IComponentHandler<ChangePermissionStatusRequest>,
|
||||
@ -21,20 +21,20 @@ namespace Core.Cerberos.Application.UseCases.Permissions
|
||||
private readonly IValidator<ChangePermissionStatusRequest> _changePermissionStatusValidator;
|
||||
private readonly IValidator<CreatePermissionRequest> _registerPermissionValidator;
|
||||
private readonly IValidator<UpdatePermissionRequest> _updatePermissionValidator;
|
||||
private readonly ICerberosServiceClient _cerberosDALService;
|
||||
private readonly IThalosServiceClient _thalosDALService;
|
||||
|
||||
public PermissionHandler(
|
||||
IPermissionPort port,
|
||||
IValidator<ChangePermissionStatusRequest> changePermissionStatusValidator,
|
||||
IValidator<CreatePermissionRequest> registerPermissionValidator,
|
||||
IValidator<UpdatePermissionRequest> updatePermissionValidator,
|
||||
ICerberosServiceClient cerberosDALService)
|
||||
IThalosServiceClient thalosDALService)
|
||||
{
|
||||
_port = port ?? throw new ArgumentNullException(nameof(port));
|
||||
_changePermissionStatusValidator = changePermissionStatusValidator ?? throw new ArgumentNullException(nameof(changePermissionStatusValidator));
|
||||
_registerPermissionValidator = registerPermissionValidator ?? throw new ArgumentNullException(nameof(registerPermissionValidator));
|
||||
_updatePermissionValidator = updatePermissionValidator ?? throw new ArgumentNullException(nameof(updatePermissionValidator));
|
||||
_cerberosDALService = cerberosDALService ?? throw new ArgumentNullException(nameof(cerberosDALService));
|
||||
_thalosDALService = thalosDALService ?? throw new ArgumentNullException(nameof(thalosDALService));
|
||||
}
|
||||
|
||||
public async ValueTask ExecuteAsync(GetPermissionRequest command, CancellationToken cancellationToken = default)
|
||||
@ -43,7 +43,7 @@ namespace Core.Cerberos.Application.UseCases.Permissions
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.GetPermissionByIdAsync(command.Id, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.GetPermissionByIdAsync(command.Id, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -65,7 +65,7 @@ namespace Core.Cerberos.Application.UseCases.Permissions
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var _result = await _cerberosDALService.GetAllPermissionsAsync().ConfigureAwait(false);
|
||||
var _result = await _thalosDALService.GetAllPermissionsAsync().ConfigureAwait(false);
|
||||
if (!_result.Any())
|
||||
{
|
||||
_port.NoContentSuccess();
|
||||
@ -85,7 +85,7 @@ namespace Core.Cerberos.Application.UseCases.Permissions
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var _result = await _cerberosDALService.GetAllPermissionsByListAsync(command.Permissions, cancellationToken).ConfigureAwait(false);
|
||||
var _result = await _thalosDALService.GetAllPermissionsByListAsync(command.Permissions, cancellationToken).ConfigureAwait(false);
|
||||
if (!_result.Any())
|
||||
{
|
||||
_port.NoContentSuccess();
|
||||
@ -111,7 +111,7 @@ namespace Core.Cerberos.Application.UseCases.Permissions
|
||||
return;
|
||||
}
|
||||
|
||||
var result = await _cerberosDALService.ChangeStatusPermissionAsync(command.Id, command.Status, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.ChangeStatusPermissionAsync(command.Id, command.Status, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -146,7 +146,7 @@ namespace Core.Cerberos.Application.UseCases.Permissions
|
||||
AccessLevel = command.AccessLevel
|
||||
};
|
||||
|
||||
var result = await _cerberosDALService.CreatePermissionAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.CreatePermissionAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -185,7 +185,7 @@ namespace Core.Cerberos.Application.UseCases.Permissions
|
||||
|
||||
string id = command.Id;
|
||||
|
||||
var result = await _cerberosDALService.UpdatePermissionAsync(request, id, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.UpdatePermissionAsync(request, id, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Thalos.Adapters;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions.Ports
|
||||
namespace Core.Thalos.Application.UseCases.Permissions.Ports
|
||||
{
|
||||
public interface IPermissionPort : IBasePort,
|
||||
ICommandSuccessPort<PermissionAdapter>,
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Input;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Permissions.Validator
|
||||
{
|
||||
public class ChangePermissionStatusValidator : AbstractValidator<ChangePermissionStatusRequest>
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Input;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Permissions.Validator
|
||||
{
|
||||
public class CreatePermissionValidator : AbstractValidator<CreatePermissionRequest>
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Input;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Permissions.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Permissions.Validator
|
||||
{
|
||||
public class UpdatePermissionValidator : AbstractValidator<UpdatePermissionRequest>
|
||||
{
|
||||
@ -1,9 +1,9 @@
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Application.UseCases.Roles.Ports;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Application.UseCases.Roles.Ports;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Adapter
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Adapter
|
||||
{
|
||||
public class RolePort : BasePresenter, IRolePort
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Input
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Input
|
||||
{
|
||||
public class AddApplicationToRoleRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Input
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Input
|
||||
{
|
||||
public class ChangeRoleStatusRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,8 +1,8 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Input
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Input
|
||||
{
|
||||
public class CreateRoleRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Input
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Input
|
||||
{
|
||||
public class GetAllRolesRequest : ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Input
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Input
|
||||
{
|
||||
public class GetRoleRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Input
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Input
|
||||
{
|
||||
public class RemoveApplicationFromRoleRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,8 +1,8 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Input
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Input
|
||||
{
|
||||
public class UpdateRoleRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Thalos.Adapters;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Ports
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Ports
|
||||
{
|
||||
public interface IRolePort : IBasePort,
|
||||
ICommandSuccessPort<RoleAdapter>, ICommandSuccessPort<List<RoleAdapter>>,
|
||||
@ -1,13 +1,13 @@
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Application.UseCases.Roles.Input;
|
||||
using Core.Cerberos.Application.UseCases.Roles.Ports;
|
||||
using Core.Cerberos.External.Clients;
|
||||
using Core.Cerberos.External.Clients.Requests;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Application.UseCases.Roles.Input;
|
||||
using Core.Thalos.Application.UseCases.Roles.Ports;
|
||||
using Core.Thalos.External.Clients;
|
||||
using Core.Thalos.External.Clients.Requests;
|
||||
using FluentValidation;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Lib.Architecture.BuildingBlocks.Helpers;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Role
|
||||
namespace Core.Thalos.Application.UseCases.Role
|
||||
{
|
||||
public class RoleHandler :
|
||||
IComponentHandler<ChangeRoleStatusRequest>,
|
||||
@ -23,20 +23,20 @@ namespace Core.Cerberos.Application.UseCases.Role
|
||||
private readonly IValidator<ChangeRoleStatusRequest> _changeRoleStatusValidator;
|
||||
private readonly IValidator<CreateRoleRequest> _registerRoleValidator;
|
||||
private readonly IValidator<UpdateRoleRequest> _updateRoleValidator;
|
||||
private readonly ICerberosServiceClient _cerberosDALService;
|
||||
private readonly IThalosServiceClient _thalosDALService;
|
||||
|
||||
public RoleHandler(
|
||||
IRolePort port,
|
||||
IValidator<ChangeRoleStatusRequest> changeRoleStatusValidator,
|
||||
IValidator<CreateRoleRequest> registerRoleValidator,
|
||||
IValidator<UpdateRoleRequest> updateRoleValidator,
|
||||
ICerberosServiceClient cerberosDALService)
|
||||
IThalosServiceClient thalosDALService)
|
||||
{
|
||||
_port = port ?? throw new ArgumentNullException(nameof(port));
|
||||
_changeRoleStatusValidator = changeRoleStatusValidator ?? throw new ArgumentNullException(nameof(changeRoleStatusValidator));
|
||||
_registerRoleValidator = registerRoleValidator ?? throw new ArgumentNullException(nameof(registerRoleValidator));
|
||||
_updateRoleValidator = updateRoleValidator ?? throw new ArgumentNullException(nameof(updateRoleValidator));
|
||||
_cerberosDALService = cerberosDALService ?? throw new ArgumentNullException(nameof(cerberosDALService));
|
||||
_thalosDALService = thalosDALService ?? throw new ArgumentNullException(nameof(thalosDALService));
|
||||
}
|
||||
|
||||
public async ValueTask ExecuteAsync(GetRoleRequest command, CancellationToken cancellationToken = default)
|
||||
@ -45,7 +45,7 @@ namespace Core.Cerberos.Application.UseCases.Role
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.GetRoleByIdAsync(command.Id, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.GetRoleByIdAsync(command.Id, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -67,7 +67,7 @@ namespace Core.Cerberos.Application.UseCases.Role
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var _result = await _cerberosDALService.GetAllRolesAsync().ConfigureAwait(false);
|
||||
var _result = await _thalosDALService.GetAllRolesAsync().ConfigureAwait(false);
|
||||
if (!_result.Any())
|
||||
{
|
||||
_port.NoContentSuccess();
|
||||
@ -93,7 +93,7 @@ namespace Core.Cerberos.Application.UseCases.Role
|
||||
return;
|
||||
}
|
||||
|
||||
var result = await _cerberosDALService.ChangeRoleStatusAsync(command.Id, command.Status, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.ChangeRoleStatusAsync(command.Id, command.Status, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -131,7 +131,7 @@ namespace Core.Cerberos.Application.UseCases.Role
|
||||
|
||||
};
|
||||
|
||||
var result = await _cerberosDALService.CreateRoleAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.CreateRoleAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -172,7 +172,7 @@ namespace Core.Cerberos.Application.UseCases.Role
|
||||
|
||||
string id = command.Id;
|
||||
|
||||
var result = await _cerberosDALService.UpdateRoleAsync(request, id, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.UpdateRoleAsync(request, id, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -194,7 +194,7 @@ namespace Core.Cerberos.Application.UseCases.Role
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.AddApplicationToRoleAsync(command.RoleId, command.Application, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.AddApplicationToRoleAsync(command.RoleId, command.Application, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -216,7 +216,7 @@ namespace Core.Cerberos.Application.UseCases.Role
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.RemoveApplicationToRoleAsync(command.RoleId, command.Application, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.RemoveApplicationToRoleAsync(command.RoleId, command.Application, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Roles.Input;
|
||||
using Core.Thalos.Application.UseCases.Roles.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Validator
|
||||
{
|
||||
public class ChangeRoleStatusValidator : AbstractValidator<ChangeRoleStatusRequest>
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Roles.Input;
|
||||
using Core.Thalos.Application.UseCases.Roles.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Validator
|
||||
{
|
||||
public class CreateRoleValidator : AbstractValidator<CreateRoleRequest>
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Roles.Input;
|
||||
using Core.Thalos.Application.UseCases.Roles.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Roles.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Roles.Validator
|
||||
{
|
||||
public class UpdateRoleValidator : AbstractValidator<UpdateRoleRequest>
|
||||
{
|
||||
@ -1,10 +1,10 @@
|
||||
using Core.Blueprint.Storage.Adapters;
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Application.UseCases.Users.Ports;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Application.UseCases.Users.Ports;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Adapter
|
||||
namespace Core.Thalos.Application.UseCases.Users.Adapter
|
||||
{
|
||||
public class UserPort : BasePresenter, IUserPort
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class AcceptUserConsentFormRequest : ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class AddCompanyToUserRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class AddProjectToUserRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class ChangeUserStatusRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class CreateUserRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class GetAllUsersRequest : ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class GetConsentFormPDFRequest : ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class GetTokenAdapterRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class GetUserByEmailRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class GetUserRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class LoginUserRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class LogoutUserRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class RemoveCompanyFromUserRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class RemoveProjectFromUserRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class UpdateUserRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Input
|
||||
namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
{
|
||||
public class ValidateUserExistenceRequest : Notificator, ICommand
|
||||
{
|
||||
@ -1,8 +1,8 @@
|
||||
using Core.Blueprint.Storage.Adapters;
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Thalos.Adapters;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Ports
|
||||
namespace Core.Thalos.Application.UseCases.Users.Ports
|
||||
{
|
||||
public interface IUserPort : IBasePort,
|
||||
ICommandSuccessPort<UserAdapter>,
|
||||
@ -1,12 +1,12 @@
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Application.UseCases.Users.Input;
|
||||
using Core.Cerberos.Application.UseCases.Users.Ports;
|
||||
using Core.Cerberos.External.Clients;
|
||||
using Core.Cerberos.External.Clients.Requests;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Application.UseCases.Users.Input;
|
||||
using Core.Thalos.Application.UseCases.Users.Ports;
|
||||
using Core.Thalos.External.Clients;
|
||||
using Core.Thalos.External.Clients.Requests;
|
||||
using FluentValidation;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Lib.Architecture.BuildingBlocks.Helpers;
|
||||
namespace Core.Cerberos.Application.UseCases.Users
|
||||
namespace Core.Thalos.Application.UseCases.Users
|
||||
{
|
||||
public class UserHandler :
|
||||
IComponentHandler<ChangeUserStatusRequest>,
|
||||
@ -28,20 +28,20 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
private readonly IValidator<ChangeUserStatusRequest> _changeUserStatusValidator;
|
||||
private readonly IValidator<CreateUserRequest> _registerUserValidator;
|
||||
private readonly IValidator<UpdateUserRequest> _updateUserValidator;
|
||||
private readonly ICerberosServiceClient _cerberosDALService;
|
||||
private readonly IThalosServiceClient _thalosDALService;
|
||||
|
||||
public UserHandler(
|
||||
IUserPort port,
|
||||
IValidator<ChangeUserStatusRequest> changeUserStatusValidator,
|
||||
IValidator<CreateUserRequest> registerUserValidator,
|
||||
IValidator<UpdateUserRequest> updateUserValidator,
|
||||
ICerberosServiceClient cerberosDALService)
|
||||
IThalosServiceClient thalosDALService)
|
||||
{
|
||||
_port = port ?? throw new ArgumentNullException(nameof(port));
|
||||
_changeUserStatusValidator = changeUserStatusValidator ?? throw new ArgumentNullException(nameof(changeUserStatusValidator));
|
||||
_registerUserValidator = registerUserValidator ?? throw new ArgumentNullException(nameof(registerUserValidator));
|
||||
_updateUserValidator = updateUserValidator ?? throw new ArgumentNullException(nameof(updateUserValidator));
|
||||
_cerberosDALService = cerberosDALService ?? throw new ArgumentNullException(nameof(cerberosDALService));
|
||||
_thalosDALService = thalosDALService ?? throw new ArgumentNullException(nameof(thalosDALService));
|
||||
}
|
||||
|
||||
public async ValueTask ExecuteAsync(GetUserRequest command, CancellationToken cancellationToken = default)
|
||||
@ -50,7 +50,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.GetUserByIdAsync(command.Id, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.GetUserByIdAsync(command.Id, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -72,7 +72,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.GetUserByEmailAsync(command.Email, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.GetUserByEmailAsync(command.Email, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -94,7 +94,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.ValidateUserExistence(command.Email, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.ValidateUserExistence(command.Email, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -116,7 +116,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var _result = await _cerberosDALService.GetAllUsersAsync().ConfigureAwait(false);
|
||||
var _result = await _thalosDALService.GetAllUsersAsync().ConfigureAwait(false);
|
||||
if (!_result.Any())
|
||||
{
|
||||
_port.NoContentSuccess();
|
||||
@ -142,7 +142,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
return;
|
||||
}
|
||||
|
||||
var result = await _cerberosDALService.ChangeUserStatusAsync(command.Id, command.Status, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.ChangeUserStatusAsync(command.Id, command.Status, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -181,7 +181,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
Projects = command.Projects,
|
||||
};
|
||||
|
||||
var result = await _cerberosDALService.CreateUserAsync(request, command.SendInvitation, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.CreateUserAsync(request, command.SendInvitation, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -221,7 +221,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
Projects = command.Projects
|
||||
};
|
||||
|
||||
var result = await _cerberosDALService.UpdateUserAsync(request, request.Id, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.UpdateUserAsync(request, request.Id, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -243,7 +243,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.LoginUserAsync(command.Email, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.LoginUserAsync(command.Email, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -265,7 +265,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.LogoutUserAsync(command.Email, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.LogoutUserAsync(command.Email, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -287,7 +287,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.AddCompanyToUserAsync(command.UserId, command.CompanyId, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.AddCompanyToUserAsync(command.UserId, command.CompanyId, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -309,7 +309,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.RemoveCompanyToUserAsync(command.UserId, command.CompanyId, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.RemoveCompanyToUserAsync(command.UserId, command.CompanyId, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -331,7 +331,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.AddProjectToUserAsync(command.UserId, command.ProjectId, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.AddProjectToUserAsync(command.UserId, command.ProjectId, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -353,7 +353,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.RemoveProjectToUserAsync(command.UserId, command.ProjectId, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.RemoveProjectToUserAsync(command.UserId, command.ProjectId, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@ -375,7 +375,7 @@ namespace Core.Cerberos.Application.UseCases.Users
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(command);
|
||||
|
||||
var result = await _cerberosDALService.GetTokenAdapter(command.Email, cancellationToken).ConfigureAwait(false);
|
||||
var result = await _thalosDALService.GetTokenAdapter(command.Email, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
|
||||
if (result == null)
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Users.Input;
|
||||
using Core.Thalos.Application.UseCases.Users.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Users.Validator
|
||||
{
|
||||
public class ChangeUserStatusValidator : AbstractValidator<ChangeUserStatusRequest>
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Users.Input;
|
||||
using Core.Thalos.Application.UseCases.Users.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Users.Validator
|
||||
{
|
||||
public class CreateUserValidator : AbstractValidator<CreateUserRequest>
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Application.UseCases.Users.Input;
|
||||
using Core.Thalos.Application.UseCases.Users.Input;
|
||||
using FluentValidation;
|
||||
|
||||
namespace Core.Cerberos.Application.UseCases.Users.Validator
|
||||
namespace Core.Thalos.Application.UseCases.Users.Validator
|
||||
{
|
||||
public class UpdateUserValidator : AbstractValidator<UpdateUserRequest>
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Core.Cerberos.External.Clients;
|
||||
using Core.Cerberos.External.GatewayConfigurations;
|
||||
using Core.Cerberos.External.Helpers.Token;
|
||||
using Core.Thalos.External.Clients;
|
||||
using Core.Thalos.External.GatewayConfigurations;
|
||||
using Core.Thalos.External.Helpers.Token;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
@ -8,7 +8,7 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Refit;
|
||||
|
||||
namespace Core.Cerberos.External.ClientConfiguration
|
||||
namespace Core.Thalos.External.ClientConfiguration
|
||||
{
|
||||
public static class RegisterClientConfiguration
|
||||
{
|
||||
@ -37,18 +37,18 @@ namespace Core.Cerberos.External.ClientConfiguration
|
||||
return handler;
|
||||
});
|
||||
|
||||
var cerberosServiceApiUrl = GatewaySettingsConfigurations.GetCerberosServiceAPIEndpoint().Endpoint.Url;
|
||||
var thalosServiceApiUrl = GatewaySettingsConfigurations.GetThalosServiceAPIEndpoint().Endpoint.Url;
|
||||
|
||||
// Register ICerberosServiceClient with the manually created HttpClient
|
||||
services.AddScoped<ICerberosServiceClient>(provider =>
|
||||
// Register IThalosServiceClient with the manually created HttpClient
|
||||
services.AddScoped<IThalosServiceClient>(provider =>
|
||||
{
|
||||
var handler = provider.GetRequiredService<AuthenticatedHttpClientHandler>();
|
||||
var httpClient = new HttpClient(handler)
|
||||
{
|
||||
BaseAddress = new Uri(cerberosServiceApiUrl),
|
||||
BaseAddress = new Uri(thalosServiceApiUrl),
|
||||
Timeout = TimeSpan.FromMinutes(1)
|
||||
};
|
||||
return RestService.For<ICerberosServiceClient>(httpClient);
|
||||
return RestService.For<IThalosServiceClient>(httpClient);
|
||||
});
|
||||
|
||||
services.AddScoped<IAuthenticationService, AuthenticationService>();
|
||||
@ -1,14 +1,14 @@
|
||||
using Core.Blueprint.Storage.Adapters;
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Adapters.Common.Constants;
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Cerberos.External.Clients.Requests;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Adapters.Common.Constants;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using Core.Thalos.External.Clients.Requests;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Refit;
|
||||
|
||||
namespace Core.Cerberos.External.Clients
|
||||
namespace Core.Thalos.External.Clients
|
||||
{
|
||||
public interface ICerberosServiceClient
|
||||
public interface IThalosServiceClient
|
||||
{
|
||||
[Get("/v1/User")]
|
||||
Task<IEnumerable<UserAdapter>> GetAllUsersAsync(CancellationToken cancellationToken = default);
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Core.Cerberos.External.Clients.Requests
|
||||
namespace Core.Thalos.External.Clients.Requests
|
||||
{
|
||||
public class ModuleRequest
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using Core.Cerberos.Adapters.Common.Constants;
|
||||
using Core.Thalos.Adapters.Common.Constants;
|
||||
|
||||
namespace Core.Cerberos.External.Clients.Requests
|
||||
namespace Core.Thalos.External.Clients.Requests
|
||||
{
|
||||
public class PermissionRequest
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Cerberos.Adapters.Common.Enums;
|
||||
using Core.Thalos.Adapters.Common.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Core.Cerberos.External.Clients.Requests
|
||||
namespace Core.Thalos.External.Clients.Requests
|
||||
{
|
||||
public class RoleRequest
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace Core.Cerberos.External.Clients.Requests
|
||||
namespace Core.Thalos.External.Clients.Requests
|
||||
{
|
||||
public class UserRequest
|
||||
{
|
||||
@ -9,7 +9,7 @@
|
||||
<ItemGroup>
|
||||
<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="Thalos.Building.Blocks" Version="0.0.1" />
|
||||
<PackageReference Include="Refit" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
using Core.Blueprint.External;
|
||||
|
||||
namespace Core.Cerberos.External.GatewayConfigurations
|
||||
namespace Core.Thalos.External.GatewayConfigurations
|
||||
{
|
||||
public record GatewayConfiguration
|
||||
{
|
||||
public GatewayConfiguration()
|
||||
{
|
||||
CerberosService = new CerberosServiceAPI();
|
||||
ThalosService = new ThalosServiceAPI();
|
||||
}
|
||||
|
||||
public CerberosServiceAPI CerberosService { get; set; }
|
||||
public ThalosServiceAPI ThalosService { get; set; }
|
||||
}
|
||||
public record CerberosServiceAPI
|
||||
public record ThalosServiceAPI
|
||||
{
|
||||
public string Channel { get; set; }
|
||||
public BaseEndpoint Endpoint { get; set; }
|
||||
@ -1,7 +1,7 @@
|
||||
using Core.Blueprint.External;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Core.Cerberos.External.GatewayConfigurations
|
||||
namespace Core.Thalos.External.GatewayConfigurations
|
||||
{
|
||||
public class GatewaySettingsConfigurations
|
||||
{
|
||||
@ -11,13 +11,13 @@ namespace Core.Cerberos.External.GatewayConfigurations
|
||||
public GatewaySettingsConfigurations(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
this.SetCerberosServiceAPIEndpoint();
|
||||
this.SetThalosServiceAPIEndpoint();
|
||||
}
|
||||
public static CerberosServiceAPI GetCerberosServiceAPIEndpoint()
|
||||
public static ThalosServiceAPI GetThalosServiceAPIEndpoint()
|
||||
{
|
||||
return GatewayConfigurations.CerberosService;
|
||||
return GatewayConfigurations.ThalosService;
|
||||
}
|
||||
private GatewayConfiguration SetCerberosServiceAPIEndpoint()
|
||||
private GatewayConfiguration SetThalosServiceAPIEndpoint()
|
||||
{
|
||||
IConfigurationSection source;
|
||||
var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? string.Empty;
|
||||
@ -27,18 +27,18 @@ namespace Core.Cerberos.External.GatewayConfigurations
|
||||
else
|
||||
source = _configuration.GetSection("Gateways");
|
||||
|
||||
var endpoint = source["CerberosDAL"] ?? string.Empty;
|
||||
var endpoint = source["ThalosDAL"] ?? string.Empty;
|
||||
|
||||
if (string.IsNullOrEmpty(endpoint)) throw new Exception("Cerberos DAL endpoint is empty or null");
|
||||
if (string.IsNullOrEmpty(endpoint)) throw new Exception("Thalos DAL endpoint is empty or null");
|
||||
|
||||
GatewayConfigurations.CerberosService = new CerberosServiceAPI()
|
||||
GatewayConfigurations.ThalosService = new ThalosServiceAPI()
|
||||
{
|
||||
Endpoint = new BaseEndpoint()
|
||||
{
|
||||
Uri = new Uri(endpoint),
|
||||
Url = endpoint,
|
||||
Token = string.Empty,
|
||||
APIName = "Cerberos Service"
|
||||
APIName = "Thalos Service"
|
||||
}
|
||||
};
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// </copyright>
|
||||
// ***********************************************************************
|
||||
|
||||
namespace Core.Cerberos.External.Helpers.Token
|
||||
namespace Core.Thalos.External.Helpers.Token
|
||||
{
|
||||
/// <summary>
|
||||
/// Class to inject the token in all requests.
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Core.Cerberos.External.Helpers.Token
|
||||
namespace Core.Thalos.External.Helpers.Token
|
||||
{
|
||||
/// <summary>
|
||||
/// Class to return the access token to controllers.
|
||||
@ -4,7 +4,7 @@
|
||||
// </copyright>
|
||||
// ***********************************************************************
|
||||
|
||||
namespace Core.Cerberos.External.Helpers.Token
|
||||
namespace Core.Thalos.External.Helpers.Token
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for token provider.
|
||||
@ -3,15 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.10.34928.147
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Cerberos.Service.API", "Core.Cerberos.Service.API\Core.Cerberos.Service.API.csproj", "{00F5B578-77EE-44A9-A611-5D753FDF158D}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Thalos.Service.API", "Core.Thalos.Service.API\Core.Thalos.Service.API.csproj", "{00F5B578-77EE-44A9-A611-5D753FDF158D}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Application", "Application", "{F33D7786-EFE5-4618-9D47-C0272227C095}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Presentation", "Presentation", "{685F19C0-CE60-4BFB-9EDB-6834D01A6161}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Cerberos.External", "Core.Cerberos.External\Core.Cerberos.External.csproj", "{52EB3BBE-DACB-4EE5-8FFA-B8DBE34BA137}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core.Thalos.External", "Core.Thalos.External\Core.Thalos.External.csproj", "{52EB3BBE-DACB-4EE5-8FFA-B8DBE34BA137}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Cerberos.Application", "Core.Cerberos.Application\Core.Cerberos.Application.csproj", "{F1980B4D-35C3-4495-84CF-09E1D3822CDA}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Thalos.Application", "Core.Thalos.Application\Core.Thalos.Application.csproj", "{F1980B4D-35C3-4495-84CF-09E1D3822CDA}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -1,14 +1,14 @@
|
||||
using Asp.Versioning;
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Adapters.Attributes;
|
||||
using Core.Cerberos.Adapters.Common.Constants;
|
||||
using Core.Cerberos.Application.UseCases.Modules.Input;
|
||||
using Core.Cerberos.Application.UseCases.Modules.Ports;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Adapters.Attributes;
|
||||
using Core.Thalos.Adapters.Common.Constants;
|
||||
using Core.Thalos.Application.UseCases.Modules.Input;
|
||||
using Core.Thalos.Application.UseCases.Modules.Ports;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Core.Cerberos.Service.API.Controllers
|
||||
namespace Core.Thalos.Service.API.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles all services and business rules related to <see cref="ModuleController"/>.
|
||||
@ -60,7 +60,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("ModuleManagement.Read, RoleManagement.Read")]
|
||||
public async Task<IActionResult> GetAllModulesAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
@ -91,7 +91,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("ModuleManagement.Read")]
|
||||
public async Task<IActionResult> GetAllModulesByListAsync([FromBody] GetAllModulesByListRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
@ -118,7 +118,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("ModuleManagement.Read")]
|
||||
public async Task<IActionResult> GetModuleById([FromBody] GetModuleRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
@ -144,7 +144,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("ModuleManagement.Write")]
|
||||
public async Task<IActionResult> CreateModuleAsync([FromBody] CreateModuleRequest newModule, CancellationToken cancellationToken = default)
|
||||
{
|
||||
@ -164,7 +164,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("ModuleManagement.Write")]
|
||||
public async Task<IActionResult> UpdateModuleAsync([FromBody] UpdateModuleRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
@ -185,7 +185,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("ModuleManagement.Write")]
|
||||
public async Task<IActionResult> ChangeModuleStatusAsync([FromBody] ChangeModuleStatusRequest request,
|
||||
CancellationToken cancellationToken)
|
||||
@ -1,14 +1,14 @@
|
||||
using Asp.Versioning;
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Adapters.Attributes;
|
||||
using Core.Cerberos.Adapters.Common.Constants;
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Input;
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Ports;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Adapters.Attributes;
|
||||
using Core.Thalos.Adapters.Common.Constants;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Input;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Ports;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Core.Cerberos.Service.API.Controllers
|
||||
namespace Core.Thalos.Service.API.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles all services and business rules related to <see cref="PermissionController"/>.
|
||||
@ -60,7 +60,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("PermissionManagement.Read, RoleManagement.Read")]
|
||||
public async Task<IActionResult> GetAllPermissionsAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
@ -91,7 +91,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("PermissionManagement.Read")]
|
||||
public async Task<IActionResult> GetAllPermissionsByListAsync([FromBody] GetAllPermissionsByListRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
@ -118,7 +118,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("PermissionManagement.Read")]
|
||||
public async Task<IActionResult> GetPermissionById([FromBody] GetPermissionRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
@ -144,7 +144,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("PermissionManagement.Write")]
|
||||
public async Task<IActionResult> CreatePermissionAsync([FromBody] CreatePermissionRequest newPermission, CancellationToken cancellationToken = default)
|
||||
{
|
||||
@ -164,7 +164,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("PermissionManagement.Write")]
|
||||
public async Task<IActionResult> UpdatePermissionAsync([FromBody] UpdatePermissionRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
@ -185,7 +185,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("PermissionManagement.Write")]
|
||||
public async Task<IActionResult> ChangePermissionStatusAsync([FromBody] ChangePermissionStatusRequest request,
|
||||
CancellationToken cancellationToken)
|
||||
@ -1,13 +1,13 @@
|
||||
using Asp.Versioning;
|
||||
using Core.Cerberos.Adapters.Attributes;
|
||||
using Core.Cerberos.Adapters.Common.Constants;
|
||||
using Core.Cerberos.Application.UseCases.Roles.Input;
|
||||
using Core.Cerberos.Application.UseCases.Roles.Ports;
|
||||
using Core.Thalos.Adapters.Attributes;
|
||||
using Core.Thalos.Adapters.Common.Constants;
|
||||
using Core.Thalos.Application.UseCases.Roles.Input;
|
||||
using Core.Thalos.Application.UseCases.Roles.Ports;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Core.Cerberos.Service.API.Controllers
|
||||
namespace Core.Thalos.Service.API.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles all requests for role authentication.
|
||||
@ -16,7 +16,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[Route("api/v{api-version:apiVersion}/[controller]")]
|
||||
[Produces("application/json")]
|
||||
[ApiController]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
public class RoleController : ControllerBase
|
||||
{
|
||||
private readonly IComponentHandler<GetRoleRequest> getRoleHandler;
|
||||
@ -63,7 +63,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("RoleManagement.Read")]
|
||||
public async Task<IActionResult> GetAllRolesAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
@ -84,7 +84,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("RoleManagement.Read")]
|
||||
public async Task<IActionResult> GetRoleById([FromBody] GetRoleRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
@ -106,7 +106,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("RoleManagement.Write")]
|
||||
public async Task<IActionResult> CreateRoleAsync([FromBody] CreateRoleRequest newRole, CancellationToken cancellationToken = default)
|
||||
{
|
||||
@ -126,7 +126,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("RoleManagement.Write")]
|
||||
public async Task<IActionResult> UpdateRoleAsync([FromBody] UpdateRoleRequest entity, CancellationToken cancellationToken = default)
|
||||
{
|
||||
@ -147,7 +147,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("RoleManagement.Write")]
|
||||
public async Task<IActionResult> ChageRoleStatusAsync(ChangeRoleStatusRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
@ -170,7 +170,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("RoleManagement.Write")]
|
||||
public async Task<IActionResult> AddApplicationToRoleAsync(AddApplicationToRoleRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
@ -193,7 +193,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("RoleManagement.Write")]
|
||||
public async Task<IActionResult> RemoveApplicationToRoleAsync(RemoveApplicationFromRoleRequest request,
|
||||
CancellationToken cancellationToken)
|
||||
@ -1,14 +1,14 @@
|
||||
using Asp.Versioning;
|
||||
using Core.Cerberos.Adapters;
|
||||
using Core.Cerberos.Adapters.Attributes;
|
||||
using Core.Cerberos.Adapters.Common.Constants;
|
||||
using Core.Cerberos.Application.UseCases.Users.Input;
|
||||
using Core.Cerberos.Application.UseCases.Users.Ports;
|
||||
using Core.Thalos.Adapters;
|
||||
using Core.Thalos.Adapters.Attributes;
|
||||
using Core.Thalos.Adapters.Common.Constants;
|
||||
using Core.Thalos.Application.UseCases.Users.Input;
|
||||
using Core.Thalos.Application.UseCases.Users.Ports;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Core.Cerberos.Service.API.Controllers
|
||||
namespace Core.Thalos.Service.API.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles all requests for user.
|
||||
@ -90,7 +90,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("UserManagement.Read")]
|
||||
public async Task<IActionResult> GetAllUsersAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
@ -111,7 +111,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("UserManagement.Read")]
|
||||
public async Task<IActionResult> GetUserById([FromBody] GetUserRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
@ -134,7 +134,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = $"{Schemes.HeathScheme}, {Schemes.AzureScheme}")]
|
||||
[Authorize(AuthenticationSchemes = $"{Schemes.DefaultScheme}, {Schemes.AzureScheme}")]
|
||||
public async Task<IActionResult> GetUserByEmail([FromBody] GetUserByEmailRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrEmpty(request.Email)) { return BadRequest("Invalid user email"); }
|
||||
@ -156,7 +156,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("UserManagement.Write")]
|
||||
public async Task<IActionResult> CreateUserAsync([FromBody] CreateUserRequest newUser, CancellationToken cancellationToken = default)
|
||||
{
|
||||
@ -176,7 +176,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("UserManagement.Write")]
|
||||
public async Task<IActionResult> UpdateUserAsync([FromBody] UpdateUserRequest request,
|
||||
CancellationToken cancellationToken = default)
|
||||
@ -197,7 +197,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = $"{Schemes.HeathScheme}, {Schemes.AzureScheme}")]
|
||||
[Authorize(AuthenticationSchemes = $"{Schemes.DefaultScheme}, {Schemes.AzureScheme}")]
|
||||
public async Task<IActionResult> LoginUserAsync([FromBody] LoginUserRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrEmpty(request.Email)) { return BadRequest("Invalid user email"); }
|
||||
@ -239,7 +239,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("UserManagement.Write")]
|
||||
public async Task<IActionResult> ChangeUserStatusAsync([FromBody] ChangeUserStatusRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
@ -262,7 +262,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("UserManagement.Write")]
|
||||
public async Task<IActionResult> AddCompanyToUserAsync([FromBody] AddCompanyToUserRequest request,
|
||||
CancellationToken cancellationToken)
|
||||
@ -287,7 +287,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("UserManagement.Write")]
|
||||
public async Task<IActionResult> RemoveCompanyFromUserAsync([FromBody] RemoveCompanyFromUserRequest request,
|
||||
CancellationToken cancellationToken)
|
||||
@ -312,7 +312,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("UserManagement.Write")]
|
||||
public async Task<IActionResult> AddProjectToUserAsync([FromBody] AddProjectToUserRequest request,
|
||||
CancellationToken cancellationToken)
|
||||
@ -337,7 +337,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status412PreconditionFailed)]
|
||||
[ProducesResponseType(typeof(Notification), StatusCodes.Status422UnprocessableEntity)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.HeathScheme)]
|
||||
[Authorize(AuthenticationSchemes = Schemes.DefaultScheme)]
|
||||
[Permission("UserManagement.Write")]
|
||||
public async Task<IActionResult> RemoveProjectFromUserAsync([FromBody] RemoveProjectFromUserRequest request,
|
||||
CancellationToken cancellationToken)
|
||||
@ -379,7 +379,7 @@ namespace Core.Cerberos.Service.API.Controllers
|
||||
[HttpPost]
|
||||
[Route("GetTokenAdapter")]
|
||||
[ProducesResponseType(typeof(TokenAdapter), StatusCodes.Status200OK)]
|
||||
[Authorize(AuthenticationSchemes = $"{Schemes.HeathScheme}, {Schemes.AzureScheme}")]
|
||||
[Authorize(AuthenticationSchemes = $"{Schemes.DefaultScheme}, {Schemes.AzureScheme}")]
|
||||
public async Task<IActionResult> GetTokenAdapter([FromBody] GetTokenAdapterRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrEmpty(request.Email)) { return BadRequest("Invalid user email"); }
|
||||
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
@ -8,8 +8,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Core.Cerberos.Application\Core.Cerberos.Application.csproj" />
|
||||
<ProjectReference Include="..\Core.Cerberos.External\Core.Cerberos.External.csproj" />
|
||||
<ProjectReference Include="..\Core.Thalos.Application\Core.Thalos.Application.csproj" />
|
||||
<ProjectReference Include="..\Core.Thalos.External\Core.Thalos.External.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -4,7 +4,7 @@ using Microsoft.OpenApi.Models;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
using Swashbuckle.AspNetCore.SwaggerUI;
|
||||
|
||||
namespace Core.Cerberos.Service.API.Extensions
|
||||
namespace Core.Thalos.Service.API.Extensions
|
||||
{
|
||||
public static class SwaggerExtensions
|
||||
{
|
||||
@ -1,27 +1,27 @@
|
||||
using Core.Cerberos.Adapters.Extensions;
|
||||
using Core.Cerberos.Adapters.Helpers;
|
||||
using Core.Cerberos.Application.UseCases.Modules;
|
||||
using Core.Cerberos.Application.UseCases.Modules.Adapter;
|
||||
using Core.Cerberos.Application.UseCases.Modules.Input;
|
||||
using Core.Cerberos.Application.UseCases.Modules.Ports;
|
||||
using Core.Cerberos.Application.UseCases.Modules.Validator;
|
||||
using Core.Cerberos.Application.UseCases.Permissions;
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Adapter;
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Input;
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Ports;
|
||||
using Core.Cerberos.Application.UseCases.Permissions.Validator;
|
||||
using Core.Cerberos.Application.UseCases.Role;
|
||||
using Core.Cerberos.Application.UseCases.Roles.Adapter;
|
||||
using Core.Cerberos.Application.UseCases.Roles.Input;
|
||||
using Core.Cerberos.Application.UseCases.Roles.Ports;
|
||||
using Core.Cerberos.Application.UseCases.Roles.Validator;
|
||||
using Core.Cerberos.Application.UseCases.Users;
|
||||
using Core.Cerberos.Application.UseCases.Users.Adapter;
|
||||
using Core.Cerberos.Application.UseCases.Users.Input;
|
||||
using Core.Cerberos.Application.UseCases.Users.Ports;
|
||||
using Core.Cerberos.Application.UseCases.Users.Validator;
|
||||
using Core.Cerberos.External.ClientConfiguration;
|
||||
using Core.Cerberos.Service.API.Extensions;
|
||||
using Core.Thalos.Adapters.Extensions;
|
||||
using Core.Thalos.Adapters.Helpers;
|
||||
using Core.Thalos.Application.UseCases.Modules;
|
||||
using Core.Thalos.Application.UseCases.Modules.Adapter;
|
||||
using Core.Thalos.Application.UseCases.Modules.Input;
|
||||
using Core.Thalos.Application.UseCases.Modules.Ports;
|
||||
using Core.Thalos.Application.UseCases.Modules.Validator;
|
||||
using Core.Thalos.Application.UseCases.Permissions;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Adapter;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Input;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Ports;
|
||||
using Core.Thalos.Application.UseCases.Permissions.Validator;
|
||||
using Core.Thalos.Application.UseCases.Role;
|
||||
using Core.Thalos.Application.UseCases.Roles.Adapter;
|
||||
using Core.Thalos.Application.UseCases.Roles.Input;
|
||||
using Core.Thalos.Application.UseCases.Roles.Ports;
|
||||
using Core.Thalos.Application.UseCases.Roles.Validator;
|
||||
using Core.Thalos.Application.UseCases.Users;
|
||||
using Core.Thalos.Application.UseCases.Users.Adapter;
|
||||
using Core.Thalos.Application.UseCases.Users.Input;
|
||||
using Core.Thalos.Application.UseCases.Users.Ports;
|
||||
using Core.Thalos.Application.UseCases.Users.Validator;
|
||||
using Core.Thalos.External.ClientConfiguration;
|
||||
using Core.Thalos.Service.API.Extensions;
|
||||
using FluentValidation;
|
||||
using Lib.Architecture.BuildingBlocks;
|
||||
using Microsoft.AspNetCore.ResponseCompression;
|
||||
@ -29,7 +29,7 @@ using System.IO.Compression;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
var authSettings = AuthHelper.GetAuthSettings(builder, "cerberos_service");
|
||||
var authSettings = AuthHelper.GetAuthSettings(builder, "thalos_service");
|
||||
|
||||
builder.Services.ConfigureAuthentication(builder.Configuration, authSettings);
|
||||
|
||||
@ -64,7 +64,7 @@ builder.Host.ConfigureServices((context, services) =>
|
||||
services.AddResponseCaching();
|
||||
services.AddControllers();
|
||||
services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwagger(builder.Configuration, "Core.Cerberos.Service.API.xml", authSettings);
|
||||
builder.Services.AddSwagger(builder.Configuration, "Core.Thalos.Service.API.xml", authSettings);
|
||||
builder.Services.AddVersioning(builder.Configuration);
|
||||
services.AddLogging();
|
||||
services.AddProblemDetails();
|
||||
6
Core.Thalos.Service.API/Thalos.Service.API.http
Normal file
6
Core.Thalos.Service.API/Thalos.Service.API.http
Normal file
@ -0,0 +1,6 @@
|
||||
@Core.Thalos.Service.API_HostAddress = http://localhost:5145
|
||||
|
||||
GET {{Core.Thalos.Service.API_HostAddress}}/weatherforecast/
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
@ -7,6 +7,6 @@
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"LocalGateways": {
|
||||
"CerberosDAL": "https://localhost:7031/api"
|
||||
"ThalosDAL": "https://localhost:7031/api"
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"Gateways": {
|
||||
"CerberosDAL": "" // Data access layer endpoint
|
||||
"ThalosDAL": "" // Data access layer endpoint
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"KeyVault": "" //KeyVault Uri
|
||||
@ -17,11 +17,11 @@
|
||||
"CallbackPath": "", // Path for redirect after authentication
|
||||
"Scopes": "" // Access scopes for user permissions
|
||||
},
|
||||
"HeathCerberosApp": {
|
||||
"ThalosApp": {
|
||||
"AuthorizationUrl": "", // URL for authorization endpoint (STORED IN KEY VAULT)
|
||||
"TokenUrl": "", // URL for token endpoint (STORED IN KEY VAULT)
|
||||
"Scope": "", // Scope for application permissions (STORED IN KEY VAULT)
|
||||
"ClientId": "" // Client ID for Cerberos application (STORED IN KEY VAULT)
|
||||
"ClientId": "" // Client ID for Thalos application (STORED IN KEY VAULT)
|
||||
},
|
||||
"MicrosoftGraph": {
|
||||
"Scopes": "", // Scopes for Microsoft Graph API access
|
||||
Loading…
Reference in New Issue
Block a user