nastra commented on code in PR #12555: URL: https://github.com/apache/iceberg/pull/12555#discussion_r2013839105
########## core/src/main/java/org/apache/iceberg/rest/auth/AuthManager.java: ########## @@ -33,77 +33,65 @@ 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 default AuthSession initSession(RESTClient initClient, Map<String, String> properties) { - return catalogSession(initClient, properties); + return withClient(initClient).authSession(AuthScopes.Initial.of(properties)); } /** - * Returns a long-lived session whose lifetime is tied to the owning catalog. This session serves Review Comment: minor: I don't think it's necessary to remove all javadoc just because we're deprecating something. I would just leave it in, since that also reduces the size of the diff -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org