dimas-b commented on code in PR #1629: URL: https://github.com/apache/polaris/pull/1629#discussion_r2102567646
########## service/common/src/main/java/org/apache/polaris/service/storage/StorageConfiguration.java: ########## @@ -61,21 +63,31 @@ public interface StorageConfiguration { Optional<Duration> gcpAccessTokenLifespan(); default Supplier<StsClient> stsClientSupplier() { + return stsClientSupplier(true); + } + + default Supplier<StsClient> stsClientSupplier(boolean withCredentials) { return Suppliers.memoize( () -> { StsClientBuilder stsClientBuilder = StsClient.builder(); - if (awsAccessKey().isPresent() && awsSecretKey().isPresent()) { - LoggerFactory.getLogger(StorageConfiguration.class) - .warn("Using hard-coded AWS credentials - this is not recommended for production"); - StaticCredentialsProvider awsCredentialsProvider = - StaticCredentialsProvider.create( - AwsBasicCredentials.create(awsAccessKey().get(), awsSecretKey().get())); - stsClientBuilder.credentialsProvider(awsCredentialsProvider); + if (withCredentials) { + stsClientBuilder.credentialsProvider(stsCredentials()); } return stsClientBuilder.build(); }); } + default AwsCredentialsProvider stsCredentials() { + if (awsAccessKey().isPresent() && awsSecretKey().isPresent()) { + LoggerFactory.getLogger(StorageConfiguration.class) + .warn("Using hard-coded AWS credentials - this is not recommended for production"); + return StaticCredentialsProvider.create( + AwsBasicCredentials.create(awsAccessKey().get(), awsSecretKey().get())); + } else { + return DefaultCredentialsProvider.create(); Review Comment: The idea (for now) is for custom builds to manage cred. provided via a custom impl. of `PolarisStorageIntegrationProvider`. I suppose this will evolve as we move forward with @XJDKC 's proposal: https://lists.apache.org/thread/ph1tvn3lzvn8kh8fnhc6k585qmw2m12r -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org