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)
Fetches a secret value by its key.
Task<DatabaseResult<string>> FetchAsync(string key, CancellationToken cancellationToken = default)
Parameters
keystringThe logical key identifying the secret.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<DatabaseResult<string>>
A DatabaseResult<T> containing the secret value if found; otherwise a failure with ENTITY_NOT_FOUND.
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.