patrik-marton commented on code in PR #12846: URL: https://github.com/apache/kafka/pull/12846#discussion_r1031302727
########## connect/basic-auth-extension/src/main/java/org/apache/kafka/connect/rest/basic/auth/extension/JaasBasicAuthFilter.java: ########## @@ -174,4 +153,84 @@ public void handle(Callback[] callbacks) throws UnsupportedCallbackException { )); } } + + private void setSecurityContextForRequest(ContainerRequestContext requestContext, BasicAuthenticationCredential credential) { + requestContext.setSecurityContext(new SecurityContext() { + @Override + public Principal getUserPrincipal() { + return () -> credential.getUsername(); + } + + @Override + public boolean isUserInRole(String role) { + return false; + } + + @Override + public boolean isSecure() { + return requestContext.getUriInfo().getRequestUri().getScheme().equalsIgnoreCase("https"); Review Comment: I added a null check -- 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