Interface IDeploymentSecretService
- Namespace
- FishMMO.Database.Npgsql.Services.Interfaces
- Assembly
- FishMMO-DB.dll
Service interface for managing deployment-global secrets. Servers load secrets from this table at startup instead of reading env files, eliminating the need to distribute secrets across machines.
public interface IDeploymentSecretService
Methods
FetchAsync(string, CancellationToken)
Task<DatabaseResult<string>> FetchAsync(string key, CancellationToken cancellationToken = default)
Parameters
keystringcancellationTokenCancellationToken
Returns
FetchInventoryAsync(CancellationToken)
Fetches a secret value by its key.
Task<DatabaseResult<IReadOnlyList<DeploymentSecretInfo>>> FetchInventoryAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<DatabaseResult<IReadOnlyList<DeploymentSecretInfo>>>
A DatabaseResult<T> containing the secret value if found; otherwise a failure with ENTITY_NOT_FOUND.
Remarks
The operator-facing read. FetchAsync(string, CancellationToken) returns the material itself and is for the servers that must decrypt with it; this returns only what an operator needs to answer "is it there, and how old is it". Keeping them as two methods means a caller has to ask for the value on purpose.
UpsertAsync(string, string, CancellationToken)
Inserts or updates a deployment secret.
On insert, a new row is created with the current timestamp.
On update, the value and updated_at are refreshed.
Task<DatabaseResult> UpsertAsync(string key, string value, CancellationToken cancellationToken = default)
Parameters
keystringThe logical key identifying the secret.
valuestringThe secret value to store.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<DatabaseResult>
A DatabaseResult describing the outcome.