DerGut commented on code in PR #2838:
URL: https://github.com/apache/iceberg-rust/pull/2838#discussion_r3647865257
##########
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:
Just flagging that this diverges from Java's default to `none`.
Even though the `OAuth2Manager` behaves similarly without a token, it
doesn't match the `NoopAuthManager`'s behavior exactly. For example:
- a configured `NoopAuthManager` on client initialization will always noop -
an `OAuth2Manager` can start authenticating if the `/v1/config` endpoint
returns a token in the properties (this is arguably the better default behavior)
- a call to `NoopSession::refresh()` will always succeed but a call on
`OAuth2Session::refresh()` will fail if no token is backing 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: [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]