plusplusjiajia commented on code in PR #2838:
URL: https://github.com/apache/iceberg-rust/pull/2838#discussion_r3688360445


##########
crates/catalog/rest/src/catalog.rs:
##########
@@ -341,6 +309,32 @@ impl RestCatalogConfig {
             .unwrap_or(false)
     }
 
+    /// The configured auth scheme: explicit `rest.auth.type` or the default
+    /// `oauth2` (which behaves as no auth when neither `token` nor
+    /// `credential` is set).
+    fn auth_type(&self) -> String {
+        self.props
+            .get(REST_CATALOG_PROP_AUTH_TYPE)
+            .cloned()
+            .unwrap_or_else(|| AUTH_TYPE_OAUTH2.to_string())

Review Comment:
   @CTTY Fair point — and digging into Java, this is exactly what 
AuthManagers.loadAuthManager does: default none, but infer oauth2 when a legacy 
token/credential is present, with a warning asking users to set rest.auth.type 
explicitly. The latest push mirrors both the inference and the warning. One 
deliberate delta: I also treat an explicit oauth2-server-uri as OAuth intent 
(Java only checks token/credential) — happy to drop that for strict parity if 
you prefer, 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: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to