-
Notifications
You must be signed in to change notification settings - Fork 1
/
AzureKeyVaultSecretRepository.cs
36 lines (31 loc) · 1.07 KB
/
AzureKeyVaultSecretRepository.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Azure.Security.KeyVault.Secrets;
namespace src
{
public class AzureKeyVaultSecretRepository
{
private readonly SecretClient _secretClient;
private readonly string _secretNameServer;
private readonly string _secretNameUser;
private readonly string _secretNamePass;
public AzureKeyVaultSecretRepository(SecretClient secretClient,
string secretNameServer, string secretNameUser, string secretNamePass)
{
_secretClient = secretClient;
_secretNameServer = secretNameServer;
_secretNameUser = secretNameUser;
_secretNamePass = secretNamePass;
}
public string GetServerName()
{
return _secretClient.GetSecret(_secretNameServer).Value.Value;
}
public string GetUserName()
{
return _secretClient.GetSecret(_secretNameUser).Value.Value;
}
public string GetPassword()
{
return _secretClient.GetSecret(_secretNamePass).Value.Value;
}
}
}