-
Notifications
You must be signed in to change notification settings - Fork 387
Add a flag to allow disabling credential vending for external catalogs #395
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
Merged
collado-mike
merged 4 commits into
apache:main
from
collado-mike:mcollado-control-credentialvending-external
Oct 24, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
432b3a8
Add a flag to allow disabling credential vending for external catalogs
collado-mike 3bb4eb7
Update test to use assertj rather than try/catch
collado-mike 145bd88
Checked exception message in test assertion
collado-mike 57d1f3b
Merge branch 'main' into mcollado-control-credentialvending-external
RussellSpitzer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,6 +154,14 @@ public static <T> Builder<T> builder() { | |
| .defaultValue(false) | ||
| .build(); | ||
|
|
||
| public static final PolarisConfiguration<Boolean> ALLOW_EXTERNAL_CATALOG_CREDENTIAL_VENDING = | ||
| PolarisConfiguration.<Boolean>builder() | ||
| .key("ALLOW_EXTERNAL_CATALOG_CREDENTIAL_VENDING") | ||
| .catalogConfig("enable.credential.vending") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this name is not specific to external catalogs: |
||
| .description("If set to true, allow credential vending for external catalogs.") | ||
| .defaultValue(true) | ||
| .build(); | ||
|
|
||
| public static final PolarisConfiguration<List<String>> SUPPORTED_CATALOG_STORAGE_TYPES = | ||
| PolarisConfiguration.<List<String>>builder() | ||
| .key("SUPPORTED_CATALOG_STORAGE_TYPES") | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Since this is a catalog-level property, is there a need to make it specific to external catalogs?
I would prefer just
ALLOW_CREDENTIAL_VENDING. Admins could just choose to set this on only external catalogs.This would also extend nicely if we ever introduce overrides on the namespace or table level.
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 think admins should be allowed to control it for INTERNAL and/or EXTERNAL catalogs independently. For now, this change focuses on EXTERNAL catalogs, but I think a subsequent PR that allows for disabling for INTERNAL catalogs as well would be a good approach.
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.
Admins could do that by just setting the flag on either INTERNAL or EXTERNAL catalogs, couldn't they? I don't see a reason to make the parameter specific to one type or the other.
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.
Looks like the current code will support different keys for yaml-level system-wide settings, while using the same catalogConfig for per-catalog overrides, which does seem to achieve both goals.
I would agree that the yaml-level config is the main thing that needs to be configurable separately by whoever is running the Polaris service.
If we can verify that it won't cause any problems to have the same
catalogConfig("enable.credential.vending")for bothALLOW_EXTERNAL_CATALOG_CREDENTIAL_VENDINGandALLOW_INTERNAL_CATALOG_CREDENTIAL_VENDINGthen this seems like the best approach.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 would agree with @eric-maynard and @sfc-gh-dhuo . Ideally I would probably like to be able to set this on a per catalog basis but having blanket coverage is nice too. In the future I would like to have a more flexible way defining policies like this.
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'd also prefer a catalog property for this at this moment. We could consider policy-based one if there are solid use cases in the future.
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.
The current impl allows setting the default value for the service and allowing for catalog-level overrides. This is confirmed in the tests here and here. This allows admins to turn off credential vending by default, but to enable it on a case-by-case basis if they trust the external catalog or if the potential for credential overreach is not a security concern.