Table of Contents

Interface IAtomicGrantRevocationStore

Namespace
Excalibur.A3.Authorization
Assembly
Excalibur.A3.Abstractions.dll

Optional atomic revocation and authoritative revision capability of an IGrantStore.

public interface IAtomicGrantRevocationStore

Remarks

Every grant writer, including activity-group writers, must advance the affected user's revision in the same commit as its mutation. Revisions never decrease or reset during a store's lifetime. Reads are linearizable; snapshots pair grants with their actual revision. Unsupported providers must not expose this capability. No per-row or chunked deletion fallback satisfies this contract.

Methods

ReadUserRevisionAsync(string, CancellationToken)

Reads the authoritative user revision.

Task<long> ReadUserRevisionAsync(string userId, CancellationToken cancellationToken)

Parameters

userId string

Exact subject identifier.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<long>

The authoritative user revision.

ReadUserSnapshotAsync(string, bool, CancellationToken)

Reads grants and their revision from one committed state.

Task<UserGrantSnapshot> ReadUserSnapshotAsync(string userId, bool includeExpired, CancellationToken cancellationToken)

Parameters

userId string

Exact subject identifier.

includeExpired bool

Whether to include expired grants.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<UserGrantSnapshot>

The coherent snapshot.

RevokeAllAsync(GrantRevocationRequest, CancellationToken)

Atomically removes all grant types in the explicit scope and commits the revision and retry ledger.

Task<GrantRevocationResult> RevokeAllAsync(GrantRevocationRequest request, CancellationToken cancellationToken)

Parameters

request GrantRevocationRequest

Stable, explicitly scoped operation.

cancellationToken CancellationToken

Cancellation before commit.

Returns

Task<GrantRevocationResult>

The committed result.

Remarks

The same subject and operation identifier with an identical payload returns its original outcome, preserving grants added after that commit. Conflicting payloads are rejected before mutation. Failure before commit leaves state unchanged; cancellation or transport failure after commit may have an unknown outcome. Retry with the same identifier to resolve that outcome.