Skip to content

Conversation

dimas-b
Copy link
Contributor

@dimas-b dimas-b commented Sep 18, 2025

This change builds on top of #2589 and further prepares Polaris code to
support non-STS S3 implementations for #2207.

For S3 implementations that do have STS, this change enables clients to
run with local credentials (no credential vending) and still receive
endpoint configuration from the catalog.

  • Call SupportsCredentialDelegation.getAccessConfig() on all relevant
    create/load requests (previously it was called only when
    vended-credentials was requested

  • Always sent AccessConfig.extraProperties() to clients

  • Expose credentials to clients only when the vended-credentials access
    delegation mode is requested.

  • There is not client-visible behaviour change for implementations of
    PolarisStorageIntegration that do not produce "extra" AccessConfig
    properties.

@github-project-automation github-project-automation bot moved this to PRs In Progress in Basic Kanban Board Sep 18, 2025
@dimas-b dimas-b changed the title Non sts s3 Always propagate non-credential properties from AccessConfig to clients Sep 18, 2025
@dimas-b dimas-b marked this pull request as ready for review September 19, 2025 15:16
@ParameterizedTest
@ValueSource(booleans = {true, false})
public void testAppendFiles(boolean pathStyle) throws IOException {
// TODO: @CsvSource("true,")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the issue with these test cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to uncomment 😄 🤦 - fixed

Copy link
Contributor

@flyrain flyrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @dimas-b ! LGTM overall! Left minor comments.

EnumSet<AccessDelegationMode> delegationModes,
Set<PolarisStorageActions> actions,
Optional<String> refreshCredentialsEndpoint) {
LoadTableResponse.Builder responseBuilder =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit clutter that this method return a builder, so that caller need to invoke build(). The code would be cleaner if it returns a LoadTableResponse. Not a blocker though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe 🤔 but this PR merely changes the impl. of this method. I did not mean to refactor related code to minimize the amount of changes. It's a private method, we can adjust it any time if current return type become a nuisance 🙂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with a followup, as it's not introduced by this PR.

Comment on lines 298 to 309
if (dm.map(VENDED_CREDENTIALS::equals).orElse(false)) {
assertThat(loadTableResponse.config())
.containsEntry(
REFRESH_CREDENTIALS_ENDPOINT,
"v1/" + catalogName + "/namespaces/test-ns/tables/t1/credentials");
assertThat(loadTableResponse.credentials()).hasSize(1);
} else {
assertThat(loadTableResponse.config()).doesNotContainKey(SECRET_ACCESS_KEY);
assertThat(loadTableResponse.config()).doesNotContainKey(ACCESS_KEY_ID);
assertThat(loadTableResponse.config()).doesNotContainKey(REFRESH_CREDENTIALS_ENDPOINT);
assertThat(loadTableResponse.credentials()).isEmpty();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the validation logic to the caller(line 238)? I think it makes more sense to validate them, as the AccessDelegationMode is one of the test parameter.
Also I think we need to validate the ENDPOINT in case AccessDelegationMode is VENDED_CREDENTIALS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Endpoint is validated on line 296

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved credential asserts to top-level test methods 👍

This change builds on top of apache#2589 and further prepares Polaris code to
support non-STS S3 implementations for apache#2589.

For S3 implementations that do have STS, this change enables clients to
run with local credentials (no credential vending) and still receive
endpoint configuration from the catalog.

* Call `SupportsCredentialDelegation.getAccessConfig()` on all relevant
  create/load requests (previously it was called only when
  `vended-credentials` was requested

* Always sent `AccessConfig.extraProperties()` to clients

* Expose credentials to clients only when the `vended-credentials` access
  delegation mode is requested.

* There is not client-visible behaviour change for implementations of
  `PolarisStorageIntegration` that do not produce "extra" `AccessConfig`
  properties.
@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Sep 22, 2025
@dimas-b dimas-b merged commit 5ca3fdc into apache:main Sep 22, 2025
14 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Sep 22, 2025
@dimas-b dimas-b deleted the non-sts-s3 branch September 22, 2025 17:54
dimas-b added a commit to dimas-b/polaris that referenced this pull request Sep 25, 2025
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`

Relates to apache#2615
Closes apache#2207
dimas-b added a commit to dimas-b/polaris that referenced this pull request Sep 25, 2025
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`

Relates to apache#2615
Closes apache#2207
dimas-b added a commit to dimas-b/polaris that referenced this pull request Sep 26, 2025
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`

Relates to apache#2615
Closes apache#2207
dimas-b added a commit that referenced this pull request Sep 29, 2025
* Support S3 storage that does not have STS

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`

Relates to #2615
Relates #2207
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants