InMemoryTenantEgressPolicyStore
AgentPrism.Core.dllIn-memory ITenantEgressPolicyStore implementation.
public sealed class InMemoryTenantEgressPolicyStore : ITenantEgressPolicyStoreInheritance
Section titled “Inheritance”object ← InMemoryTenantEgressPolicyStore
Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Section titled “Constructors”InMemoryTenantEgressPolicyStore(TimeProvider?)
Section titled “ InMemoryTenantEgressPolicyStore(TimeProvider?)”Creates a new in-memory store.
public InMemoryTenantEgressPolicyStore(TimeProvider? timeProvider = null)Parameters
Section titled “Parameters”timeProvider TimeProvider?
The time source. Defaults to TimeProvider.System when not given.
Methods
Section titled “Methods”DeleteAsync(string, CancellationToken)
Section titled “ DeleteAsync(string, CancellationToken)”Deletes a tenant’s policy, making the tenant unrestricted again.
public ValueTask<bool> DeleteAsync(string tenantId, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”true if a policy was found and deleted.
GetAsync(string, CancellationToken)
Section titled “ GetAsync(string, CancellationToken)”Reads a tenant’s policy.
public ValueTask<TenantEgressPolicy?> GetAsync(string tenantId, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<TenantEgressPolicy?>
The policy; null if the tenant has none saved, which means the tenant is unrestricted.
UpsertAsync(string, IReadOnlyList<string>, CancellationToken)
Section titled “ UpsertAsync(string, IReadOnlyList<string>, CancellationToken)”Creates or replaces a tenant’s policy.
public ValueTask<TenantEgressPolicy> UpsertAsync(string tenantId, IReadOnlyList<string> allowedProviders, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
allowedProviders IReadOnlyList<string>
The closed set of allowed provider names.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The saved policy.