Table of Contents

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

key string

The logical key identifying the secret.

cancellationToken CancellationToken

Cancellation 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

key string

The logical key identifying the secret.

value string

The secret value to store.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<DatabaseResult>

A DatabaseResult describing the outcome.