nastra commented on code in PR #12555:
URL: https://github.com/apache/iceberg/pull/12555#discussion_r2011706431
##########
core/src/main/java/org/apache/iceberg/rest/auth/AuthManager.java:
##########
@@ -33,74 +33,62 @@
public interface AuthManager extends AutoCloseable {
/**
- * Returns a temporary session to use for contacting the configuration
endpoint only. Note that
- * the returned session will be closed after the configuration endpoint is
contacted, and should
- * not be cached.
+ * Returns a manager that uses the given REST client for its internal
authentication requests,
+ * such as for fetching tokens or refreshing credentials.
*
- * <p>The provided REST client is a short-lived client; it should only be
used to fetch initial
- * credentials, if required, and must be discarded after that.
- *
- * <p>This method cannot return null. By default, it returns the catalog
session.
+ * <p>By default, this method ignores the REST client and returns {@code
this}. Implementations
+ * that require a client should override this method.
*/
+ default AuthManager withClient(RESTClient client) {
+ return this;
+ }
+
+ /** Returns an authentication session for the given scope. */
+ default AuthSession authSession(AuthScope scope) {
+ throw new UnsupportedOperationException("AuthManager.authSession is not
implemented");
+ }
+
+ /**
+ * @deprecated since 1.9.0, will be removed in 1.10.0; use {@link
#authSession(AuthScope)}
+ * instead.
+ */
+ @Deprecated
Review Comment:
should this method be returning `return
withClient(initClient).authSession(AuthScopes.Initial.of(properties));`?
--
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]