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
ApiKey
The raw API key value (only populated on creation; otherwise empty).
string ApiKey { get; }
Property Value
CreatedAt
When the key was created. Reset when the key is recycled (refreshed).
DateTime? CreatedAt { get; }
Property Value
CreatedBy
User who created this key (identity/display name). Null if not recorded.
string CreatedBy { get; }
Property Value
DisabledAt
When this key was disabled, or null if it is enabled. A disabled key is refused at authentication.
DateTime? DisabledAt { get; }
Property Value
Remarks
A timestamp rather than a flag, because when and — with DisabledBy — who 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
ExpiryDate
Expiry date, or null if no expiry.
DateTime? ExpiryDate { get; }
Property Value
Key
Unique identifier for this API key entry.
string Key { get; }
Property Value
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
Name
Human-readable name for this API key.
string Name { get; }
Property Value
OwnerMemberKey
Owner of an owner-scoped ("private", shown as "Personal") key, or null for a shared key. On a team key this is the owning team member (Key); on a system key it is the owning user's key — the same value, since a member key is the user key. Private keys are hidden from others in the UI and can only be recycled/locked/disabled/deleted by their owner (a caller holding the Oversee system scope may still manage them, for audit).
string OwnerMemberKey { get; }
Property Value
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
TeamKey
Team that owns this API key. Null for system keys (not bound to a team).
string TeamKey { get; }