Skip to content

Commit 10204dc

Browse files
committed
Remove credential flag from StorageAccessProperty.CLIENT_REGION
`CLIENT_REGION` is not a credential value, which is in line with Iceberg's `VendedCredentialsProvider` code. Cf. apache/iceberg#11389
1 parent f9237ab commit 10204dc

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
3939

4040
### Changes
4141

42+
- `client.region` is no longer considered a "credential" property (related to Iceberg REST Catalog API).
43+
4244
### Deprecations
4345

4446
### Fixes

polaris-core/src/main/java/org/apache/polaris/core/storage/StorageAccessProperty.java

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
* storage.
3030
*/
3131
public enum StorageAccessProperty {
32-
AWS_KEY_ID(String.class, "s3.access-key-id", "the aws access key id"),
33-
AWS_SECRET_KEY(String.class, "s3.secret-access-key", "the aws access key secret"),
34-
AWS_TOKEN(String.class, "s3.session-token", "the aws scoped access token"),
32+
AWS_KEY_ID(String.class, "s3.access-key-id", "the aws access key id", true),
33+
AWS_SECRET_KEY(String.class, "s3.secret-access-key", "the aws access key secret", true),
34+
AWS_TOKEN(String.class, "s3.session-token", "the aws scoped access token", true),
3535
AWS_SESSION_TOKEN_EXPIRES_AT_MS(
3636
String.class,
3737
"s3.session-token-expires-at-ms",
@@ -42,15 +42,18 @@ public enum StorageAccessProperty {
4242
AWS_PATH_STYLE_ACCESS(
4343
Boolean.class, "s3.path-style-access", "whether to use S3 path style access", false),
4444
CLIENT_REGION(
45-
String.class, "client.region", "region to configure client for making requests to AWS"),
45+
String.class,
46+
"client.region",
47+
"region to configure client for making requests to AWS",
48+
false),
4649
AWS_REFRESH_CREDENTIALS_ENDPOINT(
4750
String.class,
4851
AwsClientProperties.REFRESH_CREDENTIALS_ENDPOINT,
4952
"the endpoint to load vended credentials for a table from the catalog",
5053
false,
5154
false),
5255

53-
GCS_ACCESS_TOKEN(String.class, "gcs.oauth2.token", "the gcs scoped access token"),
56+
GCS_ACCESS_TOKEN(String.class, "gcs.oauth2.token", "the gcs scoped access token", true),
5457
GCS_ACCESS_TOKEN_EXPIRES_AT(
5558
String.class,
5659
"gcs.oauth2.token-expires-at",
@@ -66,8 +69,8 @@ public enum StorageAccessProperty {
6669

6770
// Currently not using ACCESS TOKEN as the ResolvingFileIO is using ADLSFileIO for azure case and
6871
// it expects for SAS
69-
AZURE_ACCESS_TOKEN(String.class, "", "the azure scoped access token"),
70-
AZURE_SAS_TOKEN(String.class, "adls.sas-token.", "an azure shared access signature token"),
72+
AZURE_ACCESS_TOKEN(String.class, "", "the azure scoped access token", true),
73+
AZURE_SAS_TOKEN(String.class, "adls.sas-token.", "an azure shared access signature token", true),
7174
AZURE_REFRESH_CREDENTIALS_ENDPOINT(
7275
String.class,
7376
AzureProperties.ADLS_REFRESH_CREDENTIALS_ENDPOINT,
@@ -93,15 +96,6 @@ public enum StorageAccessProperty {
9396
private final boolean isCredential;
9497
private final boolean isExpirationTimestamp;
9598

96-
/*
97-
s3.access-key-id`: id for for credentials that provide access to the data in S3
98-
- `s3.secret-access-key`: secret for credentials that provide access to data in S3
99-
- `s3.session-token
100-
*/
101-
StorageAccessProperty(Class valueType, String propertyName, String description) {
102-
this(valueType, propertyName, description, true);
103-
}
104-
10599
StorageAccessProperty(
106100
Class valueType, String propertyName, String description, boolean isCredential) {
107101
this(valueType, propertyName, description, isCredential, false);

polaris-core/src/test/java/org/apache/polaris/service/storage/aws/AwsCredentialsStorageIntegrationTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,13 +594,14 @@ public void testClientRegion(String awsPartition) {
594594
Set.of(),
595595
Optional.empty());
596596
assertThat(accessConfig.credentials())
597-
.isNotEmpty()
598-
.containsEntry(StorageAccessProperty.CLIENT_REGION.getPropertyName(), clientRegion);
597+
.containsEntry(StorageAccessProperty.AWS_TOKEN.getPropertyName(), "sess")
598+
.containsEntry(StorageAccessProperty.AWS_KEY_ID.getPropertyName(), "accessKey")
599+
.containsEntry(StorageAccessProperty.AWS_SECRET_KEY.getPropertyName(), "secretKey")
600+
.doesNotContainKey(StorageAccessProperty.CLIENT_REGION.getPropertyName());
599601
break;
600602
default:
601603
throw new IllegalArgumentException("Unknown aws partition: " + awsPartition);
602604
}
603-
;
604605
}
605606

606607
@ParameterizedTest

0 commit comments

Comments
 (0)