Skip to content

InMemoryTenantEgressPolicyStore

Namespace AgentPrism · Assembly AgentPrism.Core.dll

In-memory ITenantEgressPolicyStore implementation.

public sealed class InMemoryTenantEgressPolicyStore : ITenantEgressPolicyStore

objectInMemoryTenantEgressPolicyStore

ITenantEgressPolicyStore

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

InMemoryTenantEgressPolicyStore(TimeProvider?)

Section titled “ InMemoryTenantEgressPolicyStore(TimeProvider?)”

Creates a new in-memory store.

public InMemoryTenantEgressPolicyStore(TimeProvider? timeProvider = null)

timeProvider TimeProvider?

The time source. Defaults to TimeProvider.System when not given.

Deletes a tenant’s policy, making the tenant unrestricted again.

public ValueTask<bool> DeleteAsync(string tenantId, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

cancellationToken CancellationToken

The cancellation token.

ValueTask<bool>

true if a policy was found and deleted.

Reads a tenant’s policy.

public ValueTask<TenantEgressPolicy?> GetAsync(string tenantId, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

cancellationToken CancellationToken

The cancellation token.

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)

tenantId string

The tenant identifier.

allowedProviders IReadOnlyList<string>

The closed set of allowed provider names.

cancellationToken CancellationToken

The cancellation token.

ValueTask<TenantEgressPolicy>

The saved policy.