-
Notifications
You must be signed in to change notification settings - Fork 314
Always propagate non-credential properties from AccessConfig to clients #2615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@ParameterizedTest | ||
@ValueSource(booleans = {true, false}) | ||
public void testAppendFiles(boolean pathStyle) throws IOException { | ||
// TODO: @CsvSource("true,") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to uncomment 😄 🤦 - fixed
There was a problem hiding this 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 = |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 🙂
There was a problem hiding this comment.
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.
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(); | ||
} |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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
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
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
* 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
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 relevantcreate/load requests (previously it was called only when
vended-credentials
was requestedAlways sent
AccessConfig.extraProperties()
to clientsExpose credentials to clients only when the
vended-credentials
accessdelegation mode is requested.
There is not client-visible behaviour change for implementations of
PolarisStorageIntegration
that do not produce "extra"AccessConfig
properties.