Table of Contents

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

policyId string

The policy identifier.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<bool>

true if the policy was deleted; false if not found.

GetAllPoliciesAsync(CancellationToken)

Retrieves all SoD policies.

Task<IReadOnlyList<SoDPolicy>> GetAllPoliciesAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancellation 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

policyId string

The policy identifier.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<SoDPolicy>

The policy, or null if not found.

GetService(Type)

Gets a sub-interface or service from this store.

object? GetService(Type serviceType)

Parameters

serviceType Type

The type of service to retrieve.

Returns

object

The service instance, or null if not supported.

SavePolicyAsync(SoDPolicy, CancellationToken)

Saves or updates a policy (upsert).

Task SavePolicyAsync(SoDPolicy policy, CancellationToken cancellationToken)

Parameters

policy SoDPolicy

The policy to persist.

cancellationToken CancellationToken

Cancellation token.

Returns

Task