Skip to content

Commit 12d0eef

Browse files
committed
Minor renaming
1 parent 14ad281 commit 12d0eef

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/Confluent.SchemaRegistry.Encryption.HcVault/HcVaultKmsDriver.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public static void Register()
1616
public static readonly string Prefix = "hcvault://";
1717
public static readonly string TokenId = "token.id";
1818
public static readonly string Namespace = "namespace";
19-
public static readonly string AppRoleId = "app.role.id";
20-
public static readonly string AppRoleSecretId = "app.role.secret.id";
19+
public static readonly string ApproleRoleId = "approle.role.id";
20+
public static readonly string ApproleSecretId = "approle.secret.id";
2121

2222
public string GetKeyUrlPrefix()
2323
{
@@ -36,29 +36,29 @@ public IKmsClient NewKmsClient(IDictionary<string, string> config, string keyUrl
3636
{
3737
ns = Environment.GetEnvironmentVariable("VAULT_NAMESPACE");
3838
}
39-
config.TryGetValue(AppRoleId, out string appRoleId);
40-
if (appRoleId == null)
39+
config.TryGetValue(ApproleRoleId, out string roleId);
40+
if (roleId == null)
4141
{
42-
appRoleId = Environment.GetEnvironmentVariable("VAULT_APP_ROLE_ID");
42+
roleId = Environment.GetEnvironmentVariable("VAULT_APPROLE_ROLE_ID");
4343
}
44-
config.TryGetValue(AppRoleSecretId, out string appRoleSecretId);
45-
if (appRoleSecretId == null)
44+
config.TryGetValue(ApproleSecretId, out string secretId);
45+
if (secretId == null)
4646
{
47-
appRoleSecretId = Environment.GetEnvironmentVariable("VAULT_APP_ROLE_SECRET_ID");
47+
secretId = Environment.GetEnvironmentVariable("VAULT_APPROLE_SECRET_ID");
4848
}
4949

5050
IAuthMethodInfo authMethod;
51-
if (appRoleId != null && appRoleSecretId != null)
51+
if (roleId != null && secretId != null)
5252
{
53-
authMethod = new AppRoleAuthMethodInfo(appRoleId, appRoleSecretId);
53+
authMethod = new AppRoleAuthMethodInfo(roleId, secretId);
5454
}
5555
else if (tokenId != null)
5656
{
5757
authMethod = new TokenAuthMethodInfo(tokenId);
5858
}
5959
else
6060
{
61-
throw new ArgumentException($"Either {TokenId} or both {AppRoleId} and {AppRoleSecretId} " +
61+
throw new ArgumentException($"Either {TokenId} or both {ApproleRoleId} and {ApproleSecretId} " +
6262
$"must be provided in config or environment variables.");
6363
}
6464

0 commit comments

Comments
 (0)