omkreddy commented on code in PR #19622: URL: https://github.com/apache/kafka/pull/19622#discussion_r2080166544
########## clients/src/main/java/org/apache/kafka/common/security/oauthbearer/OAuthBearerLoginCallbackHandler.java: ########## @@ -179,28 +180,34 @@ public class OAuthBearerLoginCallbackHandler implements AuthenticateCallbackHand private Map<String, Object> moduleOptions; - private AccessTokenRetriever accessTokenRetriever; + private JwtRetriever jwtRetriever; - private AccessTokenValidator accessTokenValidator; + private JwtValidator jwtValidator; private boolean isInitialized = false; @Override public void configure(Map<String, ?> configs, String saslMechanism, List<AppConfigurationEntry> jaasConfigEntries) { moduleOptions = JaasOptionsUtils.getOptions(saslMechanism, jaasConfigEntries); - AccessTokenRetriever accessTokenRetriever = AccessTokenRetrieverFactory.create(configs, saslMechanism, moduleOptions); - AccessTokenValidator accessTokenValidator = AccessTokenValidatorFactory.create(configs, saslMechanism); - init(accessTokenRetriever, accessTokenValidator); + JwtRetriever jwtRetriever = new DefaultJwtRetriever(configs, saslMechanism, moduleOptions); + JwtValidator jwtValidator = new DefaultJwtValidator(configs, saslMechanism); + init(jwtRetriever, jwtValidator); } - public void init(AccessTokenRetriever accessTokenRetriever, AccessTokenValidator accessTokenValidator) { - this.accessTokenRetriever = accessTokenRetriever; - this.accessTokenValidator = accessTokenValidator; + public void init(JwtRetriever jwtRetriever, JwtValidator jwtValidator) { Review Comment: When we originally added these classes, the methods were package-protected for testing purposes: [Initial PR](https://github.com/apache/kafka/pull/11284/files#diff-07a4bd9cb223c59540c76fb6a4fab2527de52a70cb4653ab5bb4262cc8ec736cR191-R196) Later, when the packages were reorganized, the methods were made public: [Follow-up PR](https://github.com/apache/kafka/pull/12039/files#diff-8feae72c98bbd4064b428d119607c80f5b30136b0e540cf8fa0de08b31321c37R194-R206) I agree that since these methods are only used in tests and invoked exclusively for testing, it’s reasonable to update or delete them. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org