Interface IApiKeyStore

Assembly: redb.Tsak.Core.dll

Persistent store for API keys. Implementations: config-based, redb-backed, etc.

public interface IApiKeyStore

Methods

GetAllAsync(CancellationToken)

Get all key records (for admin listing).

Task<IReadOnlyList<ApiKeyRecord>> GetAllAsync(CancellationToken ct = default)

GetByHashAsync(string, CancellationToken)

Find a key record by its hash. Returns null if not found.

Task<ApiKeyRecord?> GetByHashAsync(string keyHash, CancellationToken ct = default)

RevokeAsync(string, CancellationToken)

Revoke a key by its Id.

Task<bool> RevokeAsync(string id, CancellationToken ct = default)

SaveAsync(ApiKeyRecord, CancellationToken)

Save (insert or update) a key record.

Task SaveAsync(ApiKeyRecord record, CancellationToken ct = default)