Skip to content

ApiKeyDraft

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

A draft for creating an API key.

public sealed record ApiKeyDraft : IEquatable<ApiKeyDraft>

objectApiKeyDraft

IEquatable<ApiKeyDraft>

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

The raw value, digest, and prefix are generated by IApiKeyStore.CreateAsync; the draft carries only the information given by the operator.

public ApiKeyDraft()

The expiration. Never expires if null.

public DateTimeOffset? ExpiresAt { get; init; }

DateTimeOffset?

The name for the operator to recognize the key by.

public required string Name { get; init; }

string

The scope set. Must not be empty.

public required IReadOnlyList<ApiKeyScope> Scopes { get; init; }

IReadOnlyList<ApiKeyScope>

The tenant the key is bound to.

public required string TenantId { get; init; }

string

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(ApiKeyDraft? other)

other ApiKeyDraft?

bool

public override int GetHashCode()

int

public override string ToString()

string

public static bool operator ==(ApiKeyDraft? left, ApiKeyDraft? right)

left ApiKeyDraft?

right ApiKeyDraft?

bool

public static bool operator !=(ApiKeyDraft? left, ApiKeyDraft? right)

left ApiKeyDraft?

right ApiKeyDraft?

bool