singhpk234 commented on code in PR #1629:
URL: https://github.com/apache/polaris/pull/1629#discussion_r2103141552


##########
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)

Review Comment:
   sounds fair ! 



-- 
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

Reply via email to