feat: Add Instance Details ViewModel and UI for managing instance credentials
- Introduced InstanceDetailsViewModel to handle loading and displaying instance-specific credentials. - Created InstanceDetailsWindow and associated XAML for displaying admin, database, and OAuth2 credentials. - Updated InstancesViewModel to include command for opening instance details. - Enhanced SettingsViewModel to manage Bitwarden and Xibo Bootstrap configurations, including connection testing. - Added UI components for Bitwarden Secrets Manager and Xibo Bootstrap OAuth2 settings in the SettingsView. - Implemented password visibility toggles and clipboard copy functionality for sensitive information.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
namespace OTSSignsOrchestrator.Core.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Abstraction for storing and retrieving secrets via Bitwarden Secrets Manager.
|
||||
/// </summary>
|
||||
public interface IBitwardenSecretService
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns true if Bitwarden is configured (access token + org ID are set).
|
||||
/// </summary>
|
||||
Task<bool> IsConfiguredAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new secret in the configured Bitwarden project.
|
||||
/// </summary>
|
||||
/// <returns>The ID of the created secret.</returns>
|
||||
Task<string> CreateSecretAsync(string key, string value, string note = "");
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a secret by its Bitwarden ID.
|
||||
/// </summary>
|
||||
Task<BitwardenSecret> GetSecretAsync(string secretId);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the value of an existing secret in place.
|
||||
/// </summary>
|
||||
Task UpdateSecretAsync(string secretId, string key, string value, string note = "");
|
||||
|
||||
/// <summary>
|
||||
/// Lists all secrets in the configured project.
|
||||
/// </summary>
|
||||
Task<List<BitwardenSecretSummary>> 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; }
|
||||
}
|
||||
Reference in New Issue
Block a user