Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes CAMEL-21721: azure-key-vault: fixing identity validation #17069

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ protected Endpoint createEndpoint(String uri, String remaining, Map<String, Obje
final KeyVaultEndpoint endpoint = new KeyVaultEndpoint(uri, this, epConfiguration);
setProperties(endpoint, parameters);

if (epConfiguration.getSecretClient() == null
if (CredentialType.CLIENT_SECRET == epConfiguration.getCredentialType() && epConfiguration.getSecretClient() == null
&& (epConfiguration.getClientId() == null || epConfiguration.getClientSecret() == null
|| epConfiguration.getTenantId() == null)) {
throw new IllegalArgumentException(
"Azure Secret Client or client Id, client secret and tenant Id must be specified");
"Azure Secret Client or client Id, client secret and tenant Id must be specified if credential type is set to clientSecret");
}

return endpoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ public void createEndpointWithMinimalConfiguration() throws Exception {
assertNull(endpoint.getConfiguration().getTenantId());
}

@Test
public void createEndpointWithMinimalIdentityConfiguration() throws Exception {
KeyVaultComponent component = context.getComponent("azure-key-vault", KeyVaultComponent.class);
KeyVaultEndpoint endpoint = (KeyVaultEndpoint) component
.createEndpoint("azure-key-valut://MyVault?credentialType=AZURE_IDENTITY");

assertNotNull(endpoint);
}

@Test
public void createEndpointWithExplicitCredentials() throws Exception {

Expand Down