Interface ISoDPolicyStore
- Namespace
- Excalibur.A3.Governance.SeparationOfDuties
- Assembly
- Excalibur.A3.Governance.Abstractions.dll
Provider-neutral store for Separation of Duties policy persistence.
public interface ISoDPolicyStore
Remarks
Follows the Microsoft ASP.NET Core Identity IRoleStore<TRole> pattern:
minimal CRUD surface (4 methods) with GetService(Type) for ISP extensions.
Methods
DeletePolicyAsync(string, CancellationToken)
Deletes a policy by its identifier.
Task<bool> DeletePolicyAsync(string policyId, CancellationToken cancellationToken)
Parameters
policyIdstringThe policy identifier.
cancellationTokenCancellationTokenCancellation token.
Returns
GetAllPoliciesAsync(CancellationToken)
Retrieves all SoD policies.
Task<IReadOnlyList<SoDPolicy>> GetAllPoliciesAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<IReadOnlyList<SoDPolicy>>
All stored policies.
GetPolicyAsync(string, CancellationToken)
Retrieves a policy by its identifier.
Task<SoDPolicy?> GetPolicyAsync(string policyId, CancellationToken cancellationToken)
Parameters
policyIdstringThe policy identifier.
cancellationTokenCancellationTokenCancellation token.
Returns
GetService(Type)
Gets a sub-interface or service from this store.
object? GetService(Type serviceType)
Parameters
serviceTypeTypeThe type of service to retrieve.
Returns
SavePolicyAsync(SoDPolicy, CancellationToken)
Saves or updates a policy (upsert).
Task SavePolicyAsync(SoDPolicy policy, CancellationToken cancellationToken)
Parameters
policySoDPolicyThe policy to persist.
cancellationTokenCancellationTokenCancellation token.