You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "dimas-b (via GitHub)" <gi...@apache.org> on 2025/09/24 21:41:19 UTC
[PR] Support S3 storage that does not have STS [polaris]
dimas-b opened a new pull request, #2672:
URL: https://github.com/apache/polaris/pull/2672
This change is backward compatible with old catalogs that have storage configuration for S3 systems with STS.
* Add new property to S3 storage config: `stsUnavailable` (defaults to "available").
* Do not call STS when unavailable in `AwsCredentialsStorageIntegration`, but still put other properties (e.g. s3.endpoint) into `AccessConfig`
* Fail create/load table requests if credential vending is requested but STS is not available.
<!--
Possible security vulnerabilities: STOP here and contact security@apache.org instead!
Please update the title of the PR with a meaningful message - do not leave it "empty" or "generated"
Please update this summary field:
The summary should cover these topics, if applicable:
* the motivation for the change
* a description of the status quo, for example the current behavior
* the desired behavior
* etc
PR checklist:
- Do a self-review of your code before opening a pull request
- Make sure that there's good test coverage for the changes included in this PR
- Run tests locally before pushing a PR (./gradlew check)
- Code should have comments where applicable. Particularly hard-to-understand
areas deserve good in-line documentation.
- Include changes and enhancements to the documentation (in site/content/in-dev/unreleased)
- For Work In Progress Pull Requests, please use the Draft PR feature.
Make sure to add the information BELOW this comment.
Everything in this comment will NOT be added to the PR description.
-->
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2388720183
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java:
##########
@@ -79,43 +79,46 @@ public AccessConfig getSubscopedCreds(
int storageCredentialDurationSeconds =
realmConfig.getConfig(STORAGE_CREDENTIAL_DURATION_SECONDS);
AwsStorageConfigurationInfo storageConfig = config();
- AssumeRoleRequest.Builder request =
- AssumeRoleRequest.builder()
- .externalId(storageConfig.getExternalId())
- .roleArn(storageConfig.getRoleARN())
- .roleSessionName("PolarisAwsCredentialsStorageIntegration")
- .policy(
- policyString(
- storageConfig.getAwsPartition(),
- allowListOperation,
- allowedReadLocations,
- allowedWriteLocations)
- .toJson())
- .durationSeconds(storageCredentialDurationSeconds);
- credentialsProvider.ifPresent(
- cp -> request.overrideConfiguration(b -> b.credentialsProvider(cp)));
-
String region = storageConfig.getRegion();
- @SuppressWarnings("resource")
- // Note: stsClientProvider returns "thin" clients that do not need closing
- StsClient stsClient =
- stsClientProvider.stsClient(StsDestination.of(storageConfig.getStsEndpointUri(), region));
-
- AssumeRoleResponse response = stsClient.assumeRole(request.build());
AccessConfig.Builder accessConfig = AccessConfig.builder();
- accessConfig.put(StorageAccessProperty.AWS_KEY_ID, response.credentials().accessKeyId());
- accessConfig.put(
- StorageAccessProperty.AWS_SECRET_KEY, response.credentials().secretAccessKey());
- accessConfig.put(StorageAccessProperty.AWS_TOKEN, response.credentials().sessionToken());
- Optional.ofNullable(response.credentials().expiration())
- .ifPresent(
- i -> {
- accessConfig.put(
- StorageAccessProperty.EXPIRATION_TIME, String.valueOf(i.toEpochMilli()));
- accessConfig.put(
- StorageAccessProperty.AWS_SESSION_TOKEN_EXPIRES_AT_MS,
- String.valueOf(i.toEpochMilli()));
- });
+
+ if (storageConfig.shouldUseSts()) {
Review Comment:
@singhpk234 : thanks for the ping and sorry about missing a related bug (should be fixed in #2711)
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2383277570
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java:
##########
@@ -98,6 +98,18 @@ public URI getInternalEndpointUri() {
/** Flag indicating whether path-style bucket access should be forced in S3 clients. */
public abstract @Nullable Boolean getPathStyleAccess();
+ /**
+ * Flag indicating whether STS is available or not. It is modeled in the negative to simplify
+ * support for unset values ({@code null} being interpreted as {@code false}).
Review Comment:
Javadoc is correct, I believe 😅 A null (unset) value would be treated as `StsUnavailable` being `false` , meaning that STS is _available_ (current default). Cf. `shouldUseSts()`.
I believe interpreting `null` as `false` is quite common.
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2383277570
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java:
##########
@@ -98,6 +98,18 @@ public URI getInternalEndpointUri() {
/** Flag indicating whether path-style bucket access should be forced in S3 clients. */
public abstract @Nullable Boolean getPathStyleAccess();
+ /**
+ * Flag indicating whether STS is available or not. It is modeled in the negative to simplify
+ * support for unset values ({@code null} being interpreted as {@code false}).
Review Comment:
Javadoc is correct, I believe 😅 A null (unset) value would be treated `StsUnavailable` being `false` , meaning that STS is _available_ (current default).
I believe interpreting `null` as `false` is quite common.
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java:
##########
@@ -98,6 +98,18 @@ public URI getInternalEndpointUri() {
/** Flag indicating whether path-style bucket access should be forced in S3 clients. */
public abstract @Nullable Boolean getPathStyleAccess();
+ /**
+ * Flag indicating whether STS is available or not. It is modeled in the negative to simplify
+ * support for unset values ({@code null} being interpreted as {@code false}).
Review Comment:
Javadoc is correct, I believe 😅 A null (unset) value would be treated as `StsUnavailable` being `false` , meaning that STS is _available_ (current default).
I believe interpreting `null` as `false` is quite common.
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dennishuo (via GitHub)" <gi...@apache.org>.
dennishuo commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2384462221
##########
CHANGELOG.md:
##########
@@ -40,6 +40,8 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
- Added a Management API endpoint to reset principal credentials, controlled by the `ENABLE_CREDENTIAL_RESET` (default: true) feature flag.
+- Added support for S3-compatible storage that does not have STS (use `stsUavailable: true` in catalog storage configuration)
Review Comment:
Yeah, to clarify, I didn't mean to add too much, just maybe adding a `; credential vending will then be disabled` in the parentheses so that the change note would say
(use `stsUavailable: true` in catalog storage configuration; credential vending will then be disabled);
In any case, non-blocking.
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2383631469
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java:
##########
@@ -98,6 +98,18 @@ public URI getInternalEndpointUri() {
/** Flag indicating whether path-style bucket access should be forced in S3 clients. */
public abstract @Nullable Boolean getPathStyleAccess();
+ /**
+ * Flag indicating whether STS is available or not. It is modeled in the negative to simplify
+ * support for unset values ({@code null} being interpreted as {@code false}).
Review Comment:
Thanks for doing that, this LGTM.
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2388609718
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java:
##########
@@ -79,43 +79,46 @@ public AccessConfig getSubscopedCreds(
int storageCredentialDurationSeconds =
realmConfig.getConfig(STORAGE_CREDENTIAL_DURATION_SECONDS);
AwsStorageConfigurationInfo storageConfig = config();
- AssumeRoleRequest.Builder request =
- AssumeRoleRequest.builder()
- .externalId(storageConfig.getExternalId())
- .roleArn(storageConfig.getRoleARN())
- .roleSessionName("PolarisAwsCredentialsStorageIntegration")
- .policy(
- policyString(
- storageConfig.getAwsPartition(),
- allowListOperation,
- allowedReadLocations,
- allowedWriteLocations)
- .toJson())
- .durationSeconds(storageCredentialDurationSeconds);
- credentialsProvider.ifPresent(
- cp -> request.overrideConfiguration(b -> b.credentialsProvider(cp)));
-
String region = storageConfig.getRegion();
- @SuppressWarnings("resource")
- // Note: stsClientProvider returns "thin" clients that do not need closing
- StsClient stsClient =
- stsClientProvider.stsClient(StsDestination.of(storageConfig.getStsEndpointUri(), region));
-
- AssumeRoleResponse response = stsClient.assumeRole(request.build());
AccessConfig.Builder accessConfig = AccessConfig.builder();
- accessConfig.put(StorageAccessProperty.AWS_KEY_ID, response.credentials().accessKeyId());
- accessConfig.put(
- StorageAccessProperty.AWS_SECRET_KEY, response.credentials().secretAccessKey());
- accessConfig.put(StorageAccessProperty.AWS_TOKEN, response.credentials().sessionToken());
- Optional.ofNullable(response.credentials().expiration())
- .ifPresent(
- i -> {
- accessConfig.put(
- StorageAccessProperty.EXPIRATION_TIME, String.valueOf(i.toEpochMilli()));
- accessConfig.put(
- StorageAccessProperty.AWS_SESSION_TOKEN_EXPIRES_AT_MS,
- String.valueOf(i.toEpochMilli()));
- });
+
+ if (storageConfig.shouldUseSts()) {
Review Comment:
I'll make a follow-up PR for this presently.
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2379554374
##########
CHANGELOG.md:
##########
@@ -40,6 +40,8 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
- Added a Management API endpoint to reset principal credentials, controlled by the `ENABLE_CREDENTIAL_RESET` (default: true) feature flag.
+- Added support for S3-compatible storage that does not have STS (use `stsUavailable: true` in catalog storage configuration)
Review Comment:
I will certainly add a docs page about this to "getting started" once the impl. is approved :)
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2383382532
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java:
##########
@@ -98,6 +98,18 @@ public URI getInternalEndpointUri() {
/** Flag indicating whether path-style bucket access should be forced in S3 clients. */
public abstract @Nullable Boolean getPathStyleAccess();
+ /**
+ * Flag indicating whether STS is available or not. It is modeled in the negative to simplify
+ * support for unset values ({@code null} being interpreted as {@code false}).
Review Comment:
You are right, sorry for the misleading. I was confused by two new methods introduced, `getStsUnavailable()`, `shouldUseSts()`, I think it'd be nice to only keep one of them. For example, the check brought up by @singhpk234 here https://github.com/apache/polaris/pull/2672#discussion_r2383187673, would be reasonable to apply when we check `getStsUnavailable()` purely. Wrapping `getStsUnavailable()` with `shouldUseSts()` makes it even more ambiguous, so that the logic become less obviously when we need to check if users ask for credential vending.
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2379459708
##########
CHANGELOG.md:
##########
@@ -40,6 +40,8 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
- Added a Management API endpoint to reset principal credentials, controlled by the `ENABLE_CREDENTIAL_RESET` (default: true) feature flag.
+- Added support for S3-compatible storage that does not have STS (use `stsUavailable: true` in catalog storage configuration)
Review Comment:
Re: message changes: I'm not sure it's worth adding YAML to CHANGELOG... Would it not make it too verbose? In the end CHANGELOG has notes for many releases :thinking:
How about I update it with a CLI example when I add CLI support for the new config entry?
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2383287183
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java:
##########
@@ -79,43 +79,46 @@ public AccessConfig getSubscopedCreds(
int storageCredentialDurationSeconds =
realmConfig.getConfig(STORAGE_CREDENTIAL_DURATION_SECONDS);
AwsStorageConfigurationInfo storageConfig = config();
- AssumeRoleRequest.Builder request =
- AssumeRoleRequest.builder()
- .externalId(storageConfig.getExternalId())
- .roleArn(storageConfig.getRoleARN())
- .roleSessionName("PolarisAwsCredentialsStorageIntegration")
- .policy(
- policyString(
- storageConfig.getAwsPartition(),
- allowListOperation,
- allowedReadLocations,
- allowedWriteLocations)
- .toJson())
- .durationSeconds(storageCredentialDurationSeconds);
- credentialsProvider.ifPresent(
- cp -> request.overrideConfiguration(b -> b.credentialsProvider(cp)));
-
String region = storageConfig.getRegion();
- @SuppressWarnings("resource")
- // Note: stsClientProvider returns "thin" clients that do not need closing
- StsClient stsClient =
- stsClientProvider.stsClient(StsDestination.of(storageConfig.getStsEndpointUri(), region));
-
- AssumeRoleResponse response = stsClient.assumeRole(request.build());
AccessConfig.Builder accessConfig = AccessConfig.builder();
- accessConfig.put(StorageAccessProperty.AWS_KEY_ID, response.credentials().accessKeyId());
- accessConfig.put(
- StorageAccessProperty.AWS_SECRET_KEY, response.credentials().secretAccessKey());
- accessConfig.put(StorageAccessProperty.AWS_TOKEN, response.credentials().sessionToken());
- Optional.ofNullable(response.credentials().expiration())
- .ifPresent(
- i -> {
- accessConfig.put(
- StorageAccessProperty.EXPIRATION_TIME, String.valueOf(i.toEpochMilli()));
- accessConfig.put(
- StorageAccessProperty.AWS_SESSION_TOKEN_EXPIRES_AT_MS,
- String.valueOf(i.toEpochMilli()));
- });
+
+ if (storageConfig.shouldUseSts()) {
Review Comment:
Ideally yes, and that was in my first revision of this PR. Unfortunately many existing use cases excessively request credential vending for `FILE` storage and would be broken if we were to enforce this logic "in general".
We cannot enforce it here, because "storage integration" code has valid call paths without credential vending, where it exposes non-credential config to clients (e.g. S3 endpoints).
I'd like to enforce stricter checks as you suggested, but due to risk of breaking existing clients (I saw that in our reg. tests), I propose to defer it. WDYT?
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dennishuo (via GitHub)" <gi...@apache.org>.
dennishuo commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2384462813
##########
CHANGELOG.md:
##########
@@ -40,6 +40,8 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
- Added a Management API endpoint to reset principal credentials, controlled by the `ENABLE_CREDENTIAL_RESET` (default: true) feature flag.
+- Added support for S3-compatible storage that does not have STS (use `stsUavailable: true` in catalog storage configuration)
Review Comment:
Incidentally, `SKIP_CREDENTIAL_SUBSCOPING_INDIRECTION` really was only intended to pertain to the "credential" aspect, so it's unfortunate that it sort of fell into fully disabling StorageConfig mix-ins even for the non-credential-related config. But we can sort that out some other time.
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dennishuo (via GitHub)" <gi...@apache.org>.
dennishuo commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2377639090
##########
CHANGELOG.md:
##########
@@ -40,6 +40,8 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
- Added a Management API endpoint to reset principal credentials, controlled by the `ENABLE_CREDENTIAL_RESET` (default: true) feature flag.
+- Added support for S3-compatible storage that does not have STS (use `stsUavailable: true` in catalog storage configuration)
Review Comment:
Could be worth expanding this sentence with a bit more of what's in the yaml for easy reference if people are reading the notes without wanting to read the full spec change -- specifically to clarify that it disables credential vending rather than vending some kind of root credentials after skipping STS subscoping.
How does the behavior compare to setting `SKIP_CREDENTIAL_SUBSCOPING_INDIRECTION=true`?
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2379547466
##########
CHANGELOG.md:
##########
@@ -40,6 +40,8 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
- Added a Management API endpoint to reset principal credentials, controlled by the `ENABLE_CREDENTIAL_RESET` (default: true) feature flag.
+- Added support for S3-compatible storage that does not have STS (use `stsUavailable: true` in catalog storage configuration)
Review Comment:
I agree that from an user standpoint, CLI (or `curl` :) ) and updating the configuration list on the documentation would be more than welcome.
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2383187673
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java:
##########
@@ -79,43 +79,46 @@ public AccessConfig getSubscopedCreds(
int storageCredentialDurationSeconds =
realmConfig.getConfig(STORAGE_CREDENTIAL_DURATION_SECONDS);
AwsStorageConfigurationInfo storageConfig = config();
- AssumeRoleRequest.Builder request =
- AssumeRoleRequest.builder()
- .externalId(storageConfig.getExternalId())
- .roleArn(storageConfig.getRoleARN())
- .roleSessionName("PolarisAwsCredentialsStorageIntegration")
- .policy(
- policyString(
- storageConfig.getAwsPartition(),
- allowListOperation,
- allowedReadLocations,
- allowedWriteLocations)
- .toJson())
- .durationSeconds(storageCredentialDurationSeconds);
- credentialsProvider.ifPresent(
- cp -> request.overrideConfiguration(b -> b.credentialsProvider(cp)));
-
String region = storageConfig.getRegion();
- @SuppressWarnings("resource")
- // Note: stsClientProvider returns "thin" clients that do not need closing
- StsClient stsClient =
- stsClientProvider.stsClient(StsDestination.of(storageConfig.getStsEndpointUri(), region));
-
- AssumeRoleResponse response = stsClient.assumeRole(request.build());
AccessConfig.Builder accessConfig = AccessConfig.builder();
- accessConfig.put(StorageAccessProperty.AWS_KEY_ID, response.credentials().accessKeyId());
- accessConfig.put(
- StorageAccessProperty.AWS_SECRET_KEY, response.credentials().secretAccessKey());
- accessConfig.put(StorageAccessProperty.AWS_TOKEN, response.credentials().sessionToken());
- Optional.ofNullable(response.credentials().expiration())
- .ifPresent(
- i -> {
- accessConfig.put(
- StorageAccessProperty.EXPIRATION_TIME, String.valueOf(i.toEpochMilli()));
- accessConfig.put(
- StorageAccessProperty.AWS_SESSION_TOKEN_EXPIRES_AT_MS,
- String.valueOf(i.toEpochMilli()));
- });
+
+ if (storageConfig.shouldUseSts()) {
Review Comment:
[doubt] what if the client says it wan't to do `x-Iceberg-vended-credentials`, indication it wants credentials vending, but the storage doesn't support it, should we throw a 400 instead ?
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2382795928
##########
CHANGELOG.md:
##########
@@ -40,6 +40,8 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
- Added a Management API endpoint to reset principal credentials, controlled by the `ENABLE_CREDENTIAL_RESET` (default: true) feature flag.
+- Added support for S3-compatible storage that does not have STS (use `stsUavailable: true` in catalog storage configuration)
Review Comment:
@dennishuo : are you ok with this path forward? :slightly_smiling_face:
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2383591068
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java:
##########
@@ -98,6 +98,18 @@ public URI getInternalEndpointUri() {
/** Flag indicating whether path-style bucket access should be forced in S3 clients. */
public abstract @Nullable Boolean getPathStyleAccess();
+ /**
+ * Flag indicating whether STS is available or not. It is modeled in the negative to simplify
+ * support for unset values ({@code null} being interpreted as {@code false}).
Review Comment:
Ok, I removed `shouldUseSts()` from the config class. @flyrain : PTAL.
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2383219813
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsStorageConfigurationInfo.java:
##########
@@ -98,6 +98,18 @@ public URI getInternalEndpointUri() {
/** Flag indicating whether path-style bucket access should be forced in S3 clients. */
public abstract @Nullable Boolean getPathStyleAccess();
+ /**
+ * Flag indicating whether STS is available or not. It is modeled in the negative to simplify
+ * support for unset values ({@code null} being interpreted as {@code false}).
Review Comment:
```suggestion
* support for unset values ({@code null} being interpreted as {@code true}).
```
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2379001691
##########
CHANGELOG.md:
##########
@@ -40,6 +40,8 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
- Added a Management API endpoint to reset principal credentials, controlled by the `ENABLE_CREDENTIAL_RESET` (default: true) feature flag.
+- Added support for S3-compatible storage that does not have STS (use `stsUavailable: true` in catalog storage configuration)
Review Comment:
`SKIP_CREDENTIAL_SUBSCOPING_INDIRECTION=true` disables all storage config in API responses. Disabling STS only removes credentials.
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b merged PR #2672:
URL: https://github.com/apache/polaris/pull/2672
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support S3 storage that does not have STS [polaris]
Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on code in PR #2672:
URL: https://github.com/apache/polaris/pull/2672#discussion_r2388448759
##########
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java:
##########
@@ -79,43 +79,46 @@ public AccessConfig getSubscopedCreds(
int storageCredentialDurationSeconds =
realmConfig.getConfig(STORAGE_CREDENTIAL_DURATION_SECONDS);
AwsStorageConfigurationInfo storageConfig = config();
- AssumeRoleRequest.Builder request =
- AssumeRoleRequest.builder()
- .externalId(storageConfig.getExternalId())
- .roleArn(storageConfig.getRoleARN())
- .roleSessionName("PolarisAwsCredentialsStorageIntegration")
- .policy(
- policyString(
- storageConfig.getAwsPartition(),
- allowListOperation,
- allowedReadLocations,
- allowedWriteLocations)
- .toJson())
- .durationSeconds(storageCredentialDurationSeconds);
- credentialsProvider.ifPresent(
- cp -> request.overrideConfiguration(b -> b.credentialsProvider(cp)));
-
String region = storageConfig.getRegion();
- @SuppressWarnings("resource")
- // Note: stsClientProvider returns "thin" clients that do not need closing
- StsClient stsClient =
- stsClientProvider.stsClient(StsDestination.of(storageConfig.getStsEndpointUri(), region));
-
- AssumeRoleResponse response = stsClient.assumeRole(request.build());
AccessConfig.Builder accessConfig = AccessConfig.builder();
- accessConfig.put(StorageAccessProperty.AWS_KEY_ID, response.credentials().accessKeyId());
- accessConfig.put(
- StorageAccessProperty.AWS_SECRET_KEY, response.credentials().secretAccessKey());
- accessConfig.put(StorageAccessProperty.AWS_TOKEN, response.credentials().sessionToken());
- Optional.ofNullable(response.credentials().expiration())
- .ifPresent(
- i -> {
- accessConfig.put(
- StorageAccessProperty.EXPIRATION_TIME, String.valueOf(i.toEpochMilli()));
- accessConfig.put(
- StorageAccessProperty.AWS_SESSION_TOKEN_EXPIRES_AT_MS,
- String.valueOf(i.toEpochMilli()));
- });
+
+ if (storageConfig.shouldUseSts()) {
Review Comment:
I see, thanks for the explanation, I totally missed taking `FILE` into consideration ! IMHO its relatively easy to start with a stricter behaviour first and relax it later rather doing the other way as now there might be clients out there who would expect the behaviour to fail open and now expect 200, which we later plan to change to 400 anyways.
I would have appreciated to discussed this more !
--
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-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org