namespace OTSSignsOrchestrator.Core.Services; /// /// Abstraction for storing and retrieving secrets via Bitwarden Secrets Manager. /// public interface IBitwardenSecretService { /// /// Returns true if Bitwarden is configured (access token + org ID are set). /// Task IsConfiguredAsync(); /// /// Creates a new secret in the configured Bitwarden project. /// /// The ID of the created secret. Task CreateSecretAsync(string key, string value, string note = ""); /// /// Creates a new secret in the instance Bitwarden project (falls back to default project if not configured). /// Use this for instance-level secrets such as DB passwords and Newt credentials. /// /// The ID of the created secret. Task CreateInstanceSecretAsync(string key, string value, string note = ""); /// /// Retrieves a secret by its Bitwarden ID. /// Task GetSecretAsync(string secretId); /// /// Updates the value of an existing secret in place. /// Task UpdateSecretAsync(string secretId, string key, string value, string note = ""); /// /// Updates the value of an existing instance-level secret in place (uses instance project if configured). /// Task UpdateInstanceSecretAsync(string secretId, string key, string value, string note = ""); /// /// Lists all secrets in the configured project. /// Task> ListSecretsAsync(); } public class BitwardenSecret { public string Id { get; set; } = string.Empty; public string Key { get; set; } = string.Empty; public string Value { get; set; } = string.Empty; public string Note { get; set; } = string.Empty; public DateTime CreationDate { get; set; } } public class BitwardenSecretSummary { public string Id { get; set; } = string.Empty; public string Key { get; set; } = string.Empty; public DateTime CreationDate { get; set; } }