Table of Contents

Interface ISecretsProvider

Namespace
Builvero.Application.Interfaces.Services
Assembly
Builvero.Application.dll

Abstraction for retrieving secrets from various sources (AWS Secrets Manager, environment variables, files, etc.). Allows environment-specific implementations without direct cloud SDK dependencies.

public interface ISecretsProvider

Methods

GetRequiredSecretAsync(string, CancellationToken)

Retrieves a secret value by name, throwing an exception if not found.

Task<string> GetRequiredSecretAsync(string secretName, CancellationToken cancellationToken = default)

Parameters

secretName string

The name or identifier of the secret.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<string>

The secret value.

Exceptions

InvalidOperationException

Thrown when the secret is not found.

GetSecretAsync(string, CancellationToken)

Retrieves a secret value by name.

Task<string?> GetSecretAsync(string secretName, CancellationToken cancellationToken = default)

Parameters

secretName string

The name or identifier of the secret.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<string>

The secret value, or null if not found.