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
secretNamestringThe name or identifier of the secret.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
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
secretNamestringThe name or identifier of the secret.
cancellationTokenCancellationTokenCancellation token to cancel the operation.