snazy commented on code in PR #3409:
URL: https://github.com/apache/polaris/pull/3409#discussion_r2681189887
##########
runtime/service/src/main/java/org/apache/polaris/service/storage/StorageConfiguration.java:
##########
@@ -57,6 +58,21 @@ public interface StorageConfiguration extends S3AccessConfig
{
@WithName("aws.secret-key")
Optional<String> awsSecretKey();
+ @WithName("aws")
+ Map<String, StorageConfig> storages();
Review Comment:
[See](https://smallrye.io/smallrye-config/Main/config/mappings/#withparentname),
replacing the `awsAccessKey()` and `awsSecretKey()` properties.
```java
@WithParentName
Optional<StorageConfig> defaultSecrets();
```
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java:
##########
@@ -105,6 +107,17 @@ public String serialize() {
}
}
+ public Optional<String> resolveStorageName() {
+ if (getAllowedLocations().isEmpty()) {
+ return Optional.empty();
+ }
+ try {
+ return Optional.ofNullable(new
URI(getAllowedLocations().get(0)).getHost());
Review Comment:
`URI` will fail for certain storage-locations as there can be illegal
characters.
##########
runtime/service/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java:
##########
@@ -54,15 +54,16 @@ public class PolarisStorageIntegrationProviderImpl
implements PolarisStorageInte
private final StsClientProvider stsClientProvider;
private final Optional<AwsCredentialsProvider> stsCredentials;
private final Supplier<GoogleCredentials> gcpCredsProvider;
+ private final StorageConfiguration storageConfiguration;
@SuppressWarnings("CdiInjectionPointsInspection")
@Inject
public PolarisStorageIntegrationProviderImpl(
StorageConfiguration storageConfiguration, StsClientProvider
stsClientProvider, Clock clock) {
- this(
- stsClientProvider,
- Optional.ofNullable(storageConfiguration.stsCredentials()),
- storageConfiguration.gcpCredentialsSupplier(clock));
+ this.storageConfiguration = storageConfiguration;
+ this.stsClientProvider = stsClientProvider;
+ this.stsCredentials = Optional.empty(); //
ofNullable(storageConfiguration.stsCredentials());
Review Comment:
```suggestion
this.stsCredentials = Optional.empty();
```
##########
runtime/service/src/main/java/org/apache/polaris/service/storage/StorageConfiguration.java:
##########
@@ -57,6 +58,21 @@ public interface StorageConfiguration extends S3AccessConfig
{
@WithName("aws.secret-key")
Optional<String> awsSecretKey();
+ @WithName("aws")
+ Map<String, StorageConfig> storages();
+
+ interface StorageConfig {
+ @WithName("access-key")
+ Optional<String> awsAccessKey();
+
+ @WithName("secret-key")
+ Optional<String> awsSecretKey();
Review Comment:
Don't think `Optional`'s needed here. Both values are needed (or none).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]