mansehajsingh commented on code in PR #8:
URL: https://github.com/apache/polaris-tools/pull/8#discussion_r2053119700


##########
polaris-synchronizer/api/src/main/java/org/apache/polaris/tools/sync/polaris/auth/AuthenticationSessionWrapper.java:
##########
@@ -0,0 +1,109 @@
+package org.apache.polaris.tools.sync.polaris.auth;
+
+import org.apache.iceberg.rest.HTTPClient;
+import org.apache.iceberg.rest.RESTClient;
+import org.apache.iceberg.rest.auth.AuthConfig;
+import org.apache.iceberg.rest.auth.OAuth2Properties;
+import org.apache.iceberg.rest.auth.OAuth2Util;
+import org.apache.iceberg.util.ThreadPools;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+/**
+ * Wraps {@link OAuth2Util.AuthSession} to provide supported authentication 
flows.
+ */
+public class AuthenticationSessionWrapper {
+
+    /**
+     * Order of token exchange preference copied over from {@link 
org.apache.iceberg.rest.RESTSessionCatalog}.
+     */
+    private static final Set<String> TOKEN_PREFERENCE_ORDER =
+            Set.of(
+                    OAuth2Properties.ID_TOKEN_TYPE,
+                    OAuth2Properties.ACCESS_TOKEN_TYPE,
+                    OAuth2Properties.JWT_TOKEN_TYPE,
+                    OAuth2Properties.SAML2_TOKEN_TYPE,
+                    OAuth2Properties.SAML1_TOKEN_TYPE);

Review Comment:
   Changed it to a `List`! Good catch



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to