adutra commented on code in PR #18754:
URL: https://github.com/apache/iceberg/pull/18754#discussion_r4468986667
##########
core/src/main/java/org/apache/iceberg/rest/auth/AuthManagers.java:
##########
@@ -52,17 +52,12 @@ public static AuthManager loadAuthManager(String name,
Map<String, String> prope
} else {
authType = properties.get(AuthProperties.AUTH_TYPE);
if (authType == null) {
- boolean hasCredential =
properties.containsKey(OAuth2Properties.CREDENTIAL);
- boolean hasToken = properties.containsKey(OAuth2Properties.TOKEN);
- if (hasCredential || hasToken) {
- LOG.warn(
- "Inferring {}={} since property {} was provided. "
- + "Please explicitly set {} to avoid this warning.",
- AuthProperties.AUTH_TYPE,
- AuthProperties.AUTH_TYPE_OAUTH2,
- hasCredential ? OAuth2Properties.CREDENTIAL :
OAuth2Properties.TOKEN,
- AuthProperties.AUTH_TYPE);
+ if (properties.containsKey(OAuth2Properties.CREDENTIAL)) {
+ warnInferredAuthType(AuthProperties.AUTH_TYPE_OAUTH2,
OAuth2Properties.CREDENTIAL);
authType = AuthProperties.AUTH_TYPE_OAUTH2;
+ } else if (properties.containsKey(OAuth2Properties.TOKEN)) {
Review Comment:
You are right, I was rushing things a bit here.
I'll revert the changes here and make the bearer manager strictly opt-in.
We'll keep inferring `oauth2` (v1) from `token`, as today.
Let's just keep in mind though that the new OAuth2 manager v2 (#18756) will
_not_ handle `token`. To upgrade, users of `token` will have 2 options:
- Upgrade to `oauth2` v2 and provide valid OAuth2 credentials instead of a
raw token.
- Upgrade to `bearer` and keep using raw tokens as before.
--
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]