diff --git a/polaris-core/src/main/java/org/apache/polaris/core/entity/CatalogEntity.java b/polaris-core/src/main/java/org/apache/polaris/core/entity/CatalogEntity.java index 113c8a3fe..341dbf67d 100644 --- a/polaris-core/src/main/java/org/apache/polaris/core/entity/CatalogEntity.java +++ b/polaris-core/src/main/java/org/apache/polaris/core/entity/CatalogEntity.java @@ -36,14 +36,14 @@ import org.apache.polaris.core.admin.model.FileStorageConfigInfo; import org.apache.polaris.core.admin.model.GcpStorageConfigInfo; import org.apache.polaris.core.admin.model.PolarisCatalog; -import org.apache.polaris.core.admin.model.S3StorageConfigInfo; +import org.apache.polaris.core.admin.model.S3CompatibleStorageConfigInfo; import org.apache.polaris.core.admin.model.StorageConfigInfo; import org.apache.polaris.core.storage.FileStorageConfigurationInfo; import org.apache.polaris.core.storage.PolarisStorageConfigurationInfo; import org.apache.polaris.core.storage.aws.AwsStorageConfigurationInfo; import org.apache.polaris.core.storage.azure.AzureStorageConfigurationInfo; import org.apache.polaris.core.storage.gcp.GcpStorageConfigurationInfo; -import org.apache.polaris.core.storage.s3.S3StorageConfigurationInfo; +import org.apache.polaris.core.storage.s3compatible.S3CompatibleStorageConfigurationInfo; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -142,22 +142,22 @@ private StorageConfigInfo getStorageInfo(Map internalProperties) .setAllowedLocations(awsConfig.getAllowedLocations()) .build(); } - if (configInfo instanceof S3StorageConfigurationInfo) { - S3StorageConfigurationInfo s3Config = (S3StorageConfigurationInfo) configInfo; - return S3StorageConfigInfo.builder() + if (configInfo instanceof S3CompatibleStorageConfigurationInfo) { + S3CompatibleStorageConfigurationInfo s3Config = (S3CompatibleStorageConfigurationInfo) configInfo; + return S3CompatibleStorageConfigInfo.builder() .setStorageType(StorageConfigInfo.StorageTypeEnum.S3_COMPATIBLE) .setS3Endpoint(s3Config.getS3Endpoint()) .setS3PathStyleAccess(s3Config.getS3PathStyleAccess()) .setCredsVendingStrategy( - org.apache.polaris.core.admin.model.S3StorageConfigInfo.CredsVendingStrategyEnum + org.apache.polaris.core.admin.model.S3CompatibleStorageConfigInfo.CredsVendingStrategyEnum .valueOf( - org.apache.polaris.core.admin.model.S3StorageConfigInfo + org.apache.polaris.core.admin.model.S3CompatibleStorageConfigInfo .CredsVendingStrategyEnum.class, s3Config.getCredsVendingStrategy().name())) .setCredsCatalogAndClientStrategy( - org.apache.polaris.core.admin.model.S3StorageConfigInfo + org.apache.polaris.core.admin.model.S3CompatibleStorageConfigInfo .CredsCatalogAndClientStrategyEnum.valueOf( - org.apache.polaris.core.admin.model.S3StorageConfigInfo + org.apache.polaris.core.admin.model.S3CompatibleStorageConfigInfo .CredsCatalogAndClientStrategyEnum.class, s3Config.getCredsCatalogAndClientStrategy().name())) .setAllowedLocations(s3Config.getAllowedLocations()) @@ -278,17 +278,15 @@ public Builder setStorageConfigurationInfo( break; case S3_COMPATIBLE: - S3StorageConfigInfo s3ConfigModel = (S3StorageConfigInfo) storageConfigModel; + S3CompatibleStorageConfigInfo s3ConfigModel = (S3CompatibleStorageConfigInfo) storageConfigModel; config = - new S3StorageConfigurationInfo( + new S3CompatibleStorageConfigurationInfo( PolarisStorageConfigurationInfo.StorageType.S3_COMPATIBLE, - S3StorageConfigInfo.CredsVendingStrategyEnum.valueOf( - org.apache.polaris.core.storage.s3.S3StorageConfigurationInfo - .CredsVendingStrategyEnum.class, + S3CompatibleStorageConfigInfo.CredsVendingStrategyEnum.valueOf( + org.apache.polaris.core.storage.s3compatible.S3CompatibleStorageConfigurationInfo.CredsVendingStrategyEnum.class, s3ConfigModel.getCredsVendingStrategy().name()), - S3StorageConfigInfo.CredsCatalogAndClientStrategyEnum.valueOf( - org.apache.polaris.core.storage.s3.S3StorageConfigurationInfo - .CredsCatalogAndClientStrategyEnum.class, + S3CompatibleStorageConfigInfo.CredsCatalogAndClientStrategyEnum.valueOf( + org.apache.polaris.core.storage.s3compatible.S3CompatibleStorageConfigurationInfo.CredsCatalogAndClientStrategyEnum.class, s3ConfigModel.getCredsCatalogAndClientStrategy().name()), s3ConfigModel.getS3Endpoint(), s3ConfigModel.getS3CredentialsCatalogAccessKeyId(), diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java index 5a47d3297..af8c1fe14 100644 --- a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java +++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java @@ -46,7 +46,7 @@ import org.apache.polaris.core.storage.aws.AwsStorageConfigurationInfo; import org.apache.polaris.core.storage.azure.AzureStorageConfigurationInfo; import org.apache.polaris.core.storage.gcp.GcpStorageConfigurationInfo; -import org.apache.polaris.core.storage.s3.S3StorageConfigurationInfo; +import org.apache.polaris.core.storage.s3compatible.S3CompatibleStorageConfigurationInfo; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -63,7 +63,7 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME) @JsonSubTypes({ @JsonSubTypes.Type(value = AwsStorageConfigurationInfo.class), - @JsonSubTypes.Type(value = S3StorageConfigurationInfo.class), + @JsonSubTypes.Type(value = S3CompatibleStorageConfigurationInfo.class), @JsonSubTypes.Type(value = AzureStorageConfigurationInfo.class), @JsonSubTypes.Type(value = GcpStorageConfigurationInfo.class), @JsonSubTypes.Type(value = FileStorageConfigurationInfo.class), diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/s3/S3CredentialsStorageIntegration.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/s3compatible/S3CompatibleCredentialsStorageIntegration.java similarity index 90% rename from polaris-core/src/main/java/org/apache/polaris/core/storage/s3/S3CredentialsStorageIntegration.java rename to polaris-core/src/main/java/org/apache/polaris/core/storage/s3compatible/S3CompatibleCredentialsStorageIntegration.java index 97738b203..39010d01c 100644 --- a/polaris-core/src/main/java/org/apache/polaris/core/storage/s3/S3CredentialsStorageIntegration.java +++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/s3compatible/S3CompatibleCredentialsStorageIntegration.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.core.storage.s3; +package org.apache.polaris.core.storage.s3compatible; import java.net.URI; import java.util.EnumMap; @@ -36,17 +36,17 @@ import software.amazon.awssdk.services.sts.model.AssumeRoleResponse; /** Credential vendor that supports generating */ -public class S3CredentialsStorageIntegration - extends InMemoryStorageIntegration { +public class S3CompatibleCredentialsStorageIntegration + extends InMemoryStorageIntegration { private static final Logger LOGGER = - LoggerFactory.getLogger(S3CredentialsStorageIntegration.class); + LoggerFactory.getLogger(S3CompatibleCredentialsStorageIntegration.class); private StsClient stsClient; - public S3CredentialsStorageIntegration() { - super(S3CredentialsStorageIntegration.class.getName()); + public S3CompatibleCredentialsStorageIntegration() { + super(S3CompatibleCredentialsStorageIntegration.class.getName()); } - public void createStsClient(S3StorageConfigurationInfo s3storageConfig) { + public void createStsClient(S3CompatibleStorageConfigurationInfo s3storageConfig) { LOGGER.debug("S3Compatible - createStsClient()"); StsClientBuilder stsBuilder = software.amazon.awssdk.services.sts.StsClient.builder(); @@ -68,7 +68,7 @@ public void createStsClient(S3StorageConfigurationInfo s3storageConfig) { @Override public EnumMap getSubscopedCreds( @NotNull PolarisDiagnostics diagnostics, - @NotNull S3StorageConfigurationInfo storageConfig, + @NotNull S3CompatibleStorageConfigurationInfo storageConfig, boolean allowListOperation, @NotNull Set allowedReadLocations, @NotNull Set allowedWriteLocations) { diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/s3/S3StorageConfigurationInfo.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/s3compatible/S3CompatibleStorageConfigurationInfo.java similarity index 97% rename from polaris-core/src/main/java/org/apache/polaris/core/storage/s3/S3StorageConfigurationInfo.java rename to polaris-core/src/main/java/org/apache/polaris/core/storage/s3compatible/S3CompatibleStorageConfigurationInfo.java index a382f3c22..e1a903890 100644 --- a/polaris-core/src/main/java/org/apache/polaris/core/storage/s3/S3StorageConfigurationInfo.java +++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/s3compatible/S3CompatibleStorageConfigurationInfo.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.polaris.core.storage.s3; +package org.apache.polaris.core.storage.s3compatible; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -28,7 +28,7 @@ import org.jetbrains.annotations.Nullable; /** Polaris Storage Configuration information for an S3 Compatible solution, MinIO, Dell ECS... */ -public class S3StorageConfigurationInfo extends PolarisStorageConfigurationInfo { +public class S3CompatibleStorageConfigurationInfo extends PolarisStorageConfigurationInfo { // 5 is the approximate max allowed locations for the size of AccessPolicy when LIST is required // for allowed read and write locations for subscoping creds. @@ -59,7 +59,7 @@ public static enum CredsCatalogAndClientStrategyEnum { // Constructor @JsonCreator - public S3StorageConfigurationInfo( + public S3CompatibleStorageConfigurationInfo( @JsonProperty(value = "storageType", required = true) @NotNull StorageType storageType, @JsonProperty(value = "credsVendingStrategy", required = true) @NotNull CredsVendingStrategyEnum credsVendingStrategy, diff --git a/polaris-service/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java b/polaris-service/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java index 6e9b04e15..aaa7f7749 100644 --- a/polaris-service/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java +++ b/polaris-service/src/main/java/org/apache/polaris/service/storage/PolarisStorageIntegrationProviderImpl.java @@ -35,7 +35,7 @@ import org.apache.polaris.core.storage.aws.AwsCredentialsStorageIntegration; import org.apache.polaris.core.storage.azure.AzureCredentialsStorageIntegration; import org.apache.polaris.core.storage.gcp.GcpCredentialsStorageIntegration; -import org.apache.polaris.core.storage.s3.S3CredentialsStorageIntegration; +import org.apache.polaris.core.storage.s3compatible.S3CompatibleCredentialsStorageIntegration; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import software.amazon.awssdk.services.sts.StsClient; @@ -67,7 +67,7 @@ PolarisStorageIntegration getStorageIntegrationForConfig( new AwsCredentialsStorageIntegration(stsClientSupplier.get()); break; case S3_COMPATIBLE: - storageIntegration = (PolarisStorageIntegration) new S3CredentialsStorageIntegration(); + storageIntegration = (PolarisStorageIntegration) new S3CompatibleCredentialsStorageIntegration(); break; case GCS: storageIntegration = diff --git a/spec/polaris-management-service.yml b/spec/polaris-management-service.yml index 2f6017d5d..22bdb2013 100644 --- a/spec/polaris-management-service.yml +++ b/spec/polaris-management-service.yml @@ -878,7 +878,7 @@ components: propertyName: storageType mapping: S3: "#/components/schemas/AwsStorageConfigInfo" - S3_COMPATIBLE: "#/components/schemas/S3StorageConfigInfo" + S3_COMPATIBLE: "#/components/schemas/S3CompatibleStorageConfigInfo" AZURE: "#/components/schemas/AzureStorageConfigInfo" GCS: "#/components/schemas/GcpStorageConfigInfo" FILE: "#/components/schemas/FileStorageConfigInfo" @@ -903,7 +903,7 @@ components: required: - roleArn - S3StorageConfigInfo: + S3CompatibleStorageConfigInfo: type: object description: S3 compatible storage configuration info (MinIO, Dell ECS, Netapp StorageGRID, ...) allOf: