You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "poojanilangekar (via GitHub)" <gi...@apache.org> on 2025/06/24 21:57:17 UTC

[PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

poojanilangekar opened a new pull request, #1931:
URL: https://github.com/apache/polaris/pull/1931

   Based on the discussion in #1925, this PR adds a SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration.
   
   I prefer the name SUPPORTED_FEDERATION_AUTHENTICATION_TYPES over SUPPORTED_CATALOG_AUTHENTICATION_TYPES because catalog in this context can be ambiguous. However, if others feel strongly, I can change it to SUPPORTED_CATALOG_AUTHENTICATION_TYPES to make it consistent with SUPPORTED_CATALOG_CONNECTION_TYPES. 
   
   For now, we only support OAUTH and BEARER. Eventually, we can enable SIGV4 and NONE. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167950470


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -254,12 +255,24 @@ public static void enforceFeatureEnabledOrThrow(
           .defaultValue(true)
           .buildFeatureConfiguration();
 
-  public static final FeatureConfiguration<List<String>> SUPPORTED_CATALOG_CONNECTION_TYPES =
-      PolarisConfiguration.<List<String>>builder()
-          .key("SUPPORTED_CATALOG_CONNECTION_TYPES")
-          .description("The list of supported catalog connection types for federation")
-          .defaultValue(List.of(ConnectionType.ICEBERG_REST.name()))
-          .buildFeatureConfiguration();
+  public static final FeatureConfiguration<List<String>>
+      SUPPORTED_EXTERNAL_CATALOG_CONNECTION_TYPES =
+          PolarisConfiguration.<List<String>>builder()
+              .key("SUPPORTED_EXTERNAL_CATALOG_CONNECTION_TYPES")

Review Comment:
   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 the rename in a separate PR (plus add backward compatibility).
   
   @eric-maynard WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2165207097


##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -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"]

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "harishch1998 (via GitHub)" <gi...@apache.org>.
harishch1998 commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167389098


##########
service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java:
##########
@@ -169,30 +171,51 @@ private void validateStorageConfig(StorageConfigInfo storageConfigInfo) {
     }
   }
 
-  private void validateConnectionConfigInfo(Catalog catalog) {
+  private void validateExternalCatalog(Catalog catalog) {
     if (catalog.getType() == Catalog.TypeEnum.EXTERNAL) {
       if (catalog instanceof ExternalCatalog externalCatalog) {
-        if (externalCatalog.getConnectionConfigInfo() != null) {
-          String connectionType =
-              externalCatalog.getConnectionConfigInfo().getConnectionType().name();
-          List<String> supportedConnectionTypes =
-              callContext
-                  .getPolarisCallContext()
-                  .getConfigurationStore()
-                  .getConfiguration(
-                      callContext.getRealmContext(),
-                      FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
-                  .stream()
-                  .map(s -> s.toUpperCase(Locale.ROOT))
-                  .toList();
-          if (!supportedConnectionTypes.contains(connectionType)) {
-            throw new IllegalStateException("Unsupported connection type: " + connectionType);
-          }
+        ConnectionConfigInfo connectionConfigInfo = externalCatalog.getConnectionConfigInfo();
+        if (connectionConfigInfo != null) {
+          validateConnectionConfigInfo(connectionConfigInfo);
+          validateAuthenticationParameters(connectionConfigInfo.getAuthenticationParameters());
         }
       }
     }
   }
 
+  private void validateConnectionConfigInfo(ConnectionConfigInfo connectionConfigInfo) {
+
+    String connectionType = connectionConfigInfo.getConnectionType().name();
+    List<String> supportedConnectionTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
+            .stream()
+            .map(s -> s.toUpperCase(Locale.ROOT))
+            .toList();
+    if (!supportedConnectionTypes.contains(connectionType)) {
+      throw new IllegalStateException("Unsupported connection type: " + connectionType);
+    }
+  }
+
+  private void validateAuthenticationParameters(AuthenticationParameters authenticationParameters) {
+
+    String authenticationType = authenticationParameters.getAuthenticationType().name();
+    List<String> supportedAuthenticationTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_FEDERATION_AUTHENTICATION_TYPES);

Review Comment:
   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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "poojanilangekar (via GitHub)" <gi...@apache.org>.
poojanilangekar commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167532081


##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -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"]

Review Comment:
   Makes sense, I've added it back in. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on PR #1931:
URL: https://github.com/apache/polaris/pull/1931#issuecomment-3002932744

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167950470


##########
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java:
##########
@@ -254,12 +255,24 @@ public static void enforceFeatureEnabledOrThrow(
           .defaultValue(true)
           .buildFeatureConfiguration();
 
-  public static final FeatureConfiguration<List<String>> SUPPORTED_CATALOG_CONNECTION_TYPES =
-      PolarisConfiguration.<List<String>>builder()
-          .key("SUPPORTED_CATALOG_CONNECTION_TYPES")
-          .description("The list of supported catalog connection types for federation")
-          .defaultValue(List.of(ConnectionType.ICEBERG_REST.name()))
-          .buildFeatureConfiguration();
+  public static final FeatureConfiguration<List<String>>
+      SUPPORTED_EXTERNAL_CATALOG_CONNECTION_TYPES =
+          PolarisConfiguration.<List<String>>builder()
+              .key("SUPPORTED_EXTERNAL_CATALOG_CONNECTION_TYPES")

Review Comment:
   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?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "poojanilangekar (via GitHub)" <gi...@apache.org>.
poojanilangekar commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167325998


##########
service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java:
##########
@@ -169,30 +171,51 @@ private void validateStorageConfig(StorageConfigInfo storageConfigInfo) {
     }
   }
 
-  private void validateConnectionConfigInfo(Catalog catalog) {
+  private void validateExternalCatalog(Catalog catalog) {
     if (catalog.getType() == Catalog.TypeEnum.EXTERNAL) {
       if (catalog instanceof ExternalCatalog externalCatalog) {
-        if (externalCatalog.getConnectionConfigInfo() != null) {
-          String connectionType =
-              externalCatalog.getConnectionConfigInfo().getConnectionType().name();
-          List<String> supportedConnectionTypes =
-              callContext
-                  .getPolarisCallContext()
-                  .getConfigurationStore()
-                  .getConfiguration(
-                      callContext.getRealmContext(),
-                      FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
-                  .stream()
-                  .map(s -> s.toUpperCase(Locale.ROOT))
-                  .toList();
-          if (!supportedConnectionTypes.contains(connectionType)) {
-            throw new IllegalStateException("Unsupported connection type: " + connectionType);
-          }
+        ConnectionConfigInfo connectionConfigInfo = externalCatalog.getConnectionConfigInfo();
+        if (connectionConfigInfo != null) {
+          validateConnectionConfigInfo(connectionConfigInfo);
+          validateAuthenticationParameters(connectionConfigInfo.getAuthenticationParameters());
         }
       }
     }
   }
 
+  private void validateConnectionConfigInfo(ConnectionConfigInfo connectionConfigInfo) {
+
+    String connectionType = connectionConfigInfo.getConnectionType().name();
+    List<String> supportedConnectionTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
+            .stream()
+            .map(s -> s.toUpperCase(Locale.ROOT))
+            .toList();
+    if (!supportedConnectionTypes.contains(connectionType)) {
+      throw new IllegalStateException("Unsupported connection type: " + connectionType);
+    }
+  }
+
+  private void validateAuthenticationParameters(AuthenticationParameters authenticationParameters) {
+
+    String authenticationType = authenticationParameters.getAuthenticationType().name();
+    List<String> supportedAuthenticationTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_FEDERATION_AUTHENTICATION_TYPES);
+    if (!supportedAuthenticationTypes.contains(authenticationType)) {
+      throw new IllegalStateException("Unsupported authentication type: " + authenticationType);

Review Comment:
   Done. Since there were no existiing tests for the PolarisServiceImpl, I added some setup code to mock the service/context needed by the PolarisServiceImpl; this is not necessary for the test but used by the service. Let me know if you have suggestions to avoid it. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "harishch1998 (via GitHub)" <gi...@apache.org>.
harishch1998 commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167389098


##########
service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java:
##########
@@ -169,30 +171,51 @@ private void validateStorageConfig(StorageConfigInfo storageConfigInfo) {
     }
   }
 
-  private void validateConnectionConfigInfo(Catalog catalog) {
+  private void validateExternalCatalog(Catalog catalog) {
     if (catalog.getType() == Catalog.TypeEnum.EXTERNAL) {
       if (catalog instanceof ExternalCatalog externalCatalog) {
-        if (externalCatalog.getConnectionConfigInfo() != null) {
-          String connectionType =
-              externalCatalog.getConnectionConfigInfo().getConnectionType().name();
-          List<String> supportedConnectionTypes =
-              callContext
-                  .getPolarisCallContext()
-                  .getConfigurationStore()
-                  .getConfiguration(
-                      callContext.getRealmContext(),
-                      FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
-                  .stream()
-                  .map(s -> s.toUpperCase(Locale.ROOT))
-                  .toList();
-          if (!supportedConnectionTypes.contains(connectionType)) {
-            throw new IllegalStateException("Unsupported connection type: " + connectionType);
-          }
+        ConnectionConfigInfo connectionConfigInfo = externalCatalog.getConnectionConfigInfo();
+        if (connectionConfigInfo != null) {
+          validateConnectionConfigInfo(connectionConfigInfo);
+          validateAuthenticationParameters(connectionConfigInfo.getAuthenticationParameters());
         }
       }
     }
   }
 
+  private void validateConnectionConfigInfo(ConnectionConfigInfo connectionConfigInfo) {
+
+    String connectionType = connectionConfigInfo.getConnectionType().name();
+    List<String> supportedConnectionTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
+            .stream()
+            .map(s -> s.toUpperCase(Locale.ROOT))
+            .toList();
+    if (!supportedConnectionTypes.contains(connectionType)) {
+      throw new IllegalStateException("Unsupported connection type: " + connectionType);
+    }
+  }
+
+  private void validateAuthenticationParameters(AuthenticationParameters authenticationParameters) {
+
+    String authenticationType = authenticationParameters.getAuthenticationType().name();
+    List<String> supportedAuthenticationTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_FEDERATION_AUTHENTICATION_TYPES);

Review Comment:
   Do we need to handle uppercasing for this, similar to `supportedConnectionTypes` above? It might be redundant since those enums are uppercase anyway, so this is optional



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "harishch1998 (via GitHub)" <gi...@apache.org>.
harishch1998 commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167389098


##########
service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java:
##########
@@ -169,30 +171,51 @@ private void validateStorageConfig(StorageConfigInfo storageConfigInfo) {
     }
   }
 
-  private void validateConnectionConfigInfo(Catalog catalog) {
+  private void validateExternalCatalog(Catalog catalog) {
     if (catalog.getType() == Catalog.TypeEnum.EXTERNAL) {
       if (catalog instanceof ExternalCatalog externalCatalog) {
-        if (externalCatalog.getConnectionConfigInfo() != null) {
-          String connectionType =
-              externalCatalog.getConnectionConfigInfo().getConnectionType().name();
-          List<String> supportedConnectionTypes =
-              callContext
-                  .getPolarisCallContext()
-                  .getConfigurationStore()
-                  .getConfiguration(
-                      callContext.getRealmContext(),
-                      FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
-                  .stream()
-                  .map(s -> s.toUpperCase(Locale.ROOT))
-                  .toList();
-          if (!supportedConnectionTypes.contains(connectionType)) {
-            throw new IllegalStateException("Unsupported connection type: " + connectionType);
-          }
+        ConnectionConfigInfo connectionConfigInfo = externalCatalog.getConnectionConfigInfo();
+        if (connectionConfigInfo != null) {
+          validateConnectionConfigInfo(connectionConfigInfo);
+          validateAuthenticationParameters(connectionConfigInfo.getAuthenticationParameters());
         }
       }
     }
   }
 
+  private void validateConnectionConfigInfo(ConnectionConfigInfo connectionConfigInfo) {
+
+    String connectionType = connectionConfigInfo.getConnectionType().name();
+    List<String> supportedConnectionTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
+            .stream()
+            .map(s -> s.toUpperCase(Locale.ROOT))
+            .toList();
+    if (!supportedConnectionTypes.contains(connectionType)) {
+      throw new IllegalStateException("Unsupported connection type: " + connectionType);
+    }
+  }
+
+  private void validateAuthenticationParameters(AuthenticationParameters authenticationParameters) {
+
+    String authenticationType = authenticationParameters.getAuthenticationType().name();
+    List<String> supportedAuthenticationTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_FEDERATION_AUTHENTICATION_TYPES);

Review Comment:
   Do we need to handle uppercasing for this, similar to `supportedConnectionTypes` above?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "poojanilangekar (via GitHub)" <gi...@apache.org>.
poojanilangekar commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167531576


##########
service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java:
##########
@@ -169,30 +171,51 @@ private void validateStorageConfig(StorageConfigInfo storageConfigInfo) {
     }
   }
 
-  private void validateConnectionConfigInfo(Catalog catalog) {
+  private void validateExternalCatalog(Catalog catalog) {
     if (catalog.getType() == Catalog.TypeEnum.EXTERNAL) {
       if (catalog instanceof ExternalCatalog externalCatalog) {
-        if (externalCatalog.getConnectionConfigInfo() != null) {
-          String connectionType =
-              externalCatalog.getConnectionConfigInfo().getConnectionType().name();
-          List<String> supportedConnectionTypes =
-              callContext
-                  .getPolarisCallContext()
-                  .getConfigurationStore()
-                  .getConfiguration(
-                      callContext.getRealmContext(),
-                      FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
-                  .stream()
-                  .map(s -> s.toUpperCase(Locale.ROOT))
-                  .toList();
-          if (!supportedConnectionTypes.contains(connectionType)) {
-            throw new IllegalStateException("Unsupported connection type: " + connectionType);
-          }
+        ConnectionConfigInfo connectionConfigInfo = externalCatalog.getConnectionConfigInfo();
+        if (connectionConfigInfo != null) {
+          validateConnectionConfigInfo(connectionConfigInfo);
+          validateAuthenticationParameters(connectionConfigInfo.getAuthenticationParameters());
         }
       }
     }
   }
 
+  private void validateConnectionConfigInfo(ConnectionConfigInfo connectionConfigInfo) {
+
+    String connectionType = connectionConfigInfo.getConnectionType().name();
+    List<String> supportedConnectionTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
+            .stream()
+            .map(s -> s.toUpperCase(Locale.ROOT))
+            .toList();
+    if (!supportedConnectionTypes.contains(connectionType)) {
+      throw new IllegalStateException("Unsupported connection type: " + connectionType);
+    }
+  }
+
+  private void validateAuthenticationParameters(AuthenticationParameters authenticationParameters) {
+
+    String authenticationType = authenticationParameters.getAuthenticationType().name();
+    List<String> supportedAuthenticationTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_FEDERATION_AUTHENTICATION_TYPES);

Review Comment:
   Done. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "harishch1998 (via GitHub)" <gi...@apache.org>.
harishch1998 commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167389098


##########
service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java:
##########
@@ -169,30 +171,51 @@ private void validateStorageConfig(StorageConfigInfo storageConfigInfo) {
     }
   }
 
-  private void validateConnectionConfigInfo(Catalog catalog) {
+  private void validateExternalCatalog(Catalog catalog) {
     if (catalog.getType() == Catalog.TypeEnum.EXTERNAL) {
       if (catalog instanceof ExternalCatalog externalCatalog) {
-        if (externalCatalog.getConnectionConfigInfo() != null) {
-          String connectionType =
-              externalCatalog.getConnectionConfigInfo().getConnectionType().name();
-          List<String> supportedConnectionTypes =
-              callContext
-                  .getPolarisCallContext()
-                  .getConfigurationStore()
-                  .getConfiguration(
-                      callContext.getRealmContext(),
-                      FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
-                  .stream()
-                  .map(s -> s.toUpperCase(Locale.ROOT))
-                  .toList();
-          if (!supportedConnectionTypes.contains(connectionType)) {
-            throw new IllegalStateException("Unsupported connection type: " + connectionType);
-          }
+        ConnectionConfigInfo connectionConfigInfo = externalCatalog.getConnectionConfigInfo();
+        if (connectionConfigInfo != null) {
+          validateConnectionConfigInfo(connectionConfigInfo);
+          validateAuthenticationParameters(connectionConfigInfo.getAuthenticationParameters());
         }
       }
     }
   }
 
+  private void validateConnectionConfigInfo(ConnectionConfigInfo connectionConfigInfo) {
+
+    String connectionType = connectionConfigInfo.getConnectionType().name();
+    List<String> supportedConnectionTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
+            .stream()
+            .map(s -> s.toUpperCase(Locale.ROOT))
+            .toList();
+    if (!supportedConnectionTypes.contains(connectionType)) {
+      throw new IllegalStateException("Unsupported connection type: " + connectionType);
+    }
+  }
+
+  private void validateAuthenticationParameters(AuthenticationParameters authenticationParameters) {
+
+    String authenticationType = authenticationParameters.getAuthenticationType().name();
+    List<String> supportedAuthenticationTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_FEDERATION_AUTHENTICATION_TYPES);

Review Comment:
   Do we need to handle uppercase for this, similar to `supportedConnectionTypes` above?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "poojanilangekar (via GitHub)" <gi...@apache.org>.
poojanilangekar commented on PR #1931:
URL: https://github.com/apache/polaris/pull/1931#issuecomment-3005729198

   @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?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167953719


##########
service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java:
##########
@@ -169,30 +171,51 @@ private void validateStorageConfig(StorageConfigInfo storageConfigInfo) {
     }
   }
 
-  private void validateConnectionConfigInfo(Catalog catalog) {
+  private void validateExternalCatalog(Catalog catalog) {
     if (catalog.getType() == Catalog.TypeEnum.EXTERNAL) {
       if (catalog instanceof ExternalCatalog externalCatalog) {
-        if (externalCatalog.getConnectionConfigInfo() != null) {
-          String connectionType =
-              externalCatalog.getConnectionConfigInfo().getConnectionType().name();
-          List<String> supportedConnectionTypes =
-              callContext
-                  .getPolarisCallContext()
-                  .getConfigurationStore()
-                  .getConfiguration(
-                      callContext.getRealmContext(),
-                      FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
-                  .stream()
-                  .map(s -> s.toUpperCase(Locale.ROOT))
-                  .toList();
-          if (!supportedConnectionTypes.contains(connectionType)) {
-            throw new IllegalStateException("Unsupported connection type: " + connectionType);
-          }
+        ConnectionConfigInfo connectionConfigInfo = externalCatalog.getConnectionConfigInfo();
+        if (connectionConfigInfo != null) {
+          validateConnectionConfigInfo(connectionConfigInfo);
+          validateAuthenticationParameters(connectionConfigInfo.getAuthenticationParameters());
         }
       }
     }
   }
 
+  private void validateConnectionConfigInfo(ConnectionConfigInfo connectionConfigInfo) {
+
+    String connectionType = connectionConfigInfo.getConnectionType().name();
+    List<String> supportedConnectionTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
+            .stream()
+            .map(s -> s.toUpperCase(Locale.ROOT))
+            .toList();
+    if (!supportedConnectionTypes.contains(connectionType)) {
+      throw new IllegalStateException("Unsupported connection type: " + connectionType);
+    }
+  }
+
+  private void validateAuthenticationParameters(AuthenticationParameters authenticationParameters) {
+
+    String authenticationType = authenticationParameters.getAuthenticationType().name();
+    List<String> supportedAuthenticationTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_FEDERATION_AUTHENTICATION_TYPES);
+    if (!supportedAuthenticationTypes.contains(authenticationType)) {
+      throw new IllegalStateException("Unsupported authentication type: " + authenticationType);

Review Comment:
   @poojanilangekar : I'm not sure I understand your message completely :sweat_smile: Current test code LGTM, but if you think that some code can be removed without compromising tests' validity, I'd support that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_EXTERNAL_CATALOG_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167946232


##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -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"]

Review Comment:
   ok



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "poojanilangekar (via GitHub)" <gi...@apache.org>.
poojanilangekar commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167326866


##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -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"]

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on PR #1931:
URL: https://github.com/apache/polaris/pull/1931#issuecomment-3005845034

   > 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_...`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2165210693


##########
service/common/src/main/java/org/apache/polaris/service/admin/PolarisServiceImpl.java:
##########
@@ -169,30 +171,51 @@ private void validateStorageConfig(StorageConfigInfo storageConfigInfo) {
     }
   }
 
-  private void validateConnectionConfigInfo(Catalog catalog) {
+  private void validateExternalCatalog(Catalog catalog) {
     if (catalog.getType() == Catalog.TypeEnum.EXTERNAL) {
       if (catalog instanceof ExternalCatalog externalCatalog) {
-        if (externalCatalog.getConnectionConfigInfo() != null) {
-          String connectionType =
-              externalCatalog.getConnectionConfigInfo().getConnectionType().name();
-          List<String> supportedConnectionTypes =
-              callContext
-                  .getPolarisCallContext()
-                  .getConfigurationStore()
-                  .getConfiguration(
-                      callContext.getRealmContext(),
-                      FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
-                  .stream()
-                  .map(s -> s.toUpperCase(Locale.ROOT))
-                  .toList();
-          if (!supportedConnectionTypes.contains(connectionType)) {
-            throw new IllegalStateException("Unsupported connection type: " + connectionType);
-          }
+        ConnectionConfigInfo connectionConfigInfo = externalCatalog.getConnectionConfigInfo();
+        if (connectionConfigInfo != null) {
+          validateConnectionConfigInfo(connectionConfigInfo);
+          validateAuthenticationParameters(connectionConfigInfo.getAuthenticationParameters());
         }
       }
     }
   }
 
+  private void validateConnectionConfigInfo(ConnectionConfigInfo connectionConfigInfo) {
+
+    String connectionType = connectionConfigInfo.getConnectionType().name();
+    List<String> supportedConnectionTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_CATALOG_CONNECTION_TYPES)
+            .stream()
+            .map(s -> s.toUpperCase(Locale.ROOT))
+            .toList();
+    if (!supportedConnectionTypes.contains(connectionType)) {
+      throw new IllegalStateException("Unsupported connection type: " + connectionType);
+    }
+  }
+
+  private void validateAuthenticationParameters(AuthenticationParameters authenticationParameters) {
+
+    String authenticationType = authenticationParameters.getAuthenticationType().name();
+    List<String> supportedAuthenticationTypes =
+        callContext
+            .getPolarisCallContext()
+            .getConfigurationStore()
+            .getConfiguration(
+                callContext.getRealmContext(),
+                FeatureConfiguration.SUPPORTED_FEDERATION_AUTHENTICATION_TYPES);
+    if (!supportedAuthenticationTypes.contains(authenticationType)) {
+      throw new IllegalStateException("Unsupported authentication type: " + authenticationType);

Review Comment:
   Could you add a unit test for this, please?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "poojanilangekar (via GitHub)" <gi...@apache.org>.
poojanilangekar commented on PR #1931:
URL: https://github.com/apache/polaris/pull/1931#issuecomment-3002001220

   CC @eric-maynard @dimas-b 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add SUPPORTED_FEDERATION_AUTHENTICATION_TYPES feature configuration [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #1931:
URL: https://github.com/apache/polaris/pull/1931#discussion_r2167334496


##########
runtime/defaults/src/main/resources/application.properties:
##########
@@ -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"]

Review Comment:
   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.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org