From 9f86e24438cc4071c9ce99fed76257d72777fd78 Mon Sep 17 00:00:00 2001 From: Sergio Matias Date: Tue, 2 Sep 2025 20:14:34 -0600 Subject: [PATCH] update key vault config --- Core.Blueprint.DAL.API/appsettings.Local.json | 6 +++--- .../Contracts/IKeyVaultService.cs | 15 +++++++++++---- .../Services/KeyVaultService.cs | 15 ++++++++++----- .../Core.Blueprint.DAL.Mongo.csproj | 2 +- .../Core.Blueprint.DAL.Redis.csproj | 2 +- .../Core.Blueprint.DAL.SQLServer.csproj | 4 ++-- .../Core.Blueprint.DAL.Storage.csproj | 2 +- 7 files changed, 29 insertions(+), 17 deletions(-) diff --git a/Core.Blueprint.DAL.API/appsettings.Local.json b/Core.Blueprint.DAL.API/appsettings.Local.json index f6bfce8..8820288 100644 --- a/Core.Blueprint.DAL.API/appsettings.Local.json +++ b/Core.Blueprint.DAL.API/appsettings.Local.json @@ -9,9 +9,9 @@ "DefaultCacheDurationInMinutes": 3 }, "Vault": { - "Address": "http://100.123.31.103:8200", - "Token": "hvs.e37LQvLuPhTd5ALS5QQ03Cwm", - "SecretMount": "secret" + "Address": "https://vault.dream-views.com/:8200", + "Token": "hvs.TGz6P3AsKpYuODMrs11Msiza", + "SecretMount": "thalos" }, "ConnectionStrings": { "BlobStorage": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFeqCnf2P==;BlobEndpoint=http://100.123.31.103:10000/devstoreaccount1;QueueEndpoint=http://100.123.31.103:10001/devstoreaccount1;TableEndpoint=http://100.123.31.103:10002/devstoreaccount1;", diff --git a/Core.Blueprint.DAL.KeyVault/Contracts/IKeyVaultService.cs b/Core.Blueprint.DAL.KeyVault/Contracts/IKeyVaultService.cs index 0c2aacf..5d64c82 100644 --- a/Core.Blueprint.DAL.KeyVault/Contracts/IKeyVaultService.cs +++ b/Core.Blueprint.DAL.KeyVault/Contracts/IKeyVaultService.cs @@ -4,9 +4,16 @@ namespace Core.Blueprint.DAL.KeyVault.Contracts { public interface IKeyVaultService { - Task CreateSecretAsync(KeyVaultRequest secret, CancellationToken cancellationToken); - Task> GetSecretAsync(string secret, CancellationToken cancellationToken); - Task> DeleteSecretAsync(string secretName, CancellationToken cancellationToken); - Task> UpdateSecretAsync(KeyVaultRequest secretName, CancellationToken cancellationToken); + Task CreateSecretAsync( + KeyVaultRequest secret, CancellationToken cancellationToken); + + Task<(KeyVaultResponse Secret, string? Message)> GetSecretAsync( + string secret, CancellationToken cancellationToken); + + Task<(string Message, bool Deleted)> DeleteSecretAsync( + string secretName, CancellationToken cancellationToken); + + Task<(KeyVaultResponse Secret, string? Message)> UpdateSecretAsync( + KeyVaultRequest secretName, CancellationToken cancellationToken); } } diff --git a/Core.Blueprint.DAL.KeyVault/Services/KeyVaultService.cs b/Core.Blueprint.DAL.KeyVault/Services/KeyVaultService.cs index 50158c8..4ef0ec4 100644 --- a/Core.Blueprint.DAL.KeyVault/Services/KeyVaultService.cs +++ b/Core.Blueprint.DAL.KeyVault/Services/KeyVaultService.cs @@ -5,24 +5,29 @@ namespace Core.Blueprint.DAL.KeyVault.Services { public class KeyVaultService(IKeyVaultProvider keyVaultProvider) : IKeyVaultService { - public async Task CreateSecretAsync(KeyVaultRequest newSecret, CancellationToken cancellationToken) + public async Task CreateSecretAsync( + KeyVaultRequest newSecret, CancellationToken cancellationToken) { var result = await keyVaultProvider.CreateSecretAsync(newSecret, cancellationToken); return result; } - public async Task> GetSecretAsync(string secretName, CancellationToken cancellationToken) + + public async Task<(KeyVaultResponse Secret, string? Message)> GetSecretAsync( + string secretName, CancellationToken cancellationToken) { - var result = await keyVaultProvider.GetSecretAsync(secretName, cancellationToken: cancellationToken); + var result = await keyVaultProvider.GetSecretAsync(secretName, cancellationToken); return result; } - public async Task> UpdateSecretAsync(KeyVaultRequest newSecret, CancellationToken cancellationToken) + public async Task<(KeyVaultResponse Secret, string? Message)> UpdateSecretAsync( + KeyVaultRequest newSecret, CancellationToken cancellationToken) { var result = await keyVaultProvider.UpdateSecretAsync(newSecret, cancellationToken); return result; } - public async Task> DeleteSecretAsync(string secretName, CancellationToken cancellationToken) + public async Task<(string Message, bool Deleted)> DeleteSecretAsync( + string secretName, CancellationToken cancellationToken) { var result = await keyVaultProvider.DeleteSecretAsync(secretName, cancellationToken); return result; diff --git a/Core.Blueprint.DAL.Mongo/Core.Blueprint.DAL.Mongo.csproj b/Core.Blueprint.DAL.Mongo/Core.Blueprint.DAL.Mongo.csproj index 2191b63..628b9ca 100644 --- a/Core.Blueprint.DAL.Mongo/Core.Blueprint.DAL.Mongo.csproj +++ b/Core.Blueprint.DAL.Mongo/Core.Blueprint.DAL.Mongo.csproj @@ -9,7 +9,7 @@ - + diff --git a/Core.Blueprint.DAL.Redis/Core.Blueprint.DAL.Redis.csproj b/Core.Blueprint.DAL.Redis/Core.Blueprint.DAL.Redis.csproj index 110dd94..2ea9282 100644 --- a/Core.Blueprint.DAL.Redis/Core.Blueprint.DAL.Redis.csproj +++ b/Core.Blueprint.DAL.Redis/Core.Blueprint.DAL.Redis.csproj @@ -7,7 +7,7 @@ - + diff --git a/Core.Blueprint.DAL.SQLServer/Core.Blueprint.DAL.SQLServer.csproj b/Core.Blueprint.DAL.SQLServer/Core.Blueprint.DAL.SQLServer.csproj index 9eb9df4..0f86c88 100644 --- a/Core.Blueprint.DAL.SQLServer/Core.Blueprint.DAL.SQLServer.csproj +++ b/Core.Blueprint.DAL.SQLServer/Core.Blueprint.DAL.SQLServer.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/Core.Blueprint.DAL.Storage/Core.Blueprint.DAL.Storage.csproj b/Core.Blueprint.DAL.Storage/Core.Blueprint.DAL.Storage.csproj index 279a5f5..01900fe 100644 --- a/Core.Blueprint.DAL.Storage/Core.Blueprint.DAL.Storage.csproj +++ b/Core.Blueprint.DAL.Storage/Core.Blueprint.DAL.Storage.csproj @@ -11,7 +11,7 @@ - +