From 06539236a17b17d3a8e2c6de6b124fe06adb886c Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sun, 4 Oct 2026 14:31:06 +0200 Subject: [PATCH 1/3] Added skoruba api integration --- .../GetApplicantInviteEndpoint.cs | 1 - .../GetApplicantInvitesEndpoint.cs | 1 - .../Communications/GetInvitesEndpoint.cs | 1 - .../GetNotificationsEndpoint.cs | 3 +- .../Communications/SendInviteEndpoint.cs | 1 - .../Evidence/CreateEvidenceEndpoint.cs | 1 - .../Evidence/CreateIndicatorEndpoint.cs | 1 - .../Evidence/CreateMilestoneEndpoint.cs | 1 - .../Endpoints/Evidence/GetEvidenceEndpoint.cs | 1 - .../Evidence/GetEvidenceFilesEndpoint.cs | 1 - .../Evidence/GetEvidenceUrlEndpoint.cs | 1 - .../Evidence/GetIndicatorEndpoint.cs | 1 - .../Evidence/GetIndicatorsEndpoint.cs | 1 - .../Evidence/GetMilestoneEvidenceEndpoint.cs | 1 - .../Evidence/GetProjectEvidenceEndpoint.cs | 1 - .../Evidence/RecordIndicatorAmountEndpoint.cs | 1 - .../Evidence/UpdateEvidenceEndpoint.cs | 1 - .../Execution/ApproveDisbursementEndpoint.cs | 1 - .../Execution/CreateDisbursementEndpoint.cs | 1 - .../Endpoints/Execution/CreateRiskEndpoint.cs | 1 - .../Endpoints/Execution/CreateRuleEndpoint.cs | 1 - .../Execution/GetDisbursementEndpoint.cs | 1 - .../Execution/GetDisbursementsEndpoint.cs | 1 - .../Endpoints/Execution/GetRiskEndpoint.cs | 1 - .../Endpoints/Execution/GetRisksEndpoint.cs | 1 - .../Endpoints/Execution/GetRuleEndpoint.cs | 1 - .../Endpoints/Execution/GetRulesEndpoint.cs | 1 - .../Execution/UpdateDisbursementEndpoint.cs | 1 - .../Endpoints/Execution/UpdateRiskEndpoint.cs | 1 - .../Endpoints/Execution/UpdateRuleEndpoint.cs | 1 - .../Governance/CreateInstrumentEndpoint.cs | 1 - .../Governance/CreateOrganisationEndpoint.cs | 1 - .../Governance/CreatePortfolioEndpoint.cs | 1 - .../Governance/CreateTenantEndpoint.cs | 1 - .../Endpoints/Governance/DashboardEndpoint.cs | 1 - .../Governance/GetAuditLogsEndpoint.cs | 1 - .../Governance/GetInstrumentsEndpoint.cs | 1 - .../Governance/GetOrganisationEndpoint.cs | 1 - .../GetOrganisationPortfoliosEndpoint.cs | 1 - .../Governance/GetOrganisationsEndpoint.cs | 1 - .../Governance/GetPorfolioValueEndpoint.cs | 1 - .../Governance/GetPortfolioEndpoint.cs | 1 - .../GetPortfolioProgrammesEndpoint.cs | 1 - .../Governance/GetPortfoliosEndpoint.cs | 1 - .../Governance/GetProgrammeValueEndpoint.cs | 1 - .../Governance/GetProgrammesEndpoint.cs | 1 - .../Endpoints/Governance/GetTenantEndpoint.cs | 1 - .../GetTenantOrganisationsEndpoint.cs | 2 - .../Governance/GetTenantsEndpoint.cs | 1 - .../Governance/UpdateInstrumentEndpoint.cs | 1 - .../Governance/UpdateOrganisationEndpoint.cs | 1 - .../Governance/UpdatePortfolioEndpoint.cs | 1 - .../Governance/UpdateTenantEndpoint.cs | 1 - .../Endpoints/Grants/CreateAwardEndpoint.cs | 1 - .../Endpoints/Grants/CreateBudgetEndpoint.cs | 1 - .../Grants/CreateContractEndpoint.cs | 1 - .../Grants/ExecuteContractEndpoint.cs | 1 - .../Endpoints/Grants/GetAwardEndpoint.cs | 1 - .../Endpoints/Grants/GetAwardsEndpoint.cs | 1 - .../Endpoints/Grants/GetBudgetEndpoint.cs | 1 - .../Endpoints/Grants/GetBudgetsEndpoint.cs | 1 - .../Endpoints/Grants/GetContractEndpoint.cs | 1 - .../Grants/GetContractUrlEndpoint.cs | 1 - .../Endpoints/Grants/GetContractsEndpoint.cs | 1 - .../Endpoints/Grants/UpdateBudgetEndpoint.cs | 1 - .../Grants/UpdateContractEndpoint.cs | 1 - .../Grants/UploadContractEndpoint.cs | 1 - .../Projects/CreateActivityEndpoint.cs | 1 - .../Projects/CreateBeneficiaryEndpoint.cs | 1 - .../Projects/CreateChangeRequestEndpoint.cs | 1 - .../Projects/CreateComplianceItemEndpoint.cs | 1 - .../Endpoints/Projects/CreateIssueEndpoint.cs | 1 - .../Projects/CreateOutcomeEndpoint.cs | 1 - .../Projects/CreateProgrammeEndpoint.cs | 1 - .../Projects/CreateProjectEndpoint.cs | 1 - .../Projects/CreateSiteVisitEndpoint.cs | 1 - .../Projects/GetActivitiesEndpoint.cs | 1 - .../Endpoints/Projects/GetActivityEndpoint.cs | 1 - .../Projects/GetBeneficiariesEndpoint.cs | 1 - .../Projects/GetBeneficiaryEndpoint.cs | 1 - .../Projects/GetChangeRequestEndpoint.cs | 1 - .../Projects/GetChangeRequestsEndpoint.cs | 1 - .../Projects/GetComplianceItemEndpoint.cs | 1 - .../Projects/GetComplianceItemsEndpoint.cs | 1 - .../Endpoints/Projects/GetIssueEndpoint.cs | 1 - .../Endpoints/Projects/GetIssuesEndpoint.cs | 1 - .../Projects/GetMilestoneEndpoint.cs | 1 - .../Projects/GetMilestonesEndpoint.cs | 1 - .../Endpoints/Projects/GetOutcomeEndpoint.cs | 1 - .../Endpoints/Projects/GetOutcomesEndpoint.cs | 1 - .../Projects/GetProgrammeEndpoint.cs | 1 - .../Projects/GetProgrammeProjectsEndpoint.cs | 1 - .../Projects/GetProgrammesEndpoint.cs | 1 - .../Endpoints/Projects/GetProjectEndpoint.cs | 1 - .../Projects/GetProjectIndicatorsEndpoint.cs | 1 - .../Projects/GetProjectMilestonesEndpoint.cs | 1 - .../Projects/GetProjectRisksEndpoint.cs | 1 - .../Endpoints/Projects/GetProjectsEndpoint.cs | 1 - .../Projects/GetSiteVisitEndpoint.cs | 1 - .../Projects/GetSiteVisitsEndpoint.cs | 1 - .../Projects/UpdateBeneficiaryEndpoint.cs | 1 - .../Projects/UpdateChangeRequestEndpoint.cs | 1 - .../Projects/UpdateComplianceItemEndpoint.cs | 1 - .../Endpoints/Projects/UpdateIssueEndpoint.cs | 1 - .../Projects/UpdateMilestoneEndpoint.cs | 1 - .../Projects/UpdateOutcomeEndpoint.cs | 1 - .../Projects/UpdateProgrammeEndpoint.cs | 1 - .../Projects/UpdateProjectEndpoint.cs | 1 - .../Projects/UpdateProjectStatusEndpoint.cs | 1 - .../Projects/UpdateSiteVisitEndpoint.cs | 1 - .../Endpoints/Users/GetUserEndpoint.cs | 1 - .../Endpoints/Users/GetUsersEndpoint.cs | 1 - .../Endpoints/Users/SyncUserEndpoint.cs | 2 - .../Users/UpdateUserStatusEndpoint.cs | 1 - .../PostFundManagement.Api.csproj | 2 + PostFundManagement.Api/Program.cs | 2 +- PostFundManagement.Api/appsettings.json | 6 +- .../{ => Services}/S3ServiceBase.cs | 2 +- .../{ => Services}/ServiceCacheBase.cs | 2 +- .../Extensions/Api.cs | 5 +- .../Extensions/Security.cs | 44 +++++++++- .../Extensions/ServiceExtensionTools.cs | 78 ++++++++++++++++++ .../Extensions/Services.cs | 50 ----------- .../PostFundManagement.Application.csproj | 4 + .../CommunicationsCacheService.cs | 3 +- .../Services/Evidence/EvidenceCacheService.cs | 3 +- .../Execution/ExecutionCacheService.cs | 3 +- .../Governance/GovernanceCacheService.cs | 3 +- .../Services/Grants/GrantsCacheService.cs | 3 +- .../Services/Projects/ProjectCacheService.cs | 3 +- .../Services/Shared/GeneralS3Service.cs | 2 +- .../Services/Shared/IdentityCacheService.cs | 3 +- .../Services/Shared/IdentityService.cs | 7 +- .../Services/Shared/TokenService.cs | 16 ++-- .../Services/Users/UserCacheService.cs | 3 +- .../Abstractions/ISkorubaUserService.cs | 30 +++++++ .../ApiVersionTargetAttribute.cs | 2 +- .../Security/MachineIdentitySettings.cs | 12 +++ .../Security}/SecurityClientSettings.cs | 2 +- .../Security}/SecuritySettings.cs | 2 +- .../Extensions/Constants.cs | 16 +--- .../Models/Security/Contracts.cs | 9 ++ .../Security}/TokenErrorResponse.cs | 2 +- .../Security}/TokenRequest.cs | 2 +- .../Security}/TokenResponse.cs | 2 +- .../Security/Configuration/MachineIdentity.cs | 12 --- .../Security/Sdk/ISecurityConnectApi.cs | 7 -- .../PostFundManagement.Infrastructure.csproj | 6 ++ .../Security/ISecurityConnectApi.cs | 9 ++ .../OpenApiBearerSecuritySchemeTransformer.cs | 2 +- .../Security/SkorubaUserService.cs | 82 +++++++++++++++++++ 151 files changed, 317 insertions(+), 242 deletions(-) rename PostFundManagement.Application/Abstractions/{ => Services}/S3ServiceBase.cs (98%) rename PostFundManagement.Application/Abstractions/{ => Services}/ServiceCacheBase.cs (74%) create mode 100644 PostFundManagement.Application/Extensions/ServiceExtensionTools.cs create mode 100644 PostFundManagement.Domain/Abstractions/ISkorubaUserService.cs rename PostFundManagement.Domain/{Security => Attributes}/ApiVersionTargetAttribute.cs (80%) create mode 100644 PostFundManagement.Domain/Configuration/Security/MachineIdentitySettings.cs rename PostFundManagement.Domain/{Security/Configuration => Configuration/Security}/SecurityClientSettings.cs (81%) rename PostFundManagement.Domain/{Security/Configuration => Configuration/Security}/SecuritySettings.cs (78%) create mode 100644 PostFundManagement.Domain/Models/Security/Contracts.cs rename PostFundManagement.Domain/{Security/Models => Models/Security}/TokenErrorResponse.cs (84%) rename PostFundManagement.Domain/{Security/Models => Models/Security}/TokenRequest.cs (89%) rename PostFundManagement.Domain/{Security/Models => Models/Security}/TokenResponse.cs (86%) delete mode 100644 PostFundManagement.Domain/Security/Configuration/MachineIdentity.cs delete mode 100644 PostFundManagement.Domain/Security/Sdk/ISecurityConnectApi.cs create mode 100644 PostFundManagement.Infrastructure/Security/ISecurityConnectApi.cs rename {PostFundManagement.Domain => PostFundManagement.Infrastructure}/Security/OpenApiBearerSecuritySchemeTransformer.cs (90%) create mode 100644 PostFundManagement.Infrastructure/Security/SkorubaUserService.cs diff --git a/PostFundManagement.Api/Endpoints/Communications/GetApplicantInviteEndpoint.cs b/PostFundManagement.Api/Endpoints/Communications/GetApplicantInviteEndpoint.cs index 549ab46..469030c 100644 --- a/PostFundManagement.Api/Endpoints/Communications/GetApplicantInviteEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Communications/GetApplicantInviteEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Communications; diff --git a/PostFundManagement.Api/Endpoints/Communications/GetApplicantInvitesEndpoint.cs b/PostFundManagement.Api/Endpoints/Communications/GetApplicantInvitesEndpoint.cs index 2bc28b8..62ff7be 100644 --- a/PostFundManagement.Api/Endpoints/Communications/GetApplicantInvitesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Communications/GetApplicantInvitesEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Communications; diff --git a/PostFundManagement.Api/Endpoints/Communications/GetInvitesEndpoint.cs b/PostFundManagement.Api/Endpoints/Communications/GetInvitesEndpoint.cs index 879ba57..c4932e6 100644 --- a/PostFundManagement.Api/Endpoints/Communications/GetInvitesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Communications/GetInvitesEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using static PostFundManagement.Application.Extensions.General; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; diff --git a/PostFundManagement.Api/Endpoints/Communications/GetNotificationsEndpoint.cs b/PostFundManagement.Api/Endpoints/Communications/GetNotificationsEndpoint.cs index 79b67b3..80e2d30 100644 --- a/PostFundManagement.Api/Endpoints/Communications/GetNotificationsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Communications/GetNotificationsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using static PostFundManagement.Application.Extensions.General; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; @@ -15,7 +14,7 @@ public sealed class GetNotificationsEndpoint : IEndpoint { public void Map(IEndpointRouteBuilder builder) { - builder.MapGet("api/communications/norifications/{organisationId}", async (string organisationId, + builder.MapGet("api/communications/notifications/{organisationId}", async (string organisationId, ICommunicationsService service, CancellationToken cancellationToken = default) => await service.GetNotificationsAsync(organisationId, cancellationToken) switch { diff --git a/PostFundManagement.Api/Endpoints/Communications/SendInviteEndpoint.cs b/PostFundManagement.Api/Endpoints/Communications/SendInviteEndpoint.cs index 371adc4..79c606a 100644 --- a/PostFundManagement.Api/Endpoints/Communications/SendInviteEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Communications/SendInviteEndpoint.cs @@ -5,7 +5,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Communications; diff --git a/PostFundManagement.Api/Endpoints/Evidence/CreateEvidenceEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/CreateEvidenceEndpoint.cs index b3fe459..62e123d 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/CreateEvidenceEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/CreateEvidenceEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Evidence/CreateIndicatorEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/CreateIndicatorEndpoint.cs index 5642f0d..f4caad6 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/CreateIndicatorEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/CreateIndicatorEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Evidence; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Evidence/CreateMilestoneEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/CreateMilestoneEndpoint.cs index 5472827..eea7d47 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/CreateMilestoneEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/CreateMilestoneEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Evidence; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceEndpoint.cs index 1e50d5f..0222ef2 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceFilesEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceFilesEndpoint.cs index 821b7dc..0624477 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceFilesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceFilesEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceUrlEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceUrlEndpoint.cs index 77ed22c..3c910d5 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceUrlEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/GetEvidenceUrlEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Evidence/GetIndicatorEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/GetIndicatorEndpoint.cs index 619a167..d36afa5 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/GetIndicatorEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/GetIndicatorEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Evidence/GetIndicatorsEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/GetIndicatorsEndpoint.cs index cfcd9b1..e4b500a 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/GetIndicatorsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/GetIndicatorsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Evidence/GetMilestoneEvidenceEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/GetMilestoneEvidenceEndpoint.cs index 8dd325c..f65efb8 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/GetMilestoneEvidenceEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/GetMilestoneEvidenceEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Evidence/GetProjectEvidenceEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/GetProjectEvidenceEndpoint.cs index e7b9970..c39e9ec 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/GetProjectEvidenceEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/GetProjectEvidenceEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Evidence/RecordIndicatorAmountEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/RecordIndicatorAmountEndpoint.cs index 8ab6040..3c617ac 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/RecordIndicatorAmountEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/RecordIndicatorAmountEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Evidence/UpdateEvidenceEndpoint.cs b/PostFundManagement.Api/Endpoints/Evidence/UpdateEvidenceEndpoint.cs index 3a5d310..4db42ba 100644 --- a/PostFundManagement.Api/Endpoints/Evidence/UpdateEvidenceEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Evidence/UpdateEvidenceEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Evidence; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Evidence; diff --git a/PostFundManagement.Api/Endpoints/Execution/ApproveDisbursementEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/ApproveDisbursementEndpoint.cs index 0cb1f0e..3424687 100644 --- a/PostFundManagement.Api/Endpoints/Execution/ApproveDisbursementEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/ApproveDisbursementEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/CreateDisbursementEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/CreateDisbursementEndpoint.cs index 7905d82..cbc225d 100644 --- a/PostFundManagement.Api/Endpoints/Execution/CreateDisbursementEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/CreateDisbursementEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Execution; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/CreateRiskEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/CreateRiskEndpoint.cs index 48e3bce..f9418c4 100644 --- a/PostFundManagement.Api/Endpoints/Execution/CreateRiskEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/CreateRiskEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Execution; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/CreateRuleEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/CreateRuleEndpoint.cs index dabde01..6a093b7 100644 --- a/PostFundManagement.Api/Endpoints/Execution/CreateRuleEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/CreateRuleEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Execution; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/GetDisbursementEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/GetDisbursementEndpoint.cs index 827ab0f..95118d4 100644 --- a/PostFundManagement.Api/Endpoints/Execution/GetDisbursementEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/GetDisbursementEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/GetDisbursementsEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/GetDisbursementsEndpoint.cs index 55f5adb..b498ec2 100644 --- a/PostFundManagement.Api/Endpoints/Execution/GetDisbursementsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/GetDisbursementsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/GetRiskEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/GetRiskEndpoint.cs index 5478fde..9d78329 100644 --- a/PostFundManagement.Api/Endpoints/Execution/GetRiskEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/GetRiskEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/GetRisksEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/GetRisksEndpoint.cs index 969a12e..ecd2fb6 100644 --- a/PostFundManagement.Api/Endpoints/Execution/GetRisksEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/GetRisksEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/GetRuleEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/GetRuleEndpoint.cs index f0bca27..11ecc5e 100644 --- a/PostFundManagement.Api/Endpoints/Execution/GetRuleEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/GetRuleEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/GetRulesEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/GetRulesEndpoint.cs index b3a1a50..1ca8f40 100644 --- a/PostFundManagement.Api/Endpoints/Execution/GetRulesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/GetRulesEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/UpdateDisbursementEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/UpdateDisbursementEndpoint.cs index 14bc36e..8ecb1ae 100644 --- a/PostFundManagement.Api/Endpoints/Execution/UpdateDisbursementEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/UpdateDisbursementEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Execution; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/UpdateRiskEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/UpdateRiskEndpoint.cs index 6d55a7f..b0d0f70 100644 --- a/PostFundManagement.Api/Endpoints/Execution/UpdateRiskEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/UpdateRiskEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Execution; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Execution/UpdateRuleEndpoint.cs b/PostFundManagement.Api/Endpoints/Execution/UpdateRuleEndpoint.cs index 8a8f864..ff8f53a 100644 --- a/PostFundManagement.Api/Endpoints/Execution/UpdateRuleEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Execution/UpdateRuleEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Execution; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Execution; diff --git a/PostFundManagement.Api/Endpoints/Governance/CreateInstrumentEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/CreateInstrumentEndpoint.cs index 886a543..80a6073 100644 --- a/PostFundManagement.Api/Endpoints/Governance/CreateInstrumentEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/CreateInstrumentEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Governance; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/CreateOrganisationEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/CreateOrganisationEndpoint.cs index 091e28b..334bde9 100644 --- a/PostFundManagement.Api/Endpoints/Governance/CreateOrganisationEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/CreateOrganisationEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Governance; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/CreatePortfolioEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/CreatePortfolioEndpoint.cs index 1405690..8c38558 100644 --- a/PostFundManagement.Api/Endpoints/Governance/CreatePortfolioEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/CreatePortfolioEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Governance; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/CreateTenantEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/CreateTenantEndpoint.cs index 572928e..6f0fffa 100644 --- a/PostFundManagement.Api/Endpoints/Governance/CreateTenantEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/CreateTenantEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Governance; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/DashboardEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/DashboardEndpoint.cs index 0cd7ffe..572f11e 100644 --- a/PostFundManagement.Api/Endpoints/Governance/DashboardEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/DashboardEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Application.Services.Governance; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetAuditLogsEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetAuditLogsEndpoint.cs index 3421316..7f086d0 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetAuditLogsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetAuditLogsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetInstrumentsEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetInstrumentsEndpoint.cs index 937bf4a..83db06a 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetInstrumentsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetInstrumentsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetOrganisationEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetOrganisationEndpoint.cs index 3c12110..96f841b 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetOrganisationEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetOrganisationEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetOrganisationPortfoliosEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetOrganisationPortfoliosEndpoint.cs index a2071a0..496a984 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetOrganisationPortfoliosEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetOrganisationPortfoliosEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetOrganisationsEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetOrganisationsEndpoint.cs index a1eb72b..3f08d06 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetOrganisationsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetOrganisationsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetPorfolioValueEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetPorfolioValueEndpoint.cs index b690f19..82d22ae 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetPorfolioValueEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetPorfolioValueEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetPortfolioEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetPortfolioEndpoint.cs index 9119acc..8229e24 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetPortfolioEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetPortfolioEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetPortfolioProgrammesEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetPortfolioProgrammesEndpoint.cs index b6825e8..b2f5f56 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetPortfolioProgrammesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetPortfolioProgrammesEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetPortfoliosEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetPortfoliosEndpoint.cs index dd8b94e..311ec87 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetPortfoliosEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetPortfoliosEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetProgrammeValueEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetProgrammeValueEndpoint.cs index 142614f..fc3de4f 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetProgrammeValueEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetProgrammeValueEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetProgrammesEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetProgrammesEndpoint.cs index 83efaaa..aabc0f5 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetProgrammesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetProgrammesEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetTenantEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetTenantEndpoint.cs index 4a8b71b..850aeeb 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetTenantEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetTenantEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetTenantOrganisationsEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetTenantOrganisationsEndpoint.cs index f1251aa..0d22bcf 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetTenantOrganisationsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetTenantOrganisationsEndpoint.cs @@ -4,8 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Entities; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; -using StackExchange.Redis; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/GetTenantsEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/GetTenantsEndpoint.cs index 865a037..e4f954c 100644 --- a/PostFundManagement.Api/Endpoints/Governance/GetTenantsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/GetTenantsEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Entities; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/UpdateInstrumentEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/UpdateInstrumentEndpoint.cs index ecbc6ef..292b542 100644 --- a/PostFundManagement.Api/Endpoints/Governance/UpdateInstrumentEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/UpdateInstrumentEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Governance; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/UpdateOrganisationEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/UpdateOrganisationEndpoint.cs index 085beac..c493bc9 100644 --- a/PostFundManagement.Api/Endpoints/Governance/UpdateOrganisationEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/UpdateOrganisationEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Governance; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/UpdatePortfolioEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/UpdatePortfolioEndpoint.cs index 9a0d5c7..d8cc5d9 100644 --- a/PostFundManagement.Api/Endpoints/Governance/UpdatePortfolioEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/UpdatePortfolioEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Governance; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Governance/UpdateTenantEndpoint.cs b/PostFundManagement.Api/Endpoints/Governance/UpdateTenantEndpoint.cs index 949522f..ca065eb 100644 --- a/PostFundManagement.Api/Endpoints/Governance/UpdateTenantEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Governance/UpdateTenantEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Governance; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Governance; diff --git a/PostFundManagement.Api/Endpoints/Grants/CreateAwardEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/CreateAwardEndpoint.cs index edf4f19..7e2ee74 100644 --- a/PostFundManagement.Api/Endpoints/Grants/CreateAwardEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/CreateAwardEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Grants; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/CreateBudgetEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/CreateBudgetEndpoint.cs index 471615e..6e104e1 100644 --- a/PostFundManagement.Api/Endpoints/Grants/CreateBudgetEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/CreateBudgetEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Grants; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/CreateContractEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/CreateContractEndpoint.cs index cc59bbb..8d2b2b6 100644 --- a/PostFundManagement.Api/Endpoints/Grants/CreateContractEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/CreateContractEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Grants; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/ExecuteContractEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/ExecuteContractEndpoint.cs index fa6ac70..a57a7bd 100644 --- a/PostFundManagement.Api/Endpoints/Grants/ExecuteContractEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/ExecuteContractEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Grants; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/GetAwardEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/GetAwardEndpoint.cs index 3ae4908..76162ca 100644 --- a/PostFundManagement.Api/Endpoints/Grants/GetAwardEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/GetAwardEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/GetAwardsEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/GetAwardsEndpoint.cs index d35efd6..393b8ee 100644 --- a/PostFundManagement.Api/Endpoints/Grants/GetAwardsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/GetAwardsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/GetBudgetEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/GetBudgetEndpoint.cs index 70389c7..c7f0696 100644 --- a/PostFundManagement.Api/Endpoints/Grants/GetBudgetEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/GetBudgetEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/GetBudgetsEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/GetBudgetsEndpoint.cs index 7109591..30b84d5 100644 --- a/PostFundManagement.Api/Endpoints/Grants/GetBudgetsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/GetBudgetsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/GetContractEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/GetContractEndpoint.cs index 669fd02..46ea9b1 100644 --- a/PostFundManagement.Api/Endpoints/Grants/GetContractEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/GetContractEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/GetContractUrlEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/GetContractUrlEndpoint.cs index 093fd57..efa6aab 100644 --- a/PostFundManagement.Api/Endpoints/Grants/GetContractUrlEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/GetContractUrlEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/GetContractsEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/GetContractsEndpoint.cs index eace687..4595a7f 100644 --- a/PostFundManagement.Api/Endpoints/Grants/GetContractsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/GetContractsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/UpdateBudgetEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/UpdateBudgetEndpoint.cs index 0c171e4..5bea5a6 100644 --- a/PostFundManagement.Api/Endpoints/Grants/UpdateBudgetEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/UpdateBudgetEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Grants; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/UpdateContractEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/UpdateContractEndpoint.cs index c3a8a76..e2bc190 100644 --- a/PostFundManagement.Api/Endpoints/Grants/UpdateContractEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/UpdateContractEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Grants; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Grants/UploadContractEndpoint.cs b/PostFundManagement.Api/Endpoints/Grants/UploadContractEndpoint.cs index 7438d24..0d6ec67 100644 --- a/PostFundManagement.Api/Endpoints/Grants/UploadContractEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Grants/UploadContractEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Grants; diff --git a/PostFundManagement.Api/Endpoints/Projects/CreateActivityEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/CreateActivityEndpoint.cs index 9398d6a..30f7b2f 100644 --- a/PostFundManagement.Api/Endpoints/Projects/CreateActivityEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/CreateActivityEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/CreateBeneficiaryEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/CreateBeneficiaryEndpoint.cs index 0787805..51312b2 100644 --- a/PostFundManagement.Api/Endpoints/Projects/CreateBeneficiaryEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/CreateBeneficiaryEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/CreateChangeRequestEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/CreateChangeRequestEndpoint.cs index f78ca4c..1cf7e7f 100644 --- a/PostFundManagement.Api/Endpoints/Projects/CreateChangeRequestEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/CreateChangeRequestEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/CreateComplianceItemEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/CreateComplianceItemEndpoint.cs index 85397c2..921972d 100644 --- a/PostFundManagement.Api/Endpoints/Projects/CreateComplianceItemEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/CreateComplianceItemEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/CreateIssueEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/CreateIssueEndpoint.cs index 2eb631b..ffc1f99 100644 --- a/PostFundManagement.Api/Endpoints/Projects/CreateIssueEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/CreateIssueEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/CreateOutcomeEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/CreateOutcomeEndpoint.cs index e410127..ded7561 100644 --- a/PostFundManagement.Api/Endpoints/Projects/CreateOutcomeEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/CreateOutcomeEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/CreateProgrammeEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/CreateProgrammeEndpoint.cs index f9ab7db..af1119f 100644 --- a/PostFundManagement.Api/Endpoints/Projects/CreateProgrammeEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/CreateProgrammeEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/CreateProjectEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/CreateProjectEndpoint.cs index 9864a47..9c9d352 100644 --- a/PostFundManagement.Api/Endpoints/Projects/CreateProjectEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/CreateProjectEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/CreateSiteVisitEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/CreateSiteVisitEndpoint.cs index 5de8bde..0be71f6 100644 --- a/PostFundManagement.Api/Endpoints/Projects/CreateSiteVisitEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/CreateSiteVisitEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetActivitiesEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetActivitiesEndpoint.cs index 4568568..7fa0c10 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetActivitiesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetActivitiesEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetActivityEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetActivityEndpoint.cs index 507fafb..2cd9be9 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetActivityEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetActivityEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetBeneficiariesEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetBeneficiariesEndpoint.cs index 5a47e75..f8a86fc 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetBeneficiariesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetBeneficiariesEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetBeneficiaryEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetBeneficiaryEndpoint.cs index 64cfb49..1cae920 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetBeneficiaryEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetBeneficiaryEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestEndpoint.cs index 813ca12..071cbad 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestsEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestsEndpoint.cs index 2520126..1a192cc 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetComplianceItemEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetComplianceItemEndpoint.cs index 8668edb..b910f67 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetComplianceItemEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetComplianceItemEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetComplianceItemsEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetComplianceItemsEndpoint.cs index b69ccfb..08fef13 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetComplianceItemsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetComplianceItemsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetIssueEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetIssueEndpoint.cs index 0207627..b2882cd 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetIssueEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetIssueEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetIssuesEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetIssuesEndpoint.cs index d88f4ff..35db03a 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetIssuesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetIssuesEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetMilestoneEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetMilestoneEndpoint.cs index 81c7172..c4573bc 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetMilestoneEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetMilestoneEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetMilestonesEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetMilestonesEndpoint.cs index 4bea5ca..62efa73 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetMilestonesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetMilestonesEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetOutcomeEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetOutcomeEndpoint.cs index 644898e..44b84ce 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetOutcomeEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetOutcomeEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetOutcomesEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetOutcomesEndpoint.cs index 4aa007f..96e5c96 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetOutcomesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetOutcomesEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetProgrammeEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetProgrammeEndpoint.cs index 6d4448e..2084381 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetProgrammeEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetProgrammeEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetProgrammeProjectsEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetProgrammeProjectsEndpoint.cs index d15d26e..3cd77ca 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetProgrammeProjectsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetProgrammeProjectsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetProgrammesEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetProgrammesEndpoint.cs index c33782b..dab6d2a 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetProgrammesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetProgrammesEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetProjectEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetProjectEndpoint.cs index 209c1f6..17b8d4b 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetProjectEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetProjectEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetProjectIndicatorsEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetProjectIndicatorsEndpoint.cs index cb992a1..a36b877 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetProjectIndicatorsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetProjectIndicatorsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetProjectMilestonesEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetProjectMilestonesEndpoint.cs index b5221d9..26e5567 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetProjectMilestonesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetProjectMilestonesEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetProjectRisksEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetProjectRisksEndpoint.cs index 334a24e..2ebea23 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetProjectRisksEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetProjectRisksEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetProjectsEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetProjectsEndpoint.cs index 107a85c..fd3aff8 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetProjectsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetProjectsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitEndpoint.cs index a0c17f2..a9d224f 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitsEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitsEndpoint.cs index 4347e80..8259aac 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitsEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/UpdateBeneficiaryEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/UpdateBeneficiaryEndpoint.cs index 255b45b..580fd3e 100644 --- a/PostFundManagement.Api/Endpoints/Projects/UpdateBeneficiaryEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/UpdateBeneficiaryEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/UpdateChangeRequestEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/UpdateChangeRequestEndpoint.cs index 3368070..d9eecea 100644 --- a/PostFundManagement.Api/Endpoints/Projects/UpdateChangeRequestEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/UpdateChangeRequestEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/UpdateComplianceItemEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/UpdateComplianceItemEndpoint.cs index 34ed912..134af82 100644 --- a/PostFundManagement.Api/Endpoints/Projects/UpdateComplianceItemEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/UpdateComplianceItemEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/UpdateIssueEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/UpdateIssueEndpoint.cs index aeae4ac..2a2033f 100644 --- a/PostFundManagement.Api/Endpoints/Projects/UpdateIssueEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/UpdateIssueEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/UpdateMilestoneEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/UpdateMilestoneEndpoint.cs index 2cc6730..7ef1ebb 100644 --- a/PostFundManagement.Api/Endpoints/Projects/UpdateMilestoneEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/UpdateMilestoneEndpoint.cs @@ -3,7 +3,6 @@ using PostFundManagement.Application.Extensions; using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/UpdateOutcomeEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/UpdateOutcomeEndpoint.cs index 4caf386..de8a0dd 100644 --- a/PostFundManagement.Api/Endpoints/Projects/UpdateOutcomeEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/UpdateOutcomeEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/UpdateProgrammeEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/UpdateProgrammeEndpoint.cs index 6ae5cda..f1497dc 100644 --- a/PostFundManagement.Api/Endpoints/Projects/UpdateProgrammeEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/UpdateProgrammeEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/UpdateProjectEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/UpdateProjectEndpoint.cs index 29f2fdd..0c9d6aa 100644 --- a/PostFundManagement.Api/Endpoints/Projects/UpdateProjectEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/UpdateProjectEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/UpdateProjectStatusEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/UpdateProjectStatusEndpoint.cs index 773ae29..dc08e86 100644 --- a/PostFundManagement.Api/Endpoints/Projects/UpdateProjectStatusEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/UpdateProjectStatusEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Projects/UpdateSiteVisitEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/UpdateSiteVisitEndpoint.cs index 917a206..3513f13 100644 --- a/PostFundManagement.Api/Endpoints/Projects/UpdateSiteVisitEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/UpdateSiteVisitEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Application.Services.Projects; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Projects; diff --git a/PostFundManagement.Api/Endpoints/Users/GetUserEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/GetUserEndpoint.cs index a40122e..a32ee3c 100644 --- a/PostFundManagement.Api/Endpoints/Users/GetUserEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Users/GetUserEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Users; diff --git a/PostFundManagement.Api/Endpoints/Users/GetUsersEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/GetUsersEndpoint.cs index 0ca58cc..a3b4915 100644 --- a/PostFundManagement.Api/Endpoints/Users/GetUsersEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Users/GetUsersEndpoint.cs @@ -5,7 +5,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Extensions; using PostFundManagement.Domain.Models; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Users; diff --git a/PostFundManagement.Api/Endpoints/Users/SyncUserEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/SyncUserEndpoint.cs index 4801955..6fee673 100644 --- a/PostFundManagement.Api/Endpoints/Users/SyncUserEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Users/SyncUserEndpoint.cs @@ -1,10 +1,8 @@ using PostFundManagement.Application.Abstractions.Services; using PostFundManagement.Application.Extensions; -using PostFundManagement.Application.Services.Communications.Events; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Users; diff --git a/PostFundManagement.Api/Endpoints/Users/UpdateUserStatusEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/UpdateUserStatusEndpoint.cs index a1cdddd..3c48131 100644 --- a/PostFundManagement.Api/Endpoints/Users/UpdateUserStatusEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Users/UpdateUserStatusEndpoint.cs @@ -4,7 +4,6 @@ using PostFundManagement.Domain; using PostFundManagement.Domain.Abstractions; using PostFundManagement.Domain.Errors; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security; using Problems = Microsoft.AspNetCore.Mvc.ProblemDetails; namespace PostFundManagement.Api.Endpoints.Users; diff --git a/PostFundManagement.Api/PostFundManagement.Api.csproj b/PostFundManagement.Api/PostFundManagement.Api.csproj index 69d27a8..b1f4f21 100644 --- a/PostFundManagement.Api/PostFundManagement.Api.csproj +++ b/PostFundManagement.Api/PostFundManagement.Api.csproj @@ -28,6 +28,7 @@ + @@ -89,6 +90,7 @@ + diff --git a/PostFundManagement.Api/Program.cs b/PostFundManagement.Api/Program.cs index c031e4e..6bbab29 100644 --- a/PostFundManagement.Api/Program.cs +++ b/PostFundManagement.Api/Program.cs @@ -1,4 +1,3 @@ -using Microsoft.FeatureManagement; using PostFundManagement.Application.Extensions; using PostFundManagement.Application.Filters; using PostFundManagement.Domain.Abstractions; @@ -41,6 +40,7 @@ builder.Services.AddEndpointAndServiceCaching(builder.Configuration); builder.Services.AddMediator(); builder.Services.AddSecurityApiSdk(builder.Configuration); builder.Services.AddApiSecurity(builder.Configuration); +builder.Services.AddSkorubaApiService(builder.Configuration); builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TelemetryPipelineBehavior<,>)); builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingPipelineBehavior<,>)); diff --git a/PostFundManagement.Api/appsettings.json b/PostFundManagement.Api/appsettings.json index b201569..58a2660 100644 --- a/PostFundManagement.Api/appsettings.json +++ b/PostFundManagement.Api/appsettings.json @@ -1,5 +1,5 @@ { - "EnableServiceCaching": true, + "EnableServiceCaching": true, "CorsOrigins": [ "https://console.ifri.khongisa.co.za", "https://localhost:7208" @@ -18,6 +18,10 @@ "Authority": "https://sts.security.khongisa.co.za", "Audience": "pfm-api-dev" }, + "MachineIdentitySettings": { + "Authority": "https://sts.security.khongisa.co.za", + "Scope": "skoruba_identity_admin_api" + }, "Logging": { "LogLevel": { "Default": "Warning", diff --git a/PostFundManagement.Application/Abstractions/S3ServiceBase.cs b/PostFundManagement.Application/Abstractions/Services/S3ServiceBase.cs similarity index 98% rename from PostFundManagement.Application/Abstractions/S3ServiceBase.cs rename to PostFundManagement.Application/Abstractions/Services/S3ServiceBase.cs index d700573..e47b964 100644 --- a/PostFundManagement.Application/Abstractions/S3ServiceBase.cs +++ b/PostFundManagement.Application/Abstractions/Services/S3ServiceBase.cs @@ -1,7 +1,7 @@ using PostFundManagement.Application.Services.Shared; using PostFundManagement.Domain.Errors; -namespace PostFundManagement.Application.Abstractions; +namespace PostFundManagement.Application.Abstractions.Services; public abstract class S3ServiceBase(IAmazonS3 amazonS3) { diff --git a/PostFundManagement.Application/Abstractions/ServiceCacheBase.cs b/PostFundManagement.Application/Abstractions/Services/ServiceCacheBase.cs similarity index 74% rename from PostFundManagement.Application/Abstractions/ServiceCacheBase.cs rename to PostFundManagement.Application/Abstractions/Services/ServiceCacheBase.cs index 7130cf4..41dbb11 100644 --- a/PostFundManagement.Application/Abstractions/ServiceCacheBase.cs +++ b/PostFundManagement.Application/Abstractions/Services/ServiceCacheBase.cs @@ -1,4 +1,4 @@ -namespace PostFundManagement.Application.Abstractions; +namespace PostFundManagement.Application.Abstractions.Services; public abstract class ServiceCacheBase { diff --git a/PostFundManagement.Application/Extensions/Api.cs b/PostFundManagement.Application/Extensions/Api.cs index 4617f93..552d8ad 100644 --- a/PostFundManagement.Application/Extensions/Api.cs +++ b/PostFundManagement.Application/Extensions/Api.cs @@ -1,6 +1,7 @@ using PostFundManagement.Domain.Abstractions; -using PostFundManagement.Domain.Security; -using PostFundManagement.Domain.Security.Configuration; +using PostFundManagement.Domain.Attributes; +using PostFundManagement.Domain.Configuration.Security; +using PostFundManagement.Infrastructure.Security; namespace PostFundManagement.Application.Extensions; diff --git a/PostFundManagement.Application/Extensions/Security.cs b/PostFundManagement.Application/Extensions/Security.cs index 43dec7e..5e6545a 100644 --- a/PostFundManagement.Application/Extensions/Security.cs +++ b/PostFundManagement.Application/Extensions/Security.cs @@ -1,13 +1,53 @@ +using PostFundManagement.Application.Interceptors; using PostFundManagement.Application.Services.Shared; -using PostFundManagement.Domain.Security.Configuration; +using PostFundManagement.Domain.Abstractions; +using PostFundManagement.Domain.Configuration.Security; using PostFundManagement.Domain.Extensions; -using PostFundManagement.Domain.Security.Sdk; using PostFundManagement.Infrastructure.Database; +using PostFundManagement.Infrastructure.Security; +using static PostFundManagement.Domain.Extensions.Constants; namespace PostFundManagement.Application.Extensions; public static class Security { + public static IServiceCollection AddSkorubaApiService(this IServiceCollection services, IConfiguration configuration) + { + var configSection = configuration.GetSection(nameof(MachineIdentitySettings)); + + var authOptions = new MachineIdentitySettings(); + configSection.Bind(authOptions); + + services.Configure(configSection); + + if (string.IsNullOrWhiteSpace(authOptions.Authority)) + return services; + + if (!authOptions.Authority.EndsWith('/')) authOptions.Authority += "/"; + + services.AddClientCredentialsTokenManagement() + .AddClient(SkorubaCredentialClient, client => + { + client.TokenEndpoint = new Uri($"{authOptions.Authority}connect/token"); + client.ClientId = ClientId.Parse(authOptions.ClientId!); + client.ClientSecret = ClientSecret.Parse(authOptions.ClientSecret!); + client.Scope = Duende.AccessTokenManagement.Scope.ParseOrDefault(authOptions.Scope); + }); + + services.AddHttpClient(SkorubaHttpClient, client => + { + client.BaseAddress = new Uri(configuration.GetConnectionString("SkorubaApi")!); + }).AddClientCredentialsTokenHandler(ClientCredentialsClientName.Parse(SkorubaCredentialClient)); + + services.AddScoped(); + services.AddScoped(); + services.AddSingleton(); + + services.AddLoggedAuditedServiceScoped(); + + return services; + } + public static IServiceCollection AddSecurityApiSdk(this IServiceCollection services, IConfiguration configuration) { var configSection = configuration.GetSection(nameof(SecurityClientSettings)); diff --git a/PostFundManagement.Application/Extensions/ServiceExtensionTools.cs b/PostFundManagement.Application/Extensions/ServiceExtensionTools.cs new file mode 100644 index 0000000..e6079f8 --- /dev/null +++ b/PostFundManagement.Application/Extensions/ServiceExtensionTools.cs @@ -0,0 +1,78 @@ +using PostFundManagement.Application.Interceptors; + +namespace PostFundManagement.Application.Extensions; + +public static class ServiceExtensionTools +{ + public static IServiceCollection AddLoggedCachedServiceScoped(this IServiceCollection services) + where TInterface : class + where TImplementation : class, TInterface + where TCacheDecorator : class, TInterface + { + services.AddScoped(); + services.AddScoped(); + + services.AddScoped(provider => + { + var proxyGenerator = provider.GetRequiredService(); + var loggingInterceptor = provider.GetRequiredService(); + + var actual = provider.GetRequiredService(); + + var cached = ActivatorUtilities.CreateInstance(provider, actual); + + return proxyGenerator.CreateInterfaceProxyWithTarget(cached, + loggingInterceptor.ToInterceptor()); + }); + + return services; + } + + public static IServiceCollection AddLoggedAuditedCachedServiceScoped(this IServiceCollection services) + where TInterface : class + where TImplementation : class, TInterface + where TCacheDecorator : class, TInterface + { + services.AddScoped(); + services.AddScoped(); + + services.AddScoped(provider => + { + var proxyGenerator = provider.GetRequiredService(); + var auditInterceptor = provider.GetRequiredService(); + var loggingInterceptor = provider.GetRequiredService(); + + var actual = provider.GetRequiredService(); + + var cached = ActivatorUtilities.CreateInstance(provider, actual); + + return proxyGenerator.CreateInterfaceProxyWithTarget(cached, + loggingInterceptor.ToInterceptor(), + auditInterceptor.ToInterceptor()); + }); + + return services; + } + + public static IServiceCollection AddLoggedAuditedServiceScoped(this IServiceCollection services) + where TInterface : class + where TImplementation : class, TInterface + { + services.AddScoped(); + + services.AddScoped(provider => + { + var proxyGenerator = provider.GetRequiredService(); + var auditInterceptor = provider.GetRequiredService(); + var loggingInterceptor = provider.GetRequiredService(); + + var actual = provider.GetRequiredService(); + + return proxyGenerator.CreateInterfaceProxyWithTarget(actual, + loggingInterceptor.ToInterceptor(), + auditInterceptor.ToInterceptor()); + }); + + return services; + } +} diff --git a/PostFundManagement.Application/Extensions/Services.cs b/PostFundManagement.Application/Extensions/Services.cs index 300f634..b1e5a05 100644 --- a/PostFundManagement.Application/Extensions/Services.cs +++ b/PostFundManagement.Application/Extensions/Services.cs @@ -15,56 +15,6 @@ namespace PostFundManagement.Application.Extensions; public static class Services { - public static IServiceCollection AddLoggedCachedServiceScoped(this IServiceCollection services) - where TInterface : class - where TImplementation : class, TInterface - where TCacheDecorator : class, TInterface - { - services.AddScoped(); - services.AddScoped(); - - services.AddScoped(sp => - { - var proxyGenerator = sp.GetRequiredService(); - var loggingInterceptor = sp.GetRequiredService(); - - var actual = sp.GetRequiredService(); - - var cached = ActivatorUtilities.CreateInstance(sp, actual); - - return proxyGenerator.CreateInterfaceProxyWithTarget(cached, - loggingInterceptor.ToInterceptor()); - }); - - return services; - } - - public static IServiceCollection AddLoggedAuditedCachedServiceScoped(this IServiceCollection services) - where TInterface : class - where TImplementation : class, TInterface - where TCacheDecorator : class, TInterface - { - services.AddScoped(); - services.AddScoped(); - - services.AddScoped(sp => - { - var proxyGenerator = sp.GetRequiredService(); - var auditInterceptor = sp.GetRequiredService(); - var loggingInterceptor = sp.GetRequiredService(); - - var actual = sp.GetRequiredService(); - - var cached = ActivatorUtilities.CreateInstance(sp, actual); - - return proxyGenerator.CreateInterfaceProxyWithTarget(cached, - loggingInterceptor.ToInterceptor(), - auditInterceptor.ToInterceptor()); - }); - - return services; - } - public static IServiceCollection AddRegisterServicesWithCaching(this IServiceCollection services, IConfiguration configuration) { services.AddScoped(); diff --git a/PostFundManagement.Application/PostFundManagement.Application.csproj b/PostFundManagement.Application/PostFundManagement.Application.csproj index cb7e900..44bdc83 100644 --- a/PostFundManagement.Application/PostFundManagement.Application.csproj +++ b/PostFundManagement.Application/PostFundManagement.Application.csproj @@ -25,6 +25,8 @@ + + @@ -37,6 +39,8 @@ + + diff --git a/PostFundManagement.Application/Services/Communications/CommunicationsCacheService.cs b/PostFundManagement.Application/Services/Communications/CommunicationsCacheService.cs index 613677d..ced8a19 100644 --- a/PostFundManagement.Application/Services/Communications/CommunicationsCacheService.cs +++ b/PostFundManagement.Application/Services/Communications/CommunicationsCacheService.cs @@ -1,5 +1,4 @@ -using PostFundManagement.Application.Abstractions; -using PostFundManagement.Application.Abstractions.Services; +using PostFundManagement.Application.Abstractions.Services; using PostFundManagement.Application.Extensions; using PostFundManagement.Application.Services.Shared; using PostFundManagement.Domain; diff --git a/PostFundManagement.Application/Services/Evidence/EvidenceCacheService.cs b/PostFundManagement.Application/Services/Evidence/EvidenceCacheService.cs index be3787b..91f386d 100644 --- a/PostFundManagement.Application/Services/Evidence/EvidenceCacheService.cs +++ b/PostFundManagement.Application/Services/Evidence/EvidenceCacheService.cs @@ -1,5 +1,4 @@ -using PostFundManagement.Application.Abstractions; -using PostFundManagement.Application.Abstractions.Services; +using PostFundManagement.Application.Abstractions.Services; using PostFundManagement.Application.Extensions; using PostFundManagement.Application.Services.Shared; using PostFundManagement.Domain; diff --git a/PostFundManagement.Application/Services/Execution/ExecutionCacheService.cs b/PostFundManagement.Application/Services/Execution/ExecutionCacheService.cs index 8f488ce..032afef 100644 --- a/PostFundManagement.Application/Services/Execution/ExecutionCacheService.cs +++ b/PostFundManagement.Application/Services/Execution/ExecutionCacheService.cs @@ -1,5 +1,4 @@ -using PostFundManagement.Application.Abstractions; -using PostFundManagement.Application.Abstractions.Services; +using PostFundManagement.Application.Abstractions.Services; using PostFundManagement.Application.Extensions; using PostFundManagement.Application.Services.Shared; using PostFundManagement.Domain; diff --git a/PostFundManagement.Application/Services/Governance/GovernanceCacheService.cs b/PostFundManagement.Application/Services/Governance/GovernanceCacheService.cs index f23dcda..030fcc7 100644 --- a/PostFundManagement.Application/Services/Governance/GovernanceCacheService.cs +++ b/PostFundManagement.Application/Services/Governance/GovernanceCacheService.cs @@ -1,5 +1,4 @@ -using PostFundManagement.Application.Abstractions; -using PostFundManagement.Application.Abstractions.Services; +using PostFundManagement.Application.Abstractions.Services; using PostFundManagement.Application.Extensions; using PostFundManagement.Application.Services.Shared; using PostFundManagement.Domain; diff --git a/PostFundManagement.Application/Services/Grants/GrantsCacheService.cs b/PostFundManagement.Application/Services/Grants/GrantsCacheService.cs index cbc56f4..e8c3bb1 100644 --- a/PostFundManagement.Application/Services/Grants/GrantsCacheService.cs +++ b/PostFundManagement.Application/Services/Grants/GrantsCacheService.cs @@ -1,5 +1,4 @@ -using PostFundManagement.Application.Abstractions; -using PostFundManagement.Application.Abstractions.Services; +using PostFundManagement.Application.Abstractions.Services; using PostFundManagement.Application.Extensions; using PostFundManagement.Application.Services.Shared; using PostFundManagement.Domain; diff --git a/PostFundManagement.Application/Services/Projects/ProjectCacheService.cs b/PostFundManagement.Application/Services/Projects/ProjectCacheService.cs index 9e0e3ed..392f91b 100644 --- a/PostFundManagement.Application/Services/Projects/ProjectCacheService.cs +++ b/PostFundManagement.Application/Services/Projects/ProjectCacheService.cs @@ -1,5 +1,4 @@ -using PostFundManagement.Application.Abstractions; -using PostFundManagement.Application.Abstractions.Services; +using PostFundManagement.Application.Abstractions.Services; using PostFundManagement.Application.Extensions; using PostFundManagement.Application.Services.Shared; using PostFundManagement.Domain; diff --git a/PostFundManagement.Application/Services/Shared/GeneralS3Service.cs b/PostFundManagement.Application/Services/Shared/GeneralS3Service.cs index db9a23f..7aede7c 100644 --- a/PostFundManagement.Application/Services/Shared/GeneralS3Service.cs +++ b/PostFundManagement.Application/Services/Shared/GeneralS3Service.cs @@ -1,4 +1,4 @@ -using PostFundManagement.Application.Abstractions; +using PostFundManagement.Application.Abstractions.Services; using PostFundManagement.Domain.Abstractions; using static PostFundManagement.Domain.Extensions.Constants; diff --git a/PostFundManagement.Application/Services/Shared/IdentityCacheService.cs b/PostFundManagement.Application/Services/Shared/IdentityCacheService.cs index 5a92865..8af5dfd 100644 --- a/PostFundManagement.Application/Services/Shared/IdentityCacheService.cs +++ b/PostFundManagement.Application/Services/Shared/IdentityCacheService.cs @@ -1,5 +1,4 @@ -using PostFundManagement.Application.Abstractions; -using PostFundManagement.Application.Abstractions.Services; +using PostFundManagement.Application.Abstractions.Services; namespace PostFundManagement.Application.Services.Shared; diff --git a/PostFundManagement.Application/Services/Shared/IdentityService.cs b/PostFundManagement.Application/Services/Shared/IdentityService.cs index 7c668ad..076a3b9 100644 --- a/PostFundManagement.Application/Services/Shared/IdentityService.cs +++ b/PostFundManagement.Application/Services/Shared/IdentityService.cs @@ -12,9 +12,10 @@ public sealed class IdentityService(IDbContextFactory cont { await using var context = await contextFactory.CreateDbContextAsync(cancellationToken); - // TODO: Ensure TenantUser status is checked - var userExistsAndActive = await context.Users - .AnyAsync(u => u.Id == userId && u.Status == ActivityStatus.Active, cancellationToken); + var userExistsAndActive = await context.TenantUsers + .Include(i => i.User) + .AnyAsync(u => u.UserId == userId && u.Status == ActivityStatus.Active && + u.User!.Status == ActivityStatus.Active, cancellationToken); return Result.OkIf(userExistsAndActive, NotFoundError.Create()); })); diff --git a/PostFundManagement.Application/Services/Shared/TokenService.cs b/PostFundManagement.Application/Services/Shared/TokenService.cs index aab6d3c..cbdb524 100644 --- a/PostFundManagement.Application/Services/Shared/TokenService.cs +++ b/PostFundManagement.Application/Services/Shared/TokenService.cs @@ -1,7 +1,7 @@ +using PostFundManagement.Domain.Configuration.Security; using PostFundManagement.Domain.Errors; -using PostFundManagement.Domain.Security.Configuration; -using PostFundManagement.Domain.Security.Models; -using PostFundManagement.Domain.Security.Sdk; +using PostFundManagement.Domain.Models.Security; +using PostFundManagement.Infrastructure.Security; namespace PostFundManagement.Application.Services.Shared; @@ -9,10 +9,10 @@ public sealed class TokenService(ISecurityConnectApi connectApi, IOptions> GenerateAsync(CancellationToken cancellationToken = default) => - await Result.Try((Func>>)(async () => + public async Task> GenerateAsync(CancellationToken cancellationToken = default) => + await Result.Try((Func>>)(async () => { - using var response = await connectApi.GetToken(new Domain.Security.Models.TokenRequest + using var response = await connectApi.GetToken(new Domain.Models.Security.TokenRequest { ClientId = clientSettings.ClientId, ClientSecret = clientSettings.ClientSecret, @@ -27,14 +27,14 @@ public sealed class TokenService(ISecurityConnectApi connectApi, IOptions(contentRaw); + var tokenResponse = JsonSerializer.Deserialize(contentRaw); return Result.FailIf(string.IsNullOrWhiteSpace(tokenResponse?.AccessToken), NotFoundError.Create("Authentication succeeded, but no access token was found in the response payload.")) .ToResult(tokenResponse!); } - return await Result.Try((Func>>)(async () => + return await Result.Try((Func>>)(async () => { var errorResult = JsonSerializer.Deserialize(contentRaw); diff --git a/PostFundManagement.Application/Services/Users/UserCacheService.cs b/PostFundManagement.Application/Services/Users/UserCacheService.cs index 4a703de..9c25c7b 100644 --- a/PostFundManagement.Application/Services/Users/UserCacheService.cs +++ b/PostFundManagement.Application/Services/Users/UserCacheService.cs @@ -1,5 +1,4 @@ -using PostFundManagement.Application.Abstractions; -using PostFundManagement.Application.Abstractions.Services; +using PostFundManagement.Application.Abstractions.Services; using PostFundManagement.Application.Extensions; using PostFundManagement.Application.Services.Shared; using PostFundManagement.Domain; diff --git a/PostFundManagement.Domain/Abstractions/ISkorubaUserService.cs b/PostFundManagement.Domain/Abstractions/ISkorubaUserService.cs new file mode 100644 index 0000000..b4aff97 --- /dev/null +++ b/PostFundManagement.Domain/Abstractions/ISkorubaUserService.cs @@ -0,0 +1,30 @@ +using PostFundManagement.Domain.Attributes; +using PostFundManagement.Domain.Models.Security; + +namespace PostFundManagement.Domain.Abstractions; + +public interface ISkorubaUserService +{ + [Log] + [Audit] + Task> CreateUserAsync(CreateUserRequest request, CancellationToken cancellationToken = default); + + [Log] + Task> GetUserAsync(string userId, CancellationToken cancellationToken = default); + + [Log] + [Audit] + Task UpdateUserAsync(UpdateUserRequest request, CancellationToken cancellationToken = default); + + [Log] + [Audit] + Task SetUserLockoutAsync(string userId, bool disabled, CancellationToken cancellationToken = default); + + [Log] + [Audit] + Task AddClaimAsync(string userId, string claimType, string claimValue, CancellationToken cancellationToken = default); + + [Log] + [Audit] + Task RemoveClaimAsync(string userId, int claimId, CancellationToken cancellationToken = default); +} diff --git a/PostFundManagement.Domain/Security/ApiVersionTargetAttribute.cs b/PostFundManagement.Domain/Attributes/ApiVersionTargetAttribute.cs similarity index 80% rename from PostFundManagement.Domain/Security/ApiVersionTargetAttribute.cs rename to PostFundManagement.Domain/Attributes/ApiVersionTargetAttribute.cs index 1fde059..66836b2 100644 --- a/PostFundManagement.Domain/Security/ApiVersionTargetAttribute.cs +++ b/PostFundManagement.Domain/Attributes/ApiVersionTargetAttribute.cs @@ -1,4 +1,4 @@ -namespace PostFundManagement.Domain.Security; +namespace PostFundManagement.Domain.Attributes; [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public sealed class ApiVersionTargetAttribute(int majorVersion) : Attribute diff --git a/PostFundManagement.Domain/Configuration/Security/MachineIdentitySettings.cs b/PostFundManagement.Domain/Configuration/Security/MachineIdentitySettings.cs new file mode 100644 index 0000000..a917b66 --- /dev/null +++ b/PostFundManagement.Domain/Configuration/Security/MachineIdentitySettings.cs @@ -0,0 +1,12 @@ +namespace PostFundManagement.Domain.Configuration.Security; + +public sealed class MachineIdentitySettings +{ + public string? Authority { get; set; } + + public string? Scope { get; set; } + + public string? ClientId { get; set; } + + public string? ClientSecret { get; set; } +} \ No newline at end of file diff --git a/PostFundManagement.Domain/Security/Configuration/SecurityClientSettings.cs b/PostFundManagement.Domain/Configuration/Security/SecurityClientSettings.cs similarity index 81% rename from PostFundManagement.Domain/Security/Configuration/SecurityClientSettings.cs rename to PostFundManagement.Domain/Configuration/Security/SecurityClientSettings.cs index 777389d..0a288eb 100644 --- a/PostFundManagement.Domain/Security/Configuration/SecurityClientSettings.cs +++ b/PostFundManagement.Domain/Configuration/Security/SecurityClientSettings.cs @@ -1,4 +1,4 @@ -namespace PostFundManagement.Domain.Security.Configuration; +namespace PostFundManagement.Domain.Configuration.Security; public sealed class SecurityClientSettings { diff --git a/PostFundManagement.Domain/Security/Configuration/SecuritySettings.cs b/PostFundManagement.Domain/Configuration/Security/SecuritySettings.cs similarity index 78% rename from PostFundManagement.Domain/Security/Configuration/SecuritySettings.cs rename to PostFundManagement.Domain/Configuration/Security/SecuritySettings.cs index 9ec93e7..dc140d5 100644 --- a/PostFundManagement.Domain/Security/Configuration/SecuritySettings.cs +++ b/PostFundManagement.Domain/Configuration/Security/SecuritySettings.cs @@ -1,4 +1,4 @@ -namespace PostFundManagement.Domain.Security.Configuration; +namespace PostFundManagement.Domain.Configuration.Security; public sealed class SecuritySettings { diff --git a/PostFundManagement.Domain/Extensions/Constants.cs b/PostFundManagement.Domain/Extensions/Constants.cs index 2dffa2f..1e54edc 100644 --- a/PostFundManagement.Domain/Extensions/Constants.cs +++ b/PostFundManagement.Domain/Extensions/Constants.cs @@ -4,38 +4,28 @@ public static class Constants { public const string ServiceCachingFeature = "EnableServiceCaching"; + public const string SkorubaCredentialClient = nameof(SkorubaCredentialClient); + public const string SkorubaHttpClient = nameof(SkorubaHttpClient); public const string MainScope = "ApiScope"; - public const string CorsPolicy = "AllowConfiguredOrigins"; - public const string CachePolicy = "DefaultCachePolicy"; public const string EmailtemKey = "UserEmail"; - public const string UserRoleItemKey = "UserRole"; - public const string UserIdItemKey = "UserId"; - public const string DefaultSchedulerName = "pfm-scheduler"; - public const string GeneralS3SettingsSection = "GeneralS3Settings"; - public const string EvidenceS3SettingsSection = "EvidenceS3Settings"; - public const string ContractS3SettingsSection = "ContractS3Settings"; - public const string GeneralBucketName = "pfm"; public const string DatabaseConfigName = "PfmDatabase"; + public const string DefaultSchedulerName = "pfm-scheduler"; public const string SchedulerDatabaseConfigName = "PfmSchedulerDatabase"; public const int LabelLength = 256; - public const int ShortLabelLength = 100; - public const int TextLength = 1024; - public const int MediumTextLength = 2048; - public const int LargeTextLength = 4096; } \ No newline at end of file diff --git a/PostFundManagement.Domain/Models/Security/Contracts.cs b/PostFundManagement.Domain/Models/Security/Contracts.cs new file mode 100644 index 0000000..e67f680 --- /dev/null +++ b/PostFundManagement.Domain/Models/Security/Contracts.cs @@ -0,0 +1,9 @@ +namespace PostFundManagement.Domain.Models.Security; + +public sealed record CreateUserRequest(string UserName, string Email, string Password, bool EmailConfirmed = true, string? PhoneNumber = null, bool PhoneNumberConfirmed = false); + +public sealed record UpdateUserRequest(string Id, string UserName, string Email, bool EmailConfirmed, string? PhoneNumber, bool PhoneNumberConfirmed, bool LockoutEnabled, DateTimeOffset? LockoutEnd, int AccessFailedCount, bool TwoFactorEnabled); + +public sealed record UserClaim(string ClaimType, string ClaimValue, int? ClaimId = null); + +public sealed record UserResponse(string Id, string UserName, string Email, bool IsLockedOut, bool LockoutEnabled); \ No newline at end of file diff --git a/PostFundManagement.Domain/Security/Models/TokenErrorResponse.cs b/PostFundManagement.Domain/Models/Security/TokenErrorResponse.cs similarity index 84% rename from PostFundManagement.Domain/Security/Models/TokenErrorResponse.cs rename to PostFundManagement.Domain/Models/Security/TokenErrorResponse.cs index 2ebf9c1..f7326cb 100644 --- a/PostFundManagement.Domain/Security/Models/TokenErrorResponse.cs +++ b/PostFundManagement.Domain/Models/Security/TokenErrorResponse.cs @@ -1,4 +1,4 @@ -namespace PostFundManagement.Domain.Security.Models; +namespace PostFundManagement.Domain.Models.Security; public sealed class TokenErrorResponse { diff --git a/PostFundManagement.Domain/Security/Models/TokenRequest.cs b/PostFundManagement.Domain/Models/Security/TokenRequest.cs similarity index 89% rename from PostFundManagement.Domain/Security/Models/TokenRequest.cs rename to PostFundManagement.Domain/Models/Security/TokenRequest.cs index 4043bc6..eef495e 100644 --- a/PostFundManagement.Domain/Security/Models/TokenRequest.cs +++ b/PostFundManagement.Domain/Models/Security/TokenRequest.cs @@ -1,4 +1,4 @@ -namespace PostFundManagement.Domain.Security.Models; +namespace PostFundManagement.Domain.Models.Security; public sealed class TokenRequest { diff --git a/PostFundManagement.Domain/Security/Models/TokenResponse.cs b/PostFundManagement.Domain/Models/Security/TokenResponse.cs similarity index 86% rename from PostFundManagement.Domain/Security/Models/TokenResponse.cs rename to PostFundManagement.Domain/Models/Security/TokenResponse.cs index 420d19f..391b5e2 100644 --- a/PostFundManagement.Domain/Security/Models/TokenResponse.cs +++ b/PostFundManagement.Domain/Models/Security/TokenResponse.cs @@ -1,4 +1,4 @@ -namespace PostFundManagement.Domain.Security.Models; +namespace PostFundManagement.Domain.Models.Security; public sealed class TokenResponse { diff --git a/PostFundManagement.Domain/Security/Configuration/MachineIdentity.cs b/PostFundManagement.Domain/Security/Configuration/MachineIdentity.cs deleted file mode 100644 index c740234..0000000 --- a/PostFundManagement.Domain/Security/Configuration/MachineIdentity.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace PostFundManagement.Domain.Security.Configuration; - -public sealed class MachineIdentity -{ - public string? Authority { get; set; } - - public string? Audience { get; set; } - - public string? ClientId { get; set; } - - public string? ClientSecret { get; set; } -} \ No newline at end of file diff --git a/PostFundManagement.Domain/Security/Sdk/ISecurityConnectApi.cs b/PostFundManagement.Domain/Security/Sdk/ISecurityConnectApi.cs deleted file mode 100644 index 080cb4a..0000000 --- a/PostFundManagement.Domain/Security/Sdk/ISecurityConnectApi.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace PostFundManagement.Domain.Security.Sdk; - -public interface ISecurityConnectApi -{ - [Post("/connect/token")] - ValueTask GetToken([Body(BodySerializationMethod.UrlEncoded)] Models.TokenRequest request, CancellationToken cancellationToken = default); -} \ No newline at end of file diff --git a/PostFundManagement.Infrastructure/PostFundManagement.Infrastructure.csproj b/PostFundManagement.Infrastructure/PostFundManagement.Infrastructure.csproj index ebbf430..4d741b3 100644 --- a/PostFundManagement.Infrastructure/PostFundManagement.Infrastructure.csproj +++ b/PostFundManagement.Infrastructure/PostFundManagement.Infrastructure.csproj @@ -12,6 +12,7 @@ + @@ -26,6 +27,8 @@ + + @@ -37,7 +40,10 @@ + + + diff --git a/PostFundManagement.Infrastructure/Security/ISecurityConnectApi.cs b/PostFundManagement.Infrastructure/Security/ISecurityConnectApi.cs new file mode 100644 index 0000000..7426bf7 --- /dev/null +++ b/PostFundManagement.Infrastructure/Security/ISecurityConnectApi.cs @@ -0,0 +1,9 @@ +using PostFundManagement.Domain.Models.Security; + +namespace PostFundManagement.Infrastructure.Security; + +public interface ISecurityConnectApi +{ + [Post("/connect/token")] + ValueTask GetToken([Body(BodySerializationMethod.UrlEncoded)] TokenRequest request, CancellationToken cancellationToken = default); +} \ No newline at end of file diff --git a/PostFundManagement.Domain/Security/OpenApiBearerSecuritySchemeTransformer.cs b/PostFundManagement.Infrastructure/Security/OpenApiBearerSecuritySchemeTransformer.cs similarity index 90% rename from PostFundManagement.Domain/Security/OpenApiBearerSecuritySchemeTransformer.cs rename to PostFundManagement.Infrastructure/Security/OpenApiBearerSecuritySchemeTransformer.cs index 0c9a853..20c7480 100644 --- a/PostFundManagement.Domain/Security/OpenApiBearerSecuritySchemeTransformer.cs +++ b/PostFundManagement.Infrastructure/Security/OpenApiBearerSecuritySchemeTransformer.cs @@ -1,4 +1,4 @@ -namespace PostFundManagement.Domain.Security; +namespace PostFundManagement.Infrastructure.Security; public sealed class OpenApiBearerSecuritySchemeTransformer : IOpenApiDocumentTransformer { diff --git a/PostFundManagement.Infrastructure/Security/SkorubaUserService.cs b/PostFundManagement.Infrastructure/Security/SkorubaUserService.cs new file mode 100644 index 0000000..62d393d --- /dev/null +++ b/PostFundManagement.Infrastructure/Security/SkorubaUserService.cs @@ -0,0 +1,82 @@ +using PostFundManagement.Domain.Abstractions; +using PostFundManagement.Domain.Errors; +using PostFundManagement.Domain.Models.Security; +using static PostFundManagement.Domain.Extensions.Constants; + +namespace PostFundManagement.Infrastructure.Security; + +public class SkorubaUserService([FromKeyedServices(SkorubaHttpClient)] IHttpClientFactory httpClientFactory) : ISkorubaUserService +{ + public async Task> CreateUserAsync(CreateUserRequest request, CancellationToken cancellationToken = default) => + await Result.Try((Func>>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + var response = await httpClient.PostAsJsonAsync("api/users", request, cancellationToken); + + response.EnsureSuccessStatusCode(); + + var created = await response.Content.ReadFromJsonAsync(cancellationToken: cancellationToken); + + return Result.FailIf(created is null, CreateError.Create("User ID missing from creation response.")) + .ToResult(created?.Id!); + })); + + public async Task> GetUserAsync(string userId, CancellationToken cancellationToken = default) => + await Result.Try((Func>>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + var result = await httpClient.GetFromJsonAsync($"api/users/{userId}", cancellationToken); + + return Result.FailIf(result is null, NotFoundError.Create($"User {userId} not found.")) + .ToResult(result!); + })); + + public async Task UpdateUserAsync(UpdateUserRequest request, CancellationToken cancellationToken = default) => + await Result.Try((Func>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + var response = await httpClient.PutAsJsonAsync("api/users", request, cancellationToken); + + return Result.OkIf(response.IsSuccessStatusCode, UpdateError.Create("Failed to update user.")); + })); + + public async Task SetUserLockoutAsync(string userId, bool disabled, CancellationToken cancellationToken = default) => + await Result.Try((Func>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + var user = await httpClient.GetFromJsonAsync($"api/users/{userId}", cancellationToken); + + if(user is null) + return Result.Fail(NotFoundError.Create($"User {userId} not found.")); + + var updated = user with + { + LockoutEnabled = true, + LockoutEnd = disabled ? DateTimeOffset.UtcNow.AddYears(100) : null + }; + + var response = await httpClient.PutAsJsonAsync("api/users", updated, cancellationToken); + + return Result.OkIf(response.IsSuccessStatusCode, UpdateError.Create("Failed to update user lockout status.")); + })); + + public async Task AddClaimAsync(string userId, string claimType, string claimValue, CancellationToken cancellationToken = default) => + await Result.Try((Func>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + var payload = new { UserId = userId, ClaimType = claimType, ClaimValue = claimValue }; + + var response = await httpClient.PostAsJsonAsync($"api/users/{userId}/claims", payload, cancellationToken); + + return Result.OkIf(response.IsSuccessStatusCode, CreateError.Create("Failed to add user claim.")); + })); + + public async Task RemoveClaimAsync(string userId, int claimId, CancellationToken cancellationToken = default) => + await Result.Try((Func>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + var response = await httpClient.DeleteAsync($"api/users/{userId}/claims/{claimId}", cancellationToken); + + return Result.OkIf(response.IsSuccessStatusCode, CreateError.Create("Failed to remove user claim.")); + })); +} \ No newline at end of file From 84a171d4a462594827dca2efacb680c5a26d4130 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sun, 4 Oct 2026 15:17:22 +0200 Subject: [PATCH 2/3] Added stubs for user management endpoints --- .../Endpoints/Users/AddUserClaimEndpoint.cs | 5 ++ .../Endpoints/Users/AddUserRoleEndpoint.cs | 5 ++ .../Endpoints/Users/CreateUserEndpoint.cs | 5 ++ .../Users/DeleteUserClaimEndpoint.cs | 6 ++ .../Endpoints/Users/DeleteUserRoleEndpoint.cs | 5 ++ .../Endpoints/Users/GetSystemRolesEndpoint.cs | 5 ++ .../Endpoints/Users/GetUserClaimsEndpoint.cs | 6 ++ .../Endpoints/Users/GetUserRolesEndpoint.cs | 5 ++ .../Endpoints/Users/LogUserOutEndpoint.cs | 5 ++ .../Endpoints/Users/SetUserLockoutEndpoint.cs | 5 ++ .../Abstractions/ISkorubaUserService.cs | 25 +++++- .../Models/Security/Contracts.cs | 10 ++- .../Security/SkorubaUserService.cs | 85 +++++++++++++++++-- 13 files changed, 160 insertions(+), 12 deletions(-) create mode 100644 PostFundManagement.Api/Endpoints/Users/AddUserClaimEndpoint.cs create mode 100644 PostFundManagement.Api/Endpoints/Users/AddUserRoleEndpoint.cs create mode 100644 PostFundManagement.Api/Endpoints/Users/CreateUserEndpoint.cs create mode 100644 PostFundManagement.Api/Endpoints/Users/DeleteUserClaimEndpoint.cs create mode 100644 PostFundManagement.Api/Endpoints/Users/DeleteUserRoleEndpoint.cs create mode 100644 PostFundManagement.Api/Endpoints/Users/GetSystemRolesEndpoint.cs create mode 100644 PostFundManagement.Api/Endpoints/Users/GetUserClaimsEndpoint.cs create mode 100644 PostFundManagement.Api/Endpoints/Users/GetUserRolesEndpoint.cs create mode 100644 PostFundManagement.Api/Endpoints/Users/LogUserOutEndpoint.cs create mode 100644 PostFundManagement.Api/Endpoints/Users/SetUserLockoutEndpoint.cs diff --git a/PostFundManagement.Api/Endpoints/Users/AddUserClaimEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/AddUserClaimEndpoint.cs new file mode 100644 index 0000000..ace3d84 --- /dev/null +++ b/PostFundManagement.Api/Endpoints/Users/AddUserClaimEndpoint.cs @@ -0,0 +1,5 @@ +namespace PostFundManagement.Api.Endpoints.Users; + +public class AddUserClaimEndpoint +{ +} diff --git a/PostFundManagement.Api/Endpoints/Users/AddUserRoleEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/AddUserRoleEndpoint.cs new file mode 100644 index 0000000..489399e --- /dev/null +++ b/PostFundManagement.Api/Endpoints/Users/AddUserRoleEndpoint.cs @@ -0,0 +1,5 @@ +namespace PostFundManagement.Api.Endpoints.Users; + +public class AddUserRoleEndpoint +{ +} diff --git a/PostFundManagement.Api/Endpoints/Users/CreateUserEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/CreateUserEndpoint.cs new file mode 100644 index 0000000..fca9d81 --- /dev/null +++ b/PostFundManagement.Api/Endpoints/Users/CreateUserEndpoint.cs @@ -0,0 +1,5 @@ +namespace PostFundManagement.Api.Endpoints.Users; + +public class CreateUserEndpoint +{ +} diff --git a/PostFundManagement.Api/Endpoints/Users/DeleteUserClaimEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/DeleteUserClaimEndpoint.cs new file mode 100644 index 0000000..c96246d --- /dev/null +++ b/PostFundManagement.Api/Endpoints/Users/DeleteUserClaimEndpoint.cs @@ -0,0 +1,6 @@ +namespace PostFundManagement.Api.Endpoints.Users; + +public class DeleteUserClaimEndpoint +{ + +} diff --git a/PostFundManagement.Api/Endpoints/Users/DeleteUserRoleEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/DeleteUserRoleEndpoint.cs new file mode 100644 index 0000000..e756806 --- /dev/null +++ b/PostFundManagement.Api/Endpoints/Users/DeleteUserRoleEndpoint.cs @@ -0,0 +1,5 @@ +namespace PostFundManagement.Api.Endpoints.Users; + +public class DeleteUserRoleEndpoint +{ +} diff --git a/PostFundManagement.Api/Endpoints/Users/GetSystemRolesEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/GetSystemRolesEndpoint.cs new file mode 100644 index 0000000..fd50ffc --- /dev/null +++ b/PostFundManagement.Api/Endpoints/Users/GetSystemRolesEndpoint.cs @@ -0,0 +1,5 @@ +namespace PostFundManagement.Api.Endpoints.Users; + +public class GetSystemRolesEndpoint +{ +} diff --git a/PostFundManagement.Api/Endpoints/Users/GetUserClaimsEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/GetUserClaimsEndpoint.cs new file mode 100644 index 0000000..d425540 --- /dev/null +++ b/PostFundManagement.Api/Endpoints/Users/GetUserClaimsEndpoint.cs @@ -0,0 +1,6 @@ +namespace PostFundManagement.Api.Endpoints.Users; + +public class GetUserClaimsEndpoint +{ + +} diff --git a/PostFundManagement.Api/Endpoints/Users/GetUserRolesEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/GetUserRolesEndpoint.cs new file mode 100644 index 0000000..3eb3739 --- /dev/null +++ b/PostFundManagement.Api/Endpoints/Users/GetUserRolesEndpoint.cs @@ -0,0 +1,5 @@ +namespace PostFundManagement.Api.Endpoints.Users; + +public class GetUserRolesEndpoint +{ +} diff --git a/PostFundManagement.Api/Endpoints/Users/LogUserOutEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/LogUserOutEndpoint.cs new file mode 100644 index 0000000..d9f9905 --- /dev/null +++ b/PostFundManagement.Api/Endpoints/Users/LogUserOutEndpoint.cs @@ -0,0 +1,5 @@ +namespace PostFundManagement.Api.Endpoints.Users; + +public class LogUserOutEndpoint +{ +} diff --git a/PostFundManagement.Api/Endpoints/Users/SetUserLockoutEndpoint.cs b/PostFundManagement.Api/Endpoints/Users/SetUserLockoutEndpoint.cs new file mode 100644 index 0000000..b8173d0 --- /dev/null +++ b/PostFundManagement.Api/Endpoints/Users/SetUserLockoutEndpoint.cs @@ -0,0 +1,5 @@ +namespace PostFundManagement.Api.Endpoints.Users; + +public class SetUserLockoutEndpoint +{ +} diff --git a/PostFundManagement.Domain/Abstractions/ISkorubaUserService.cs b/PostFundManagement.Domain/Abstractions/ISkorubaUserService.cs index b4aff97..8cf3968 100644 --- a/PostFundManagement.Domain/Abstractions/ISkorubaUserService.cs +++ b/PostFundManagement.Domain/Abstractions/ISkorubaUserService.cs @@ -10,7 +10,7 @@ public interface ISkorubaUserService Task> CreateUserAsync(CreateUserRequest request, CancellationToken cancellationToken = default); [Log] - Task> GetUserAsync(string userId, CancellationToken cancellationToken = default); + Task> GetUserAsync(Guid userId, CancellationToken cancellationToken = default); [Log] [Audit] @@ -18,13 +18,30 @@ public interface ISkorubaUserService [Log] [Audit] - Task SetUserLockoutAsync(string userId, bool disabled, CancellationToken cancellationToken = default); + Task SetUserLockoutAsync(Guid userId, bool disabled, CancellationToken cancellationToken = default); [Log] [Audit] - Task AddClaimAsync(string userId, string claimType, string claimValue, CancellationToken cancellationToken = default); + Task AddClaimAsync(Guid userId, string claimType, string claimValue, CancellationToken cancellationToken = default); [Log] [Audit] - Task RemoveClaimAsync(string userId, int claimId, CancellationToken cancellationToken = default); + Task RemoveClaimAsync(Guid userId, int claimId, CancellationToken cancellationToken = default); + + [Log] + [Audit] + Task AddRoleAsync(Guid userId, string roleId, CancellationToken cancellationToken = default); + + [Log] + [Audit] + Task RemoveRoleAsync(Guid userId, string roleId, CancellationToken cancellationToken = default); + + [Log] + Task> GetAvailableRolesAsync(string? searchText = null, int page = 1, int pageSize = 50, CancellationToken cancellationToken = default); + + [Log] + Task> GetUserRolesAsync(string userId, int page = 1, int pageSize = 50, CancellationToken cancellationToken = default); + + [Log] + Task> GetUserClaimsAsync(string userId, int page = 1, int pageSize = 50, CancellationToken cancellationToken = default); } diff --git a/PostFundManagement.Domain/Models/Security/Contracts.cs b/PostFundManagement.Domain/Models/Security/Contracts.cs index e67f680..bfbf504 100644 --- a/PostFundManagement.Domain/Models/Security/Contracts.cs +++ b/PostFundManagement.Domain/Models/Security/Contracts.cs @@ -4,6 +4,12 @@ public sealed record CreateUserRequest(string UserName, string Email, string Pas public sealed record UpdateUserRequest(string Id, string UserName, string Email, bool EmailConfirmed, string? PhoneNumber, bool PhoneNumberConfirmed, bool LockoutEnabled, DateTimeOffset? LockoutEnd, int AccessFailedCount, bool TwoFactorEnabled); -public sealed record UserClaim(string ClaimType, string ClaimValue, int? ClaimId = null); +public sealed record Claim(string ClaimType, string ClaimValue, int? ClaimId = null); -public sealed record UserResponse(string Id, string UserName, string Email, bool IsLockedOut, bool LockoutEnabled); \ No newline at end of file +public record ClaimsResponse(int TotalCount, int PageSize, ICollection Claims); + +public sealed record UserResponse(string Id, string UserName, string Email, bool IsLockedOut, bool LockoutEnabled); + +public record Role(string Id, string Name); + +public record RolesResponse(int TotalCount, int PageSize, ICollection Roles); \ No newline at end of file diff --git a/PostFundManagement.Infrastructure/Security/SkorubaUserService.cs b/PostFundManagement.Infrastructure/Security/SkorubaUserService.cs index 62d393d..8389656 100644 --- a/PostFundManagement.Infrastructure/Security/SkorubaUserService.cs +++ b/PostFundManagement.Infrastructure/Security/SkorubaUserService.cs @@ -13,7 +13,8 @@ public class SkorubaUserService([FromKeyedServices(SkorubaHttpClient)] IHttpClie var httpClient = httpClientFactory.CreateClient(); var response = await httpClient.PostAsJsonAsync("api/users", request, cancellationToken); - response.EnsureSuccessStatusCode(); + if (!response.IsSuccessStatusCode) + return Result.Fail(CreateError.Create("Failed to create user.")); var created = await response.Content.ReadFromJsonAsync(cancellationToken: cancellationToken); @@ -21,7 +22,7 @@ public class SkorubaUserService([FromKeyedServices(SkorubaHttpClient)] IHttpClie .ToResult(created?.Id!); })); - public async Task> GetUserAsync(string userId, CancellationToken cancellationToken = default) => + public async Task> GetUserAsync(Guid userId, CancellationToken cancellationToken = default) => await Result.Try((Func>>)(async () => { var httpClient = httpClientFactory.CreateClient(); @@ -40,13 +41,13 @@ public class SkorubaUserService([FromKeyedServices(SkorubaHttpClient)] IHttpClie return Result.OkIf(response.IsSuccessStatusCode, UpdateError.Create("Failed to update user.")); })); - public async Task SetUserLockoutAsync(string userId, bool disabled, CancellationToken cancellationToken = default) => + public async Task SetUserLockoutAsync(Guid userId, bool disabled, CancellationToken cancellationToken = default) => await Result.Try((Func>)(async () => { var httpClient = httpClientFactory.CreateClient(); var user = await httpClient.GetFromJsonAsync($"api/users/{userId}", cancellationToken); - if(user is null) + if (user is null) return Result.Fail(NotFoundError.Create($"User {userId} not found.")); var updated = user with @@ -60,7 +61,7 @@ public class SkorubaUserService([FromKeyedServices(SkorubaHttpClient)] IHttpClie return Result.OkIf(response.IsSuccessStatusCode, UpdateError.Create("Failed to update user lockout status.")); })); - public async Task AddClaimAsync(string userId, string claimType, string claimValue, CancellationToken cancellationToken = default) => + public async Task AddClaimAsync(Guid userId, string claimType, string claimValue, CancellationToken cancellationToken = default) => await Result.Try((Func>)(async () => { var httpClient = httpClientFactory.CreateClient(); @@ -71,7 +72,7 @@ public class SkorubaUserService([FromKeyedServices(SkorubaHttpClient)] IHttpClie return Result.OkIf(response.IsSuccessStatusCode, CreateError.Create("Failed to add user claim.")); })); - public async Task RemoveClaimAsync(string userId, int claimId, CancellationToken cancellationToken = default) => + public async Task RemoveClaimAsync(Guid userId, int claimId, CancellationToken cancellationToken = default) => await Result.Try((Func>)(async () => { var httpClient = httpClientFactory.CreateClient(); @@ -79,4 +80,76 @@ public class SkorubaUserService([FromKeyedServices(SkorubaHttpClient)] IHttpClie return Result.OkIf(response.IsSuccessStatusCode, CreateError.Create("Failed to remove user claim.")); })); + + public async Task> GetUserClaimsAsync(string userId, int page = 1, int pageSize = 50, CancellationToken cancellationToken = default) => + await Result.Try((Func>>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + + var result = await httpClient.GetFromJsonAsync($"api/users/{userId}/claims?page={page}&pageSize={pageSize}", cancellationToken); + + return Result.FailIf(result is null, NotFoundError.Create($"Claims for user {userId} could not be retrieved.")) + .ToResult(result?.Claims.ToArray() ?? []); + })); + + public async Task AddRoleAsync(Guid userId, string roleId, CancellationToken cancellationToken = default) => + await Result.Try((Func>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + var payload = new { UserId = userId, RoleId = roleId }; + + var response = await httpClient.PostAsJsonAsync($"api/users/{userId}/roles", payload, cancellationToken); + + return Result.OkIf(response.IsSuccessStatusCode, CreateError.Create("Failed to add user role.")); + })); + + public async Task RemoveRoleAsync(Guid userId, string roleId, CancellationToken cancellationToken = default) => + await Result.Try((Func>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + var response = await httpClient.DeleteAsync($"api/users/{userId}/roles/{roleId}", cancellationToken); + + return Result.OkIf(response.IsSuccessStatusCode, CreateError.Create("Failed to remove user role.")); + })); + + public async Task> GetUserRolesAsync(string userId, int page = 1, int pageSize = 50, CancellationToken cancellationToken = default) => + await Result.Try((Func>>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + + var result = await httpClient.GetFromJsonAsync($"api/users/{userId}/roles?page={page}&pageSize={pageSize}", cancellationToken); + + return Result.FailIf(result is null, NotFoundError.Create($"Roles for user {userId} could not be retrieved.")) + .ToResult(result?.Roles?.ToArray() ?? []); + })); + + public async Task InvalidateUserSessionAsync(Guid userId, CancellationToken cancellationToken = default) => + await Result.Try((Func>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + var user = await httpClient.GetFromJsonAsync($"api/users/{userId}", cancellationToken); + + if (user is null) + return Result.Fail(NotFoundError.Create($"User {userId} not found.")); + + var response = await httpClient.PutAsJsonAsync("api/users", user, cancellationToken); + + return Result.OkIf(response.IsSuccessStatusCode, UpdateError.Create("Failed to invalidate user session.")); + })); + + public async Task> GetAvailableRolesAsync(string? searchText = null, int page = 1, int pageSize = 50, CancellationToken cancellationToken = default) => + await Result.Try((Func>>)(async () => + { + var httpClient = httpClientFactory.CreateClient(); + + var query = $"api/roles?page={page}&pageSize={pageSize}"; + + if (!string.IsNullOrWhiteSpace(searchText)) + query += $"&searchText={Uri.EscapeDataString(searchText)}"; + + var result = await httpClient.GetFromJsonAsync(query, cancellationToken); + + return Result.FailIf(result is null, NotFoundError.Create("Available roles could not be retrieved.")) + .ToResult(result?.Roles?.ToArray() ?? []); + })); } \ No newline at end of file From c9deba04274bff5d87ef0e8e41c948cc6eaaa9a8 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sun, 4 Oct 2026 18:04:36 +0200 Subject: [PATCH 3/3] Fixed linked user resolution --- .../src/pages/GovernancePage.tsx | 91 +++++++++++++++---- .../src/pages/TenantManagementPage.tsx | 39 ++++++-- .../src/services/api.ts | 3 +- PostFundManagement.ConsoleUI/src/types.ts | 1 + 4 files changed, 110 insertions(+), 24 deletions(-) diff --git a/PostFundManagement.ConsoleUI/src/pages/GovernancePage.tsx b/PostFundManagement.ConsoleUI/src/pages/GovernancePage.tsx index 23435d3..64ee8aa 100644 --- a/PostFundManagement.ConsoleUI/src/pages/GovernancePage.tsx +++ b/PostFundManagement.ConsoleUI/src/pages/GovernancePage.tsx @@ -67,6 +67,7 @@ import { Instrument, Instruction, Rule, + User, OrganisationType, ActivityStatus, ApprovalStatus, @@ -564,20 +565,70 @@ export const GovernancePage: React.FC = () => { setIsOrgModalOpen(true); }; - const openEditOrg = (org: Organisation) => { + const openEditOrg = async (org: Organisation) => { setEditingOrg(org); - const linkedUserId = org.userId || org.createdBy || usersDirectory[0]?.id || currentUserId; - const matchedUser = usersDirectory.find((u) => u.id === linkedUserId); - orgForm.reset({ - name: org.name || '', - registrationNo: org.registrationNo || '', - email: org.email || '', - idNumber: matchedUser?.idNumber || (org as any).idNumber || '', - organisationUser: linkedUserId, - type: org.type || OrganisationType.Enterprise, - status: org.status ?? ActivityStatus.Active, - }); setIsOrgModalOpen(true); + + // 1. Fetch fresh organisation details from API + let currentOrg = org; + try { + const fresh = await getOrganisation(org.id); + if (fresh) { + currentOrg = fresh; + } + } catch { + // fallback to passed org + } + + // 2. Resolve linked user ID from organisation model + const targetUserId = + currentOrg.userId || + (currentOrg as any).UserId || + (currentOrg as any).organisationUser || + (currentOrg as any).OrganisationUser || + currentOrg.createdBy || + ''; + + // 3. Find user in directory or fetch user record to get cached user profile and idNumber + let matchedUser = usersDirectory.find( + (u) => u.id && String(u.id).toLowerCase() === String(targetUserId).toLowerCase() + ); + + if (!matchedUser && targetUserId) { + try { + const fetchedUser = await getUser(targetUserId); + if (fetchedUser) { + matchedUser = fetchedUser; + } + } catch { + // user fetch failed + } + } + + // 4. Ensure matched user is present in usersDirectory cache for dropdown rendering + if (matchedUser && !usersDirectory.some((u) => u.id === matchedUser!.id)) { + queryClient.setQueryData(['users-directory'], (old = []) => [matchedUser!, ...old]); + } + + // 5. Resolve idNumber from matched user profile or organisation + const resolvedIdNumber = + matchedUser?.idNumber || + currentOrg.idNumber || + (currentOrg as any).IdNumber || + (org as any).idNumber || + ''; + + const selectedUserId = matchedUser?.id || targetUserId || usersDirectory[0]?.id || currentUserId; + + orgForm.reset({ + name: currentOrg.name || '', + registrationNo: currentOrg.registrationNo || '', + email: currentOrg.email || '', + idNumber: resolvedIdNumber, + organisationUser: selectedUserId, + type: currentOrg.type || OrganisationType.Enterprise, + status: currentOrg.status ?? ActivityStatus.Active, + }); }; const openCreatePortfolio = () => { @@ -1448,10 +1499,18 @@ export const GovernancePage: React.FC = () => {