Skip to content

Commit

Permalink
Allow no credentials with ApiClient
Browse files Browse the repository at this point in the history
  • Loading branch information
jmigueprieto committed Oct 30, 2024
1 parent a4f8af9 commit 654aaae
Showing 1 changed file with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,21 @@ public ApiClient orkesConductorClient(ClientProperties clientProperties,
return null;
}

String key = null;
String secret = null;
if (orkesClientProperties.getKeyId() != null) {
key = orkesClientProperties.getKeyId();
secret = orkesClientProperties.getSecret();
} else if (orkesClientProperties.getSecurityKeyId() != null) {
key = orkesClientProperties.getSecurityKeyId();
secret = orkesClientProperties.getSecuritySecret();
}

return ApiClient.builder()
var builder = ApiClient.builder()
.basePath(basePath)
.credentials(key, secret)
.connectTimeout(clientProperties.getTimeout().getConnect())
.readTimeout(clientProperties.getTimeout().getRead())
.writeTimeout(clientProperties.getTimeout().getWrite())
.verifyingSsl(clientProperties.isVerifyingSsl())
.build();
.verifyingSsl(clientProperties.isVerifyingSsl());


if (orkesClientProperties.getKeyId() != null) {
builder.credentials(orkesClientProperties.getKeyId(), orkesClientProperties.getSecret());
} else if (orkesClientProperties.getSecurityKeyId() != null) {
builder.credentials(orkesClientProperties.getSecurityKeyId(), orkesClientProperties.getSecuritySecret());
}

return builder.build();
}

@Bean
Expand Down

0 comments on commit 654aaae

Please sign in to comment.