-
Notifications
You must be signed in to change notification settings - Fork 348
Initial MVP implementation of Catalog Federation to remote Iceberg REST Catalogs #1305
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
eric-maynard
merged 20 commits into
apache:main
from
dennishuo:dhuo-catalog-federation-mvp-clean
Apr 18, 2025
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
16d33fd
Initial prototype of catalog federation just passing special properti…
dennishuo 3b1aa16
Defined internal representation classes for connection config
XJDKC 1d1650b
Construct and initialize federated iceberg catalog based on connectio…
XJDKC 205ef1e
Apply the same spec renames to the internal ConnectionConfiguration r…
dennishuo c8484e0
Manually pick @XJDKC fixes for integration tests and omittign secrets…
dennishuo acb5bec
Fix internal connection structs with updated naming from spec PR
dennishuo 300553f
Push CreateCatalogRequest down to PolarisAdminService::createCatalog …
dennishuo 4ad235e
Add new interface UserSecretsManager along with a default implementation
dennishuo cc17ae5
Wire in UserSecretsManager to createCatalog and federated Iceberg API…
dennishuo 6700fb2
Since we already use commons-codec DigestUtils.sha256Hex, use that fo…
dennishuo 10b2966
Rename the persistence-objects corresponding to API model objects wit…
dennishuo fd7ae59
Use UserSecretsManagerFactory to Produce the UserSecretsManager (#1)
XJDKC cbe362d
Gate all federation logic behind a new FeatureConfiguration - ENABLE_…
dennishuo 3e85244
Also rename some variables and method names to be consistent with pri…
dennishuo 9be6ee3
Merge branch 'main' of github.com:dennishuo/polaris into dhuo-catalog…
dennishuo 7d5c9e1
Merge branch 'main' of github.com:dennishuo/polaris into dhuo-catalog…
dennishuo 31a7333
Merge branch 'main' of github.com:dennishuo/polaris into dhuo-catalog…
dennishuo 03af9f5
Change ConnectionType and AuthenticationType to be stored as int code…
dennishuo 544ce82
Add javadoc comment to IcebergCatalogPropertiesProvider
dennishuo beaa34e
Add some constraints on the expected format of the URN in UserSecretR…
dennishuo 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
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 |
|---|---|---|
|
|
@@ -18,8 +18,10 @@ | |
| */ | ||
| package org.apache.polaris.core.secrets; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonIgnore; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.google.common.base.MoreObjects; | ||
| import com.google.common.base.Preconditions; | ||
| import jakarta.annotation.Nonnull; | ||
| import jakarta.annotation.Nullable; | ||
| import java.util.HashMap; | ||
|
|
@@ -56,7 +58,10 @@ public class UserSecretReference { | |
|
|
||
| /** | ||
| * @param urn A string which should be self-sufficient to retrieve whatever secret material that | ||
| * is stored in the remote secret store. | ||
| * is stored in the remote secret store and also to identify an implementation of the | ||
| * UserSecretsManager which is capable of interpreting this concrete UserSecretReference. | ||
| * Should be of the form: | ||
| * 'urn:polaris-secret:<secret-manager-type>:<type-specific-identifier> | ||
| * @param referencePayload Optionally, any additional information that is necessary to fully | ||
| * reconstitute the original secret based on what is retrieved by the {@code urn}; this | ||
| * payload may include hashes/checksums, encryption key ids, OTP encryption keys, additional | ||
|
|
@@ -65,10 +70,28 @@ public class UserSecretReference { | |
| public UserSecretReference( | ||
| @JsonProperty(value = "urn", required = true) @Nonnull String urn, | ||
| @JsonProperty(value = "referencePayload") @Nullable Map<String, String> referencePayload) { | ||
| // TODO: Add better/standardized parsing and validation of URN syntax | ||
| Preconditions.checkArgument( | ||
| urn.startsWith("urn:polaris-secret:") && urn.split(":").length >= 4, | ||
| "Invalid secret URN '%s'; must be of the form " | ||
| + "'urn:polaris-secret:<secret-manager-type>:<type-specific-identifier>'", | ||
| urn); | ||
|
Comment on lines
+73
to
+78
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. 👍 |
||
| this.urn = urn; | ||
| this.referencePayload = Objects.requireNonNullElse(referencePayload, new HashMap<>()); | ||
| } | ||
|
|
||
| /** | ||
| * Since UserSecretReference objects are specific to UserSecretManager implementations, the | ||
| * "secret-manager-type" portion of the URN should be used to validate that a URN is valid for a | ||
| * given implementation and to dispatch to the correct implementation at runtime if multiple | ||
| * concurrent implementations are possible in a given runtime environment. | ||
| */ | ||
| @JsonIgnore | ||
| public String getUserSecretManagerTypeFromUrn() { | ||
| // TODO: Add better/standardized parsing and validation of URN syntax | ||
|
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. My understanding is the format won't change, but we will just make the parsing / validation more structured -- that's cool with me |
||
| return urn.split(":")[2]; | ||
| } | ||
|
|
||
| public @Nonnull String getUrn() { | ||
| return urn; | ||
| } | ||
|
|
||
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.
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.
👍