This is an automated email from the ASF dual-hosted git repository.
clolov pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 0b07db572b1 KAFKA-18595: Remove
AuthorizerUtils#sessionToRequestContext (#18631)
0b07db572b1 is described below
commit 0b07db572b176c1291113b12481022fecbfb49fb
Author: TengYao Chi <[email protected]>
AuthorDate: Mon Jan 20 23:35:53 2025 +0800
KAFKA-18595: Remove AuthorizerUtils#sessionToRequestContext (#18631)
Reviewers: Christo Lolov <[email protected]>
---
.../kafka/security/authorizer/AuthorizerUtils.java | 50 ----------------------
1 file changed, 50 deletions(-)
diff --git
a/server/src/main/java/org/apache/kafka/security/authorizer/AuthorizerUtils.java
b/server/src/main/java/org/apache/kafka/security/authorizer/AuthorizerUtils.java
index 763f156158a..eacd82e4d51 100644
---
a/server/src/main/java/org/apache/kafka/security/authorizer/AuthorizerUtils.java
+++
b/server/src/main/java/org/apache/kafka/security/authorizer/AuthorizerUtils.java
@@ -17,15 +17,9 @@
package org.apache.kafka.security.authorizer;
import org.apache.kafka.common.resource.Resource;
-import org.apache.kafka.common.security.auth.KafkaPrincipal;
-import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.utils.Utils;
-import org.apache.kafka.network.Session;
-import org.apache.kafka.server.authorizer.AuthorizableRequestContext;
import org.apache.kafka.server.authorizer.Authorizer;
-import java.net.InetAddress;
-
public class AuthorizerUtils {
public static Authorizer createAuthorizer(String className) throws
ClassNotFoundException {
return Utils.newInstance(className, Authorizer.class);
@@ -34,48 +28,4 @@ public class AuthorizerUtils {
public static boolean isClusterResource(String name) {
return name.equals(Resource.CLUSTER_NAME);
}
-
- public static AuthorizableRequestContext sessionToRequestContext(Session
session) {
- return new AuthorizableRequestContext() {
- @Override
- public String clientId() {
- return "";
- }
-
- @Override
- public int requestType() {
- return -1;
- }
-
- @Override
- public String listenerName() {
- return "";
- }
-
- @Override
- public InetAddress clientAddress() {
- return session.clientAddress;
- }
-
- @Override
- public KafkaPrincipal principal() {
- return session.principal;
- }
-
- @Override
- public SecurityProtocol securityProtocol() {
- return null;
- }
-
- @Override
- public int correlationId() {
- return -1;
- }
-
- @Override
- public int requestVersion() {
- return -1;
- }
- };
- }
}