Table of Contents

Interface IApiKey

Namespace
Tharga.Team
Assembly
Tharga.Team.dll

Represents an API key with associated metadata.

public interface IApiKey

Properties

AccessLevel

Access level assigned to this API key. Null defaults to Administrator.

AccessLevel? AccessLevel { get; }

Property Value

AccessLevel?

ApiKey

The raw API key value (only populated on creation; otherwise empty).

string ApiKey { get; }

Property Value

string

CreatedAt

When the key was created. Reset when the key is recycled (refreshed).

DateTime? CreatedAt { get; }

Property Value

DateTime?

CreatedBy

User who created this key (identity/display name). Null if not recorded.

string CreatedBy { get; }

Property Value

string

DisabledAt

When this key was disabled, or null if it is enabled. A disabled key is refused at authentication.

DateTime? DisabledAt { get; }

Property Value

DateTime?

Remarks

A timestamp rather than a flag, because when and — with DisabledBywho are what an operator needs after a security action, and a bool answers neither.

Distinct from expiry and from locking. An expired key stopped working on a date nobody chose and is fixed by a new expiry; a disabled key was stopped by a person and is fixed by that person or another. A locked key is neither — locking only discards the stored secret so the raw value cannot be retrieved again, and a locked key still authenticates.

Refreshing does not clear this. A key disabled because it might have leaked stays disabled until someone explicitly enables it, or the remedy for a compromise silently undoes the containment.

DisabledBy

Who disabled this key, or null if it is enabled.

string DisabledBy { get; }

Property Value

string

ExpiryDate

Expiry date, or null if no expiry.

DateTime? ExpiryDate { get; }

Property Value

DateTime?

Key

Unique identifier for this API key entry.

string Key { get; }

Property Value

string

LastUsedAt

When the key was last used to authenticate, or null if never used. Reset when the key is recycled (refreshed).

DateTime? LastUsedAt { get; }

Property Value

DateTime?

Name

Human-readable name for this API key.

string Name { get; }

Property Value

string

OwnerMemberKey

Owning team member (Key) for an owner-scoped ("private") key, or null for a normal team-wide key. Private keys are hidden from other members in the UI and can only be recycled/locked/deleted by their owner (a Developer-role caller may still manage them for audit).

string OwnerMemberKey { get; }

Property Value

string

Roles

Roles assigned to this API key.

string[] Roles { get; }

Property Value

string[]

ScopeOverrides

Scope overrides for this API key.

string[] ScopeOverrides { get; }

Property Value

string[]

SystemScopes

Explicit scopes granted to a system key at creation time. Null/empty for team keys.

string[] SystemScopes { get; }

Property Value

string[]

Tags

System-set key-value tags on this API key. A list (not a map), so a key may repeat. Set only at creation via the service; immutable thereafter and not editable from the UI. Each tag is surfaced as a tag.{Key} claim on the authenticated principal.

IReadOnlyList<Tag> Tags { get; }

Property Value

IReadOnlyList<Tag>

TeamKey

Team that owns this API key. Null for system keys (not bound to a team).

string TeamKey { get; }

Property Value

string