Skip to content

Commit

Permalink
add constructor for KeyVaultLoadStoreParameter (Azure#19051)
Browse files Browse the repository at this point in the history
zhichengliu12581 authored Feb 8, 2021
1 parent 1fe9c0a commit 4c8dbe5
Showing 1 changed file with 31 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ public class KeyVaultLoadStoreParameter implements KeyStore.LoadStoreParameter {
* Stores the URI.
*/
private final String uri;

/**
* Stores the Azure AD authentication URL.
*/
@@ -34,7 +34,7 @@ public class KeyVaultLoadStoreParameter implements KeyStore.LoadStoreParameter {
* Stores the client secret.
*/
private final String clientSecret;

/**
* Stores the user-assigned identity.
*/
@@ -44,19 +44,9 @@ public class KeyVaultLoadStoreParameter implements KeyStore.LoadStoreParameter {
* Constructor.
*
* @param uri the Azure Key Vault URI.
* @param aadAuthenticationUrl the Azure AD authentication URL.
* @param tenantId the tenant ID.
* @param clientId the client ID.
* @param clientSecret the client secret.
*/
public KeyVaultLoadStoreParameter(String uri, String aadAuthenticationUrl,
String tenantId, String clientId, String clientSecret) {
this.uri = uri;
this.aadAuthenticationUrl = aadAuthenticationUrl;
this.tenantId = tenantId;
this.clientId = clientId;
this.clientSecret = clientSecret;
this.managedIdentity = null;
public KeyVaultLoadStoreParameter(String uri) {
this(uri, null);
}

/**
@@ -78,16 +68,35 @@ public KeyVaultLoadStoreParameter(String uri, String managedIdentity) {
* Constructor.
*
* @param uri the Azure Key Vault URI.
* @param tenantId the tenant ID.
* @param clientId the client ID.
* @param clientSecret the client secret.
*/
public KeyVaultLoadStoreParameter(String uri) {
public KeyVaultLoadStoreParameter(String uri, String tenantId, String clientId, String clientSecret) {
this(uri, null, tenantId, clientId, clientSecret);
}


/**
* Constructor.
*
* @param uri the Azure Key Vault URI.
* @param aadAuthenticationUrl the Azure AD authentication URL.
* @param tenantId the tenant ID.
* @param clientId the client ID.
* @param clientSecret the client secret.
*/
public KeyVaultLoadStoreParameter(String uri, String aadAuthenticationUrl,
String tenantId, String clientId, String clientSecret) {
this.uri = uri;
this.aadAuthenticationUrl = null;
this.tenantId = null;
this.clientId = null;
this.clientSecret = null;
this.aadAuthenticationUrl = aadAuthenticationUrl;
this.tenantId = tenantId;
this.clientId = clientId;
this.clientSecret = clientSecret;
this.managedIdentity = null;
}



/**
* Get the protection parameter.
*
@@ -100,7 +109,7 @@ public KeyStore.ProtectionParameter getProtectionParameter() {

/**
* Get the Azure AD authentication URL.
*
*
* @return the Azure AD authentication URL.
*/
public String getAadAuthenticationUrl() {
@@ -127,7 +136,7 @@ public String getClientSecret() {

/**
* Get the managed identity.
*
*
* @return the managed identity.
*/
public String getManagedIdentity() {

0 comments on commit 4c8dbe5

Please sign in to comment.