Class ApiKeyEntry
- Namespace
- Stratara.Identity.EntityFrameworkCore
- Assembly
- Stratara.Identity.EntityFrameworkCore.dll
EF Core row shape for the api_key table — one issued API key. Only the SHA-256 hash
of the raw key is stored (lowercase hex, unique lookup index); the plaintext is shown once
at issuance and unrecoverable afterwards.
[ExcludeFromCodeCoverage]
public class ApiKeyEntry
- Inheritance
-
ApiKeyEntry
- Inherited Members
- Extension Methods
Properties
CreatedAt
Issuance timestamp.
public DateTimeOffset CreatedAt { get; set; }
Property Value
ExpiresAt
Optional expiry; the key stops validating once passed.
public DateTimeOffset? ExpiresAt { get; set; }
Property Value
HashedKey
Lowercase-hex SHA-256 digest of the raw key (unique lookup index).
public string HashedKey { get; set; }
Property Value
Id
The key's stable identity (primary key; also the machine key's actor id).
public Guid Id { get; set; }
Property Value
Name
Display name for administration.
public string Name { get; set; }
Property Value
RevokedAt
Revocation timestamp; a revoked key never validates again.
public DateTimeOffset? RevokedAt { get; set; }
Property Value
Roles
Tenant-scoped roles for machine keys (JSON column); empty for personal access tokens.
public List<string> Roles { get; set; }
Property Value
TenantId
The tenant the key is bound to.
public Guid TenantId { get; set; }
Property Value
UserId
The bound user for personal access tokens; null for machine keys.
public Guid? UserId { get; set; }
Property Value
- Guid?