Skip to content

Add SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES feature configuration #1931

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
merged 5 commits into from
Jun 26, 2025

Conversation

poojanilangekar
Copy link
Contributor

@poojanilangekar poojanilangekar commented Jun 24, 2025

Based on the discussion in #1925, this PR adds a SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES feature configuration. For now, we only support OAUTH and BEARER. Eventually, we can enable SIGV4 and NONE.

Modified the validation code in the CreateCatalog service to verify that connection and authentication types are supported. Added a unit test for the same.

@poojanilangekar
Copy link
Contributor Author

CC @eric-maynard @dimas-b

Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Thanks, @poojanilangekar !

Changes LGTM with one minor comment.

@@ -112,6 +112,7 @@ polaris.features."ENFORCE_PRINCIPAL_CREDENTIAL_ROTATION_REQUIRED_CHECKING"=false
polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES"=["S3","GCS","AZURE"]
# polaris.features."ENABLE_CATALOG_FEDERATION"=true
polaris.features."SUPPORTED_CATALOG_CONNECTION_TYPES"=["ICEBERG_REST"]
polaris.features."SUPPORTED_FEDERATION_AUTHENTICATION_TYPES"=["OAUTH", "BEARER"]
Copy link
Contributor

Choose a reason for hiding this comment

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

why re-add the same value as the code-level default here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually followed the SUPPORTED_CATALOG_CONNECTION_TYPES here. Nonetheless, I've removed it.

Copy link
Contributor

Choose a reason for hiding this comment

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

In turn, I followed SUPPORTED_CATALOG_STORAGE_TYPES for SUPPORTED_CATALOG_CONNECTION_TYPES :)

I think the idea is to be uber-explicit about having a "safe" default everywhere by excluding the unsafe options. However for SUPPORTED_FEDERATION_AUTHENTICATION_TYPES there is currently no unsafe option. There may be in the future though (NONE?) so keeping it wouldn't be the worst thing in light of that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I've added it back in.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@eric-maynard
Copy link
Contributor

Maybe SUPPORTED_CATALOG_AUTHENTICATION_TYPES? So far we haven't introduced the term "FEDERATION" anywhere, including in the analogous config SUPPORTED_CATALOG_CONNECTION_TYPES

@poojanilangekar
Copy link
Contributor Author

@eric-maynard I think the name SUPPORTED_CATALOG_AUTHENTICATION_TYPES is ambiguous. Polaris itself is a catalog, so if we have a configuration called SUPPORTED_CATALOG_AUTHENTICATION_TYPES, a user might think of it as the authentication types supported by this catalog (Polaris) instance. The feature configuration is related to federation and I don't see anything wrong in making the name explicitly related to the feature.

I think the same goes for SUPPORTED_CATALOG_CONNECTION_TYPES.

If you are opposed to adding FEDERATION in the name, how about we name (and rename) to SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES and SUPPORTED_EXTERNAL_CATALOG_CONNECTION_TYPES respectively?

.getConfigurationStore()
.getConfiguration(
callContext.getRealmContext(),
FeatureConfiguration.SUPPORTED_FEDERATION_AUTHENTICATION_TYPES);
Copy link

@harishch1998 harishch1998 Jun 25, 2025

Choose a reason for hiding this comment

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

Do we need to handle uppercasing for this, similar to supportedConnectionTypes above? It might be redundant since those enums are uppercase anyway, so it's optional and upto you to make the change :p

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@eric-maynard
Copy link
Contributor

eric-maynard commented Jun 25, 2025

@poojanilangekar

If you are opposed to adding FEDERATION in the name, how about we name (and rename) to SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES and SUPPORTED_EXTERNAL_CATALOG_CONNECTION_TYPES respectively?

Oh, that's a great idea. If you are amenable, let's do ..._EXTERNAL_...

@poojanilangekar poojanilangekar changed the title Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration Add SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES feature configuration Jun 25, 2025
public static final FeatureConfiguration<List<String>>
SUPPORTED_EXTERNAL_CATALOG_CONNECTION_TYPES =
PolarisConfiguration.<List<String>>builder()
.key("SUPPORTED_EXTERNAL_CATALOG_CONNECTION_TYPES")
Copy link
Contributor

@dimas-b dimas-b Jun 26, 2025

Choose a reason for hiding this comment

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

The change of config key is technically a breaking change. I'm personally ok with this, but it has sem. ver. implications per out current policy: https://polaris.apache.org/in-dev/unreleased/evolution/

Ideally we should support the old name for a while, but I do not think we have a mechanism for that ATM.

That said, since this PR is mostly about adding SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES, it might be best to do the renaming in a separate PR (plus add backward compatibility).

@eric-maynard WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, I've removed it. I'll send out another PR and we can discuss options there.

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 okay with it too, but agreed that playing it safe is fine for now. We can always add support for multiple keys and then change this

eric-maynard
eric-maynard previously approved these changes Jun 26, 2025
@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Jun 26, 2025
dimas-b
dimas-b previously approved these changes Jun 26, 2025

@BeforeEach
void setUp() {
entityManagerFactory = Mockito.mock(RealmEntityManagerFactory.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need @Mock annotations above since we mock explicitly here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I have removed it.

@poojanilangekar poojanilangekar dismissed stale reviews from dimas-b and eric-maynard via 3db6ed8 June 26, 2025 18:39
@dimas-b dimas-b enabled auto-merge (squash) June 26, 2025 21:19
@dimas-b dimas-b merged commit 96b8be3 into apache:main Jun 26, 2025
11 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Jun 26, 2025
@poojanilangekar poojanilangekar deleted the supported-auths branch June 26, 2025 23:00
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.

4 participants