Skip to content
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

Feature configuration to modify storage credential lifetime #408

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

eric-maynard
Copy link
Contributor

Description

If users want to extend/shorten the lifetime of vended storage credentials, we can support that with a PolarisConfiguration.

I didn't see a way to implement this for GcpStorageIntegration, so that is notably missing from this PR for now.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@eric-maynard eric-maynard marked this pull request as draft October 29, 2024 16:36
@eric-maynard eric-maynard marked this pull request as ready for review October 30, 2024 20:26
@flyrain flyrain added this to the 1.0.0 milestone Dec 20, 2024
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.

LGTM with minor suggestions.

* Returns the value of a `PolarisConfiguration`, or the default if it cannot be loaded. This
* method does not need to be used when a `CallContext` is already available
*/
public static <T> T loadConfig(PolarisConfiguration<T> configuration) {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 on this method. There are a lot of other places can reuse this as well, like here https://github.com/polaris-catalog/polaris/blob/main/polaris-service/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java#L1029-L1029. We can consolidate them in a followup PR.

Comment on lines +74 to +76
.durationSeconds(
PolarisConfiguration.loadConfig(
PolarisConfiguration.STORAGE_CREDENTIAL_DURATION_SECONDS))
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor suggestion: we could keep them in one line like the following if we import the static field/method.

.durationSeconds(loadConfig(STORAGE_CREDENTIAL_DURATION_SECONDS))

Comment on lines +230 to +232
.description(
"The duration of time that vended storage credentials are valid for. Support for"
+ " longer (or shorter) durations is dependent on the storage provider.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor suggestion: adding a comment that GCS isn't supported yet?

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.

3 participants