Table of Contents

Interface ILoginServerSigningKeyService

Namespace
FishMMO.Database.Npgsql.Services.Interfaces
Assembly
FishMMO-DB.dll

Service interface for managing per-LoginServer HMAC signing keys. The LoginServer inserts a fresh signing key on startup; WorldServers and SceneServers fetch the key by token-embedded key ID to validate auth tokens.

public interface ILoginServerSigningKeyService

Methods

DeleteAsync(long, CancellationToken)

Deletes the signing key for a specific LoginServer. Called during LoginServer shutdown or key rotation.

Task<DatabaseResult> DeleteAsync(long loginServerId, CancellationToken cancellationToken = default)

Parameters

loginServerId long
cancellationToken CancellationToken

Returns

Task<DatabaseResult>

FetchByIdAsync(long, CancellationToken)

Fetches a signing key by its token-embedded database ID.

Task<DatabaseResult<LoginServerSigningKeyData>> FetchByIdAsync(long signingKeyId, CancellationToken cancellationToken = default)

Parameters

signingKeyId long
cancellationToken CancellationToken

Returns

Task<DatabaseResult<LoginServerSigningKeyData>>

FetchByLoginServerIdAsync(long, CancellationToken)

Fetches the signing key for a specific LoginServer. Called by WorldServers and SceneServers during token validation.

Task<DatabaseResult<LoginServerSigningKeyData>> FetchByLoginServerIdAsync(long loginServerId, CancellationToken cancellationToken = default)

Parameters

loginServerId long
cancellationToken CancellationToken

Returns

Task<DatabaseResult<LoginServerSigningKeyData>>

UpsertAsync(long, byte[], CancellationToken)

Inserts a fresh HMAC signing key for a LoginServer and returns its database ID. Called by the LoginServer on startup.

Task<DatabaseResult<LoginServerSigningKeyData>> UpsertAsync(long loginServerId, byte[] hmacKey, CancellationToken cancellationToken = default)

Parameters

loginServerId long
hmacKey byte[]
cancellationToken CancellationToken

Returns

Task<DatabaseResult<LoginServerSigningKeyData>>