MINOR: Use SecurityProtocol in AuthenticationContext

Since we removed the unused `TRACE` option from `SecurityProtocol`, it now seems safer to expose it from `AuthenticationContext`. Additionally this patch exposes javadocs under security.auth and relocates the `Login` and `AuthCallbackHandler` to a non-public package.

Author: Jason Gustafson <jason@confluent.io>

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>

Closes #3863 from hachikuji/use-security-protocol-in-auth-context
This commit is contained in:
Jason Gustafson 2017-10-04 09:20:21 -07:00
parent 198302feec
commit 5383f9bed0
90 changed files with 116 additions and 130 deletions

View File

@ -834,6 +834,7 @@ project(':clients') {
include "**/org/apache/kafka/common/resource/*" include "**/org/apache/kafka/common/resource/*"
include "**/org/apache/kafka/common/serialization/*" include "**/org/apache/kafka/common/serialization/*"
include "**/org/apache/kafka/common/config/*" include "**/org/apache/kafka/common/config/*"
include "**/org/apache/kafka/common/security/auth/*"
include "**/org/apache/kafka/server/policy/*" include "**/org/apache/kafka/server/policy/*"
} }
} }

View File

@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicReference;
import org.apache.kafka.common.config.AbstractConfig; import org.apache.kafka.common.config.AbstractConfig;
import org.apache.kafka.common.network.ChannelBuilders; import org.apache.kafka.common.network.ChannelBuilders;
import org.apache.kafka.common.security.JaasContext; import org.apache.kafka.common.security.JaasContext;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.network.ChannelBuilder; import org.apache.kafka.common.network.ChannelBuilder;
import org.apache.kafka.common.config.ConfigException; import org.apache.kafka.common.config.ConfigException;
import org.apache.kafka.common.config.SaslConfigs; import org.apache.kafka.common.config.SaslConfigs;

View File

@ -17,7 +17,7 @@
package org.apache.kafka.clients; package org.apache.kafka.clients;
import org.apache.kafka.common.config.AbstractConfig; import org.apache.kafka.common.config.AbstractConfig;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.utils.Utils; import org.apache.kafka.common.utils.Utils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -20,7 +20,7 @@ import org.apache.kafka.common.Configurable;
import org.apache.kafka.common.config.AbstractConfig; import org.apache.kafka.common.config.AbstractConfig;
import org.apache.kafka.common.config.internals.BrokerSecurityConfigs; import org.apache.kafka.common.config.internals.BrokerSecurityConfigs;
import org.apache.kafka.common.errors.InvalidConfigurationException; import org.apache.kafka.common.errors.InvalidConfigurationException;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.security.JaasContext; import org.apache.kafka.common.security.JaasContext;
import org.apache.kafka.common.security.authenticator.DefaultKafkaPrincipalBuilder; import org.apache.kafka.common.security.authenticator.DefaultKafkaPrincipalBuilder;
import org.apache.kafka.common.security.auth.DefaultPrincipalBuilder; import org.apache.kafka.common.security.auth.DefaultPrincipalBuilder;

View File

@ -16,7 +16,7 @@
*/ */
package org.apache.kafka.common.network; package org.apache.kafka.common.network;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import java.util.Locale; import java.util.Locale;
import java.util.Objects; import java.util.Objects;

View File

@ -20,7 +20,7 @@ import org.apache.kafka.common.KafkaException;
import org.apache.kafka.common.config.SaslConfigs; import org.apache.kafka.common.config.SaslConfigs;
import org.apache.kafka.common.config.internals.BrokerSecurityConfigs; import org.apache.kafka.common.config.internals.BrokerSecurityConfigs;
import org.apache.kafka.common.memory.MemoryPool; import org.apache.kafka.common.memory.MemoryPool;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.security.JaasContext; import org.apache.kafka.common.security.JaasContext;
import org.apache.kafka.common.security.authenticator.CredentialCache; import org.apache.kafka.common.security.authenticator.CredentialCache;
import org.apache.kafka.common.security.authenticator.LoginManager; import org.apache.kafka.common.security.authenticator.LoginManager;

View File

@ -20,9 +20,9 @@ import org.apache.kafka.common.errors.InvalidRequestException;
import org.apache.kafka.common.network.ListenerName; import org.apache.kafka.common.network.ListenerName;
import org.apache.kafka.common.network.Send; import org.apache.kafka.common.network.Send;
import org.apache.kafka.common.protocol.ApiKeys; import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.SecurityProtocol;
import org.apache.kafka.common.protocol.types.Struct; import org.apache.kafka.common.protocol.types.Struct;
import org.apache.kafka.common.security.auth.KafkaPrincipal; import org.apache.kafka.common.security.auth.KafkaPrincipal;
import org.apache.kafka.common.security.auth.SecurityProtocol;
import java.net.InetAddress; import java.net.InetAddress;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;

View File

@ -21,11 +21,11 @@ import org.apache.kafka.common.errors.UnsupportedVersionException;
import org.apache.kafka.common.network.ListenerName; import org.apache.kafka.common.network.ListenerName;
import org.apache.kafka.common.protocol.ApiKeys; import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.Errors; import org.apache.kafka.common.protocol.Errors;
import org.apache.kafka.common.protocol.SecurityProtocol;
import org.apache.kafka.common.protocol.types.ArrayOf; import org.apache.kafka.common.protocol.types.ArrayOf;
import org.apache.kafka.common.protocol.types.Field; import org.apache.kafka.common.protocol.types.Field;
import org.apache.kafka.common.protocol.types.Schema; import org.apache.kafka.common.protocol.types.Schema;
import org.apache.kafka.common.protocol.types.Struct; import org.apache.kafka.common.protocol.types.Struct;
import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.utils.Utils; import org.apache.kafka.common.utils.Utils;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;

View File

@ -25,9 +25,8 @@ import java.net.InetAddress;
public interface AuthenticationContext { public interface AuthenticationContext {
/** /**
* Underlying security protocol of the authentication session. * Underlying security protocol of the authentication session.
* @return The name of the security protocol (i.e. PLAINTEXT, SASL_PLAINTEXT, SASL_SSL, SSL)
*/ */
String securityProtocolName(); SecurityProtocol securityProtocol();
/** /**
* Address of the authenticated client * Address of the authenticated client

View File

@ -16,8 +16,6 @@
*/ */
package org.apache.kafka.common.security.auth; package org.apache.kafka.common.security.auth;
import org.apache.kafka.common.protocol.SecurityProtocol;
import java.net.InetAddress; import java.net.InetAddress;
public class PlaintextAuthenticationContext implements AuthenticationContext { public class PlaintextAuthenticationContext implements AuthenticationContext {
@ -28,8 +26,8 @@ public class PlaintextAuthenticationContext implements AuthenticationContext {
} }
@Override @Override
public String securityProtocolName() { public SecurityProtocol securityProtocol() {
return SecurityProtocol.PLAINTEXT.name; return SecurityProtocol.PLAINTEXT;
} }
@Override @Override

View File

@ -16,8 +16,6 @@
*/ */
package org.apache.kafka.common.security.auth; package org.apache.kafka.common.security.auth;
import org.apache.kafka.common.protocol.SecurityProtocol;
import javax.security.sasl.SaslServer; import javax.security.sasl.SaslServer;
import java.net.InetAddress; import java.net.InetAddress;
@ -37,8 +35,8 @@ public class SaslAuthenticationContext implements AuthenticationContext {
} }
@Override @Override
public String securityProtocolName() { public SecurityProtocol securityProtocol() {
return securityProtocol.name; return securityProtocol;
} }
@Override @Override

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.kafka.common.protocol; package org.apache.kafka.common.security.auth;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;

View File

@ -16,8 +16,6 @@
*/ */
package org.apache.kafka.common.security.auth; package org.apache.kafka.common.security.auth;
import org.apache.kafka.common.protocol.SecurityProtocol;
import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSession;
import java.net.InetAddress; import java.net.InetAddress;
@ -35,8 +33,8 @@ public class SslAuthenticationContext implements AuthenticationContext {
} }
@Override @Override
public String securityProtocolName() { public SecurityProtocol securityProtocol() {
return SecurityProtocol.SSL.name; return SecurityProtocol.SSL;
} }
@Override @Override

View File

@ -27,7 +27,6 @@ import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.auth.Subject; import javax.security.auth.Subject;
import org.apache.kafka.common.security.JaasContext; import org.apache.kafka.common.security.JaasContext;
import org.apache.kafka.common.security.auth.Login;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.kafka.common.security.auth; package org.apache.kafka.common.security.authenticator;
import java.util.Map; import java.util.Map;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.kafka.common.security.auth; package org.apache.kafka.common.security.authenticator;
import org.apache.kafka.common.security.JaasContext; import org.apache.kafka.common.security.JaasContext;

View File

@ -27,7 +27,6 @@ import java.util.Map;
import org.apache.kafka.common.config.SaslConfigs; import org.apache.kafka.common.config.SaslConfigs;
import org.apache.kafka.common.config.types.Password; import org.apache.kafka.common.config.types.Password;
import org.apache.kafka.common.security.JaasContext; import org.apache.kafka.common.security.JaasContext;
import org.apache.kafka.common.security.auth.Login;
import org.apache.kafka.common.security.kerberos.KerberosLogin; import org.apache.kafka.common.security.kerberos.KerberosLogin;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -41,7 +41,6 @@ import org.apache.kafka.common.requests.SaslAuthenticateRequest;
import org.apache.kafka.common.requests.SaslAuthenticateResponse; import org.apache.kafka.common.requests.SaslAuthenticateResponse;
import org.apache.kafka.common.requests.SaslHandshakeRequest; import org.apache.kafka.common.requests.SaslHandshakeRequest;
import org.apache.kafka.common.requests.SaslHandshakeResponse; import org.apache.kafka.common.requests.SaslHandshakeResponse;
import org.apache.kafka.common.security.auth.AuthCallbackHandler;
import org.apache.kafka.common.security.auth.KafkaPrincipal; import org.apache.kafka.common.security.auth.KafkaPrincipal;
import org.apache.kafka.common.utils.Utils; import org.apache.kafka.common.utils.Utils;
import org.slf4j.Logger; import org.slf4j.Logger;

View File

@ -28,7 +28,6 @@ import javax.security.sasl.RealmCallback;
import org.apache.kafka.common.config.SaslConfigs; import org.apache.kafka.common.config.SaslConfigs;
import org.apache.kafka.common.network.Mode; import org.apache.kafka.common.network.Mode;
import org.apache.kafka.common.security.auth.AuthCallbackHandler;
/** /**
* Callback handler for Sasl clients. The callbacks required for the SASL mechanism * Callback handler for Sasl clients. The callbacks required for the SASL mechanism

View File

@ -34,7 +34,7 @@ import org.apache.kafka.common.network.Send;
import org.apache.kafka.common.network.TransportLayer; import org.apache.kafka.common.network.TransportLayer;
import org.apache.kafka.common.protocol.ApiKeys; import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.Errors; import org.apache.kafka.common.protocol.Errors;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.requests.AbstractResponse; import org.apache.kafka.common.requests.AbstractResponse;
import org.apache.kafka.common.requests.ApiVersionsRequest; import org.apache.kafka.common.requests.ApiVersionsRequest;
import org.apache.kafka.common.requests.ApiVersionsResponse; import org.apache.kafka.common.requests.ApiVersionsResponse;
@ -46,7 +46,6 @@ import org.apache.kafka.common.requests.SaslAuthenticateResponse;
import org.apache.kafka.common.requests.SaslHandshakeRequest; import org.apache.kafka.common.requests.SaslHandshakeRequest;
import org.apache.kafka.common.requests.SaslHandshakeResponse; import org.apache.kafka.common.requests.SaslHandshakeResponse;
import org.apache.kafka.common.security.JaasContext; import org.apache.kafka.common.security.JaasContext;
import org.apache.kafka.common.security.auth.AuthCallbackHandler;
import org.apache.kafka.common.security.auth.KafkaPrincipal; import org.apache.kafka.common.security.auth.KafkaPrincipal;
import org.apache.kafka.common.security.auth.KafkaPrincipalBuilder; import org.apache.kafka.common.security.auth.KafkaPrincipalBuilder;
import org.apache.kafka.common.security.auth.SaslAuthenticationContext; import org.apache.kafka.common.security.auth.SaslAuthenticationContext;

View File

@ -20,7 +20,6 @@ import java.io.IOException;
import java.util.Map; import java.util.Map;
import org.apache.kafka.common.security.JaasContext; import org.apache.kafka.common.security.JaasContext;
import org.apache.kafka.common.security.auth.AuthCallbackHandler;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -25,7 +25,7 @@ import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.UnsupportedCallbackException; import javax.security.auth.callback.UnsupportedCallbackException;
import org.apache.kafka.common.network.Mode; import org.apache.kafka.common.network.Mode;
import org.apache.kafka.common.security.auth.AuthCallbackHandler; import org.apache.kafka.common.security.authenticator.AuthCallbackHandler;
import org.apache.kafka.common.security.authenticator.CredentialCache; import org.apache.kafka.common.security.authenticator.CredentialCache;
public class ScramServerCallbackHandler implements AuthCallbackHandler { public class ScramServerCallbackHandler implements AuthCallbackHandler {

View File

@ -16,7 +16,7 @@
*/ */
package org.apache.kafka.common.network; package org.apache.kafka.common.network;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.security.ssl.SslFactory; import org.apache.kafka.common.security.ssl.SslFactory;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;

View File

@ -24,7 +24,7 @@ import static org.junit.Assert.assertTrue;
import org.apache.kafka.common.config.AbstractConfig; import org.apache.kafka.common.config.AbstractConfig;
import org.apache.kafka.common.metrics.Metrics; import org.apache.kafka.common.metrics.Metrics;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.utils.LogContext; import org.apache.kafka.common.utils.LogContext;
import org.apache.kafka.common.security.authenticator.CredentialCache; import org.apache.kafka.common.security.authenticator.CredentialCache;
import org.apache.kafka.common.utils.MockTime; import org.apache.kafka.common.utils.MockTime;

View File

@ -22,7 +22,7 @@ import org.apache.kafka.common.MetricName;
import org.apache.kafka.common.config.AbstractConfig; import org.apache.kafka.common.config.AbstractConfig;
import org.apache.kafka.common.metrics.KafkaMetric; import org.apache.kafka.common.metrics.KafkaMetric;
import org.apache.kafka.common.metrics.Metrics; import org.apache.kafka.common.metrics.Metrics;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.security.authenticator.CredentialCache; import org.apache.kafka.common.security.authenticator.CredentialCache;
import org.apache.kafka.common.security.scram.ScramCredentialUtils; import org.apache.kafka.common.security.scram.ScramCredentialUtils;
import org.apache.kafka.common.security.scram.ScramMechanism; import org.apache.kafka.common.security.scram.ScramMechanism;

View File

@ -18,7 +18,7 @@ package org.apache.kafka.common.network;
import org.apache.kafka.common.KafkaException; import org.apache.kafka.common.KafkaException;
import org.apache.kafka.common.config.SslConfigs; import org.apache.kafka.common.config.SslConfigs;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.security.JaasContext; import org.apache.kafka.common.security.JaasContext;
import org.apache.kafka.common.security.authenticator.TestJaasConfig; import org.apache.kafka.common.security.authenticator.TestJaasConfig;
import org.apache.kafka.common.security.plain.PlainLoginModule; import org.apache.kafka.common.security.plain.PlainLoginModule;

View File

@ -20,7 +20,7 @@ import org.apache.kafka.common.KafkaException;
import org.apache.kafka.common.memory.MemoryPool; import org.apache.kafka.common.memory.MemoryPool;
import org.apache.kafka.common.memory.SimpleMemoryPool; import org.apache.kafka.common.memory.SimpleMemoryPool;
import org.apache.kafka.common.metrics.Metrics; import org.apache.kafka.common.metrics.Metrics;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.utils.LogContext; import org.apache.kafka.common.utils.LogContext;
import org.apache.kafka.common.utils.MockTime; import org.apache.kafka.common.utils.MockTime;
import org.apache.kafka.common.utils.Time; import org.apache.kafka.common.utils.Time;

View File

@ -19,7 +19,7 @@ package org.apache.kafka.common.network;
import org.apache.kafka.common.memory.MemoryPool; import org.apache.kafka.common.memory.MemoryPool;
import org.apache.kafka.common.memory.SimpleMemoryPool; import org.apache.kafka.common.memory.SimpleMemoryPool;
import org.apache.kafka.common.metrics.Metrics; import org.apache.kafka.common.metrics.Metrics;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.security.ssl.SslFactory; import org.apache.kafka.common.security.ssl.SslFactory;
import org.apache.kafka.common.utils.LogContext; import org.apache.kafka.common.utils.LogContext;
import org.apache.kafka.common.utils.MockTime; import org.apache.kafka.common.utils.MockTime;

View File

@ -22,7 +22,7 @@ import org.apache.kafka.common.config.internals.BrokerSecurityConfigs;
import org.apache.kafka.common.config.types.Password; import org.apache.kafka.common.config.types.Password;
import org.apache.kafka.common.memory.MemoryPool; import org.apache.kafka.common.memory.MemoryPool;
import org.apache.kafka.common.metrics.Metrics; import org.apache.kafka.common.metrics.Metrics;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.security.TestSecurityConfig; import org.apache.kafka.common.security.TestSecurityConfig;
import org.apache.kafka.common.security.ssl.SslFactory; import org.apache.kafka.common.security.ssl.SslFactory;
import org.apache.kafka.common.utils.LogContext; import org.apache.kafka.common.utils.LogContext;

View File

@ -20,7 +20,7 @@ import org.apache.kafka.common.network.ListenerName;
import org.apache.kafka.common.network.Send; import org.apache.kafka.common.network.Send;
import org.apache.kafka.common.protocol.ApiKeys; import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.Errors; import org.apache.kafka.common.protocol.Errors;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.protocol.types.Struct; import org.apache.kafka.common.protocol.types.Struct;
import org.apache.kafka.common.security.auth.KafkaPrincipal; import org.apache.kafka.common.security.auth.KafkaPrincipal;
import org.junit.Test; import org.junit.Test;

View File

@ -36,7 +36,7 @@ import org.apache.kafka.common.network.ListenerName;
import org.apache.kafka.common.network.Send; import org.apache.kafka.common.network.Send;
import org.apache.kafka.common.protocol.ApiKeys; import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.Errors; import org.apache.kafka.common.protocol.Errors;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.protocol.types.Struct; import org.apache.kafka.common.protocol.types.Struct;
import org.apache.kafka.common.record.CompressionType; import org.apache.kafka.common.record.CompressionType;
import org.apache.kafka.common.record.MemoryRecords; import org.apache.kafka.common.record.MemoryRecords;

View File

@ -19,7 +19,6 @@ package org.apache.kafka.common.security.auth;
import org.apache.kafka.common.config.SaslConfigs; import org.apache.kafka.common.config.SaslConfigs;
import org.apache.kafka.common.network.Authenticator; import org.apache.kafka.common.network.Authenticator;
import org.apache.kafka.common.network.TransportLayer; import org.apache.kafka.common.network.TransportLayer;
import org.apache.kafka.common.protocol.SecurityProtocol;
import org.apache.kafka.common.security.authenticator.DefaultKafkaPrincipalBuilder; import org.apache.kafka.common.security.authenticator.DefaultKafkaPrincipalBuilder;
import org.apache.kafka.common.security.kerberos.KerberosName; import org.apache.kafka.common.security.kerberos.KerberosName;
import org.apache.kafka.common.security.kerberos.KerberosShortNamer; import org.apache.kafka.common.security.kerberos.KerberosShortNamer;

View File

@ -30,8 +30,8 @@ import org.apache.kafka.common.errors.SaslAuthenticationException;
import org.apache.kafka.common.network.ListenerName; import org.apache.kafka.common.network.ListenerName;
import org.apache.kafka.common.network.NetworkTestUtils; import org.apache.kafka.common.network.NetworkTestUtils;
import org.apache.kafka.common.network.NioEchoServer; import org.apache.kafka.common.network.NioEchoServer;
import org.apache.kafka.common.protocol.SecurityProtocol;
import org.apache.kafka.common.security.TestSecurityConfig; import org.apache.kafka.common.security.TestSecurityConfig;
import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.serialization.StringDeserializer; import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.kafka.common.serialization.StringSerializer; import org.apache.kafka.common.serialization.StringSerializer;
import org.junit.After; import org.junit.After;

View File

@ -36,7 +36,7 @@ import org.apache.kafka.common.network.Send;
import org.apache.kafka.common.network.TransportLayer; import org.apache.kafka.common.network.TransportLayer;
import org.apache.kafka.common.protocol.ApiKeys; import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.Errors; import org.apache.kafka.common.protocol.Errors;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.requests.AbstractRequest; import org.apache.kafka.common.requests.AbstractRequest;
import org.apache.kafka.common.requests.AbstractResponse; import org.apache.kafka.common.requests.AbstractResponse;
import org.apache.kafka.common.requests.ApiVersionsRequest; import org.apache.kafka.common.requests.ApiVersionsRequest;

View File

@ -22,7 +22,7 @@ import org.apache.kafka.common.network.InvalidReceiveException;
import org.apache.kafka.common.network.ListenerName; import org.apache.kafka.common.network.ListenerName;
import org.apache.kafka.common.network.TransportLayer; import org.apache.kafka.common.network.TransportLayer;
import org.apache.kafka.common.protocol.ApiKeys; import org.apache.kafka.common.protocol.ApiKeys;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.protocol.types.Struct; import org.apache.kafka.common.protocol.types.Struct;
import org.apache.kafka.common.requests.RequestHeader; import org.apache.kafka.common.requests.RequestHeader;
import org.apache.kafka.common.security.JaasContext; import org.apache.kafka.common.security.JaasContext;

View File

@ -35,8 +35,9 @@ import org.apache.kafka.common.errors.BrokerNotAvailableException
import org.apache.kafka.common.{KafkaException, Node, TopicPartition} import org.apache.kafka.common.{KafkaException, Node, TopicPartition}
import org.apache.kafka.common.internals.Topic import org.apache.kafka.common.internals.Topic
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.{Errors, SecurityProtocol} import org.apache.kafka.common.protocol.Errors
import org.apache.kafka.common.security.JaasUtils import org.apache.kafka.common.security.JaasUtils
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.serialization.StringDeserializer import org.apache.kafka.common.serialization.StringDeserializer
import org.apache.kafka.common.utils.Utils import org.apache.kafka.common.utils.Utils

View File

@ -16,7 +16,7 @@
*/ */
package kafka.client package kafka.client
import org.apache.kafka.common.protocol.{Errors, SecurityProtocol} import org.apache.kafka.common.protocol.Errors
import scala.collection._ import scala.collection._
import kafka.cluster._ import kafka.cluster._
@ -31,6 +31,8 @@ import kafka.network.BlockingChannel
import kafka.utils.ZkUtils import kafka.utils.ZkUtils
import java.io.IOException import java.io.IOException
import org.apache.kafka.common.security.auth.SecurityProtocol
/** /**
* Helper functions common to clients (producer, consumer, or admin) * Helper functions common to clients (producer, consumer, or admin)
*/ */

View File

@ -21,7 +21,7 @@ import kafka.common.{BrokerEndPointNotAvailableException, BrokerNotAvailableExce
import kafka.utils.Json import kafka.utils.Json
import org.apache.kafka.common.Node import org.apache.kafka.common.Node
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.utils.Time import org.apache.kafka.common.utils.Time
/** /**

View File

@ -19,7 +19,7 @@ package kafka.cluster
import kafka.common.KafkaException import kafka.common.KafkaException
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.utils.Utils import org.apache.kafka.common.utils.Utils
import scala.collection.Map import scala.collection.Map

View File

@ -29,10 +29,11 @@ import kafka.utils._
import org.apache.kafka.clients._ import org.apache.kafka.clients._
import org.apache.kafka.common.metrics.Metrics import org.apache.kafka.common.metrics.Metrics
import org.apache.kafka.common.network._ import org.apache.kafka.common.network._
import org.apache.kafka.common.protocol.{ApiKeys, SecurityProtocol} import org.apache.kafka.common.protocol.ApiKeys
import org.apache.kafka.common.requests.UpdateMetadataRequest.EndPoint import org.apache.kafka.common.requests.UpdateMetadataRequest.EndPoint
import org.apache.kafka.common.requests._ import org.apache.kafka.common.requests._
import org.apache.kafka.common.security.JaasContext import org.apache.kafka.common.security.JaasContext
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.utils.{LogContext, Time} import org.apache.kafka.common.utils.{LogContext, Time}
import org.apache.kafka.common.{Node, TopicPartition} import org.apache.kafka.common.{Node, TopicPartition}

View File

@ -35,8 +35,8 @@ import org.apache.kafka.common.memory.{MemoryPool, SimpleMemoryPool}
import org.apache.kafka.common.metrics._ import org.apache.kafka.common.metrics._
import org.apache.kafka.common.metrics.stats.Meter import org.apache.kafka.common.metrics.stats.Meter
import org.apache.kafka.common.network.{ChannelBuilder, ChannelBuilders, KafkaChannel, ListenerName, Selectable, Send, Selector => KSelector} import org.apache.kafka.common.network.{ChannelBuilder, ChannelBuilders, KafkaChannel, ListenerName, Selectable, Send, Selector => KSelector}
import org.apache.kafka.common.protocol.SecurityProtocol
import org.apache.kafka.common.requests.{RequestContext, RequestHeader} import org.apache.kafka.common.requests.{RequestContext, RequestHeader}
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.utils.{KafkaThread, LogContext, Time} import org.apache.kafka.common.utils.{KafkaThread, LogContext, Time}
import scala.collection._ import scala.collection._

View File

@ -33,8 +33,8 @@ import org.apache.kafka.common.config.internals.BrokerSecurityConfigs
import org.apache.kafka.common.config.{AbstractConfig, ConfigDef, ConfigException, SaslConfigs, SslConfigs, TopicConfig} import org.apache.kafka.common.config.{AbstractConfig, ConfigDef, ConfigException, SaslConfigs, SslConfigs, TopicConfig}
import org.apache.kafka.common.metrics.Sensor import org.apache.kafka.common.metrics.Sensor
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.SecurityProtocol
import org.apache.kafka.common.record.TimestampType import org.apache.kafka.common.record.TimestampType
import org.apache.kafka.common.security.auth.SecurityProtocol
import scala.collection.JavaConverters._ import scala.collection.JavaConverters._
import scala.collection.Map import scala.collection.Map

View File

@ -27,7 +27,7 @@ import kafka.metrics.KafkaMetricsGroup
import kafka.utils._ import kafka.utils._
import com.yammer.metrics.core.Gauge import com.yammer.metrics.core.Gauge
import org.I0Itec.zkclient.IZkStateListener import org.I0Itec.zkclient.IZkStateListener
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.zookeeper.Watcher.Event.KeeperState import org.apache.zookeeper.Watcher.Event.KeeperState
import scala.collection.mutable.Set import scala.collection.mutable.Set

View File

@ -22,8 +22,8 @@ import kafka.api.{OffsetRequest, PartitionOffsetRequestInfo}
import kafka.common.{KafkaException, TopicAndPartition} import kafka.common.{KafkaException, TopicAndPartition}
import kafka.utils.{Exit, Logging, ZKGroupTopicDirs, ZkUtils} import kafka.utils.{Exit, Logging, ZKGroupTopicDirs, ZkUtils}
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.SecurityProtocol
import org.apache.kafka.common.security.JaasUtils import org.apache.kafka.common.security.JaasUtils
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.utils.Utils import org.apache.kafka.common.utils.Utils
/** /**

View File

@ -25,12 +25,11 @@ import java.lang.management._
import java.util.{Properties, UUID} import java.util.{Properties, UUID}
import javax.management._ import javax.management._
import org.apache.kafka.common.protocol.SecurityProtocol
import scala.collection._ import scala.collection._
import scala.collection.mutable import scala.collection.mutable
import kafka.cluster.EndPoint import kafka.cluster.EndPoint
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.utils.{Base64, KafkaThread, Utils} import org.apache.kafka.common.utils.{Base64, KafkaThread, Utils}
/** /**

View File

@ -28,7 +28,6 @@ import kafka.network.SocketServer
import kafka.security.auth._ import kafka.security.auth._
import kafka.server.{BaseRequestTest, KafkaConfig} import kafka.server.{BaseRequestTest, KafkaConfig}
import kafka.utils.TestUtils import kafka.utils.TestUtils
import org.apache.kafka.clients.consumer.OffsetAndMetadata import org.apache.kafka.clients.consumer.OffsetAndMetadata
import org.apache.kafka.clients.consumer.internals.NoOpConsumerRebalanceListener import org.apache.kafka.clients.consumer.internals.NoOpConsumerRebalanceListener
import org.apache.kafka.clients.consumer._ import org.apache.kafka.clients.consumer._
@ -36,15 +35,15 @@ import org.apache.kafka.clients.producer._
import org.apache.kafka.common.errors._ import org.apache.kafka.common.errors._
import org.apache.kafka.common.internals.Topic.GROUP_METADATA_TOPIC_NAME import org.apache.kafka.common.internals.Topic.GROUP_METADATA_TOPIC_NAME
import org.apache.kafka.common.KafkaException import org.apache.kafka.common.KafkaException
import org.apache.kafka.common.protocol.{ApiKeys, Errors, SecurityProtocol} import org.apache.kafka.common.protocol.{ApiKeys, Errors}
import org.apache.kafka.common.requests.{Resource => RResource, ResourceType => RResourceType, _} import org.apache.kafka.common.requests.{Resource => RResource, ResourceType => RResourceType, _}
import org.apache.kafka.common.acl.{AccessControlEntry, AccessControlEntryFilter, AclBinding, AclBindingFilter, AclOperation, AclPermissionType} import org.apache.kafka.common.acl.{AccessControlEntry, AccessControlEntryFilter, AclBinding, AclBindingFilter, AclOperation, AclPermissionType}
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.record.{CompressionType, MemoryRecords, RecordBatch, SimpleRecord} import org.apache.kafka.common.record.{CompressionType, MemoryRecords, SimpleRecord}
import org.apache.kafka.common.requests.CreateAclsRequest.AclCreation import org.apache.kafka.common.requests.CreateAclsRequest.AclCreation
import org.apache.kafka.common.requests.CreateTopicsRequest.TopicDetails import org.apache.kafka.common.requests.CreateTopicsRequest.TopicDetails
import org.apache.kafka.common.resource.{ResourceFilter, Resource => AdminResource, ResourceType => AdminResourceType} import org.apache.kafka.common.resource.{ResourceFilter, Resource => AdminResource, ResourceType => AdminResourceType}
import org.apache.kafka.common.security.auth.KafkaPrincipal import org.apache.kafka.common.security.auth.{KafkaPrincipal, SecurityProtocol}
import org.apache.kafka.common.{Node, TopicPartition, requests} import org.apache.kafka.common.{Node, TopicPartition, requests}
import org.junit.Assert._ import org.junit.Assert._
import org.junit.{After, Assert, Before, Test} import org.junit.{After, Assert, Before, Test}

View File

@ -30,8 +30,8 @@ import kafka.utils.TestUtils
import org.apache.kafka.clients.consumer.{ConsumerRecord, KafkaConsumer} import org.apache.kafka.clients.consumer.{ConsumerRecord, KafkaConsumer}
import org.apache.kafka.clients.producer._ import org.apache.kafka.clients.producer._
import org.apache.kafka.common.{KafkaException, TopicPartition} import org.apache.kafka.common.{KafkaException, TopicPartition}
import org.apache.kafka.common.protocol.SecurityProtocol
import org.apache.kafka.common.record.TimestampType import org.apache.kafka.common.record.TimestampType
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.Assert._ import org.junit.Assert._
import org.junit.{After, Before, Test} import org.junit.{After, Before, Test}

View File

@ -19,7 +19,7 @@ package kafka.api
import java.util.concurrent.ExecutionException import java.util.concurrent.ExecutionException
import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.atomic.AtomicReference
import java.util.{Properties} import java.util.Properties
import kafka.common.TopicAndPartition import kafka.common.TopicAndPartition
import kafka.integration.KafkaServerTestHarness import kafka.integration.KafkaServerTestHarness
@ -100,8 +100,8 @@ class EndToEndClusterIdTest extends KafkaServerTestHarness {
val topic = "e2etopic" val topic = "e2etopic"
val part = 0 val part = 0
val tp = new TopicPartition(topic, part) val tp = new TopicPartition(topic, part)
val topicAndPartition = new TopicAndPartition(topic, part) val topicAndPartition = TopicAndPartition(topic, part)
this.serverConfig.setProperty(KafkaConfig.MetricReporterClassesProp, "kafka.api.EndToEndClusterIdTest$MockBrokerMetricsReporter") this.serverConfig.setProperty(KafkaConfig.MetricReporterClassesProp, classOf[MockBrokerMetricsReporter].getName)
override def generateConfigs = { override def generateConfigs = {
val cfgs = TestUtils.createBrokerConfigs(serverCount, zkConnect, interBrokerSecurityProtocol = Some(securityProtocol), val cfgs = TestUtils.createBrokerConfigs(serverCount, zkConnect, interBrokerSecurityProtocol = Some(securityProtocol),
@ -112,7 +112,7 @@ class EndToEndClusterIdTest extends KafkaServerTestHarness {
@Before @Before
override def setUp() { override def setUp() {
super.setUp super.setUp()
MockDeserializer.resetStaticVariables MockDeserializer.resetStaticVariables
// create the consumer offset topic // create the consumer offset topic
TestUtils.createTopic(this.zkUtils, topic, 2, serverCount, this.servers) TestUtils.createTopic(this.zkUtils, topic, 2, serverCount, this.servers)
@ -129,9 +129,9 @@ class EndToEndClusterIdTest extends KafkaServerTestHarness {
val producerProps = new Properties() val producerProps = new Properties()
producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, brokerList) producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, brokerList)
producerProps.put(ProducerConfig.INTERCEPTOR_CLASSES_CONFIG, "org.apache.kafka.test.MockProducerInterceptor") producerProps.put(ProducerConfig.INTERCEPTOR_CLASSES_CONFIG, classOf[MockProducerInterceptor].getName)
producerProps.put("mock.interceptor.append", appendStr) producerProps.put("mock.interceptor.append", appendStr)
producerProps.put(ProducerConfig.METRIC_REPORTER_CLASSES_CONFIG, "kafka.api.EndToEndClusterIdTest$MockProducerMetricsReporter") producerProps.put(ProducerConfig.METRIC_REPORTER_CLASSES_CONFIG, classOf[MockProducerMetricsReporter].getName)
val testProducer = new KafkaProducer(producerProps, new MockSerializer, new MockSerializer) val testProducer = new KafkaProducer(producerProps, new MockSerializer, new MockSerializer)
// Send one record and make sure clusterId is set after send and before onAcknowledgement // Send one record and make sure clusterId is set after send and before onAcknowledgement
@ -150,8 +150,8 @@ class EndToEndClusterIdTest extends KafkaServerTestHarness {
isValidClusterId(MockProducerMetricsReporter.CLUSTER_META.get.clusterId) isValidClusterId(MockProducerMetricsReporter.CLUSTER_META.get.clusterId)
this.consumerConfig.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, brokerList) this.consumerConfig.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, brokerList)
this.consumerConfig.setProperty(ConsumerConfig.INTERCEPTOR_CLASSES_CONFIG, "org.apache.kafka.test.MockConsumerInterceptor") this.consumerConfig.setProperty(ConsumerConfig.INTERCEPTOR_CLASSES_CONFIG, classOf[MockConsumerInterceptor].getName)
this.consumerConfig.put(ConsumerConfig.METRIC_REPORTER_CLASSES_CONFIG, "kafka.api.EndToEndClusterIdTest$MockConsumerMetricsReporter") this.consumerConfig.put(ConsumerConfig.METRIC_REPORTER_CLASSES_CONFIG, classOf[MockConsumerMetricsReporter].getName)
val testConsumer = new KafkaConsumer(this.consumerConfig, new MockDeserializer, new MockDeserializer) val testConsumer = new KafkaConsumer(this.consumerConfig, new MockDeserializer, new MockDeserializer)
testConsumer.assign(List(tp).asJava) testConsumer.assign(List(tp).asJava)
testConsumer.seek(tp, 0) testConsumer.seek(tp, 0)

View File

@ -18,7 +18,6 @@ import kafka.server.KafkaConfig
import kafka.utils.TestUtils import kafka.utils.TestUtils
import org.apache.kafka.clients.consumer.OffsetAndMetadata import org.apache.kafka.clients.consumer.OffsetAndMetadata
import org.apache.kafka.common.TopicPartition import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.protocol.SecurityProtocol
import org.junit.Test import org.junit.Test
import org.junit.Assert._ import org.junit.Assert._
@ -27,6 +26,7 @@ import java.util.Properties
import org.apache.kafka.common.internals.Topic import org.apache.kafka.common.internals.Topic
import org.apache.kafka.common.record.CompressionType import org.apache.kafka.common.record.CompressionType
import org.apache.kafka.common.security.auth.SecurityProtocol
class GroupCoordinatorIntegrationTest extends KafkaServerTestHarness { class GroupCoordinatorIntegrationTest extends KafkaServerTestHarness {
val offsetsTopicCompressionCodec = CompressionType.GZIP val offsetsTopicCompressionCodec = CompressionType.GZIP

View File

@ -15,7 +15,6 @@ package kafka.api
import java.util.{Locale, Properties} import java.util.{Locale, Properties}
import kafka.log.LogConfig import kafka.log.LogConfig
import kafka.network.RequestMetrics
import kafka.server.{KafkaConfig, KafkaServer} import kafka.server.{KafkaConfig, KafkaServer}
import kafka.utils.{JaasTestUtils, TestUtils} import kafka.utils.{JaasTestUtils, TestUtils}
import com.yammer.metrics.Metrics import com.yammer.metrics.Metrics
@ -25,7 +24,7 @@ import org.apache.kafka.common.{Metric, MetricName, TopicPartition}
import org.apache.kafka.common.config.SaslConfigs import org.apache.kafka.common.config.SaslConfigs
import org.apache.kafka.common.errors.InvalidTopicException import org.apache.kafka.common.errors.InvalidTopicException
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.{After, Before, Test} import org.junit.{After, Before, Test}
import org.junit.Assert._ import org.junit.Assert._

View File

@ -21,7 +21,7 @@ import kafka.server.KafkaConfig
import kafka.utils.TestUtils import kafka.utils.TestUtils
import org.apache.kafka.clients.consumer._ import org.apache.kafka.clients.consumer._
import org.apache.kafka.clients.producer.{KafkaProducer, ProducerConfig, ProducerRecord} import org.apache.kafka.clients.producer.{KafkaProducer, ProducerConfig, ProducerRecord}
import org.apache.kafka.common.{Metric, MetricName, TopicPartition} import org.apache.kafka.common.{MetricName, TopicPartition}
import org.apache.kafka.common.errors.InvalidTopicException import org.apache.kafka.common.errors.InvalidTopicException
import org.apache.kafka.common.header.Headers import org.apache.kafka.common.header.Headers
import org.apache.kafka.common.record.{CompressionType, TimestampType} import org.apache.kafka.common.record.{CompressionType, TimestampType}

View File

@ -18,8 +18,7 @@ package kafka.api
import org.apache.kafka.common.config.internals.BrokerSecurityConfigs import org.apache.kafka.common.config.internals.BrokerSecurityConfigs
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth._
import org.apache.kafka.common.security.auth.{AuthenticationContext, KafkaPrincipal, KafkaPrincipalBuilder, PlaintextAuthenticationContext}
import org.junit.Before import org.junit.Before
// This test case uses a separate listener for client and inter-broker communication, from // This test case uses a separate listener for client and inter-broker communication, from

View File

@ -18,8 +18,8 @@
package kafka.api.test package kafka.api.test
import java.util.{Collection, Collections, Properties} import java.util.{Collection, Collections, Properties}
import scala.collection.JavaConverters._
import scala.collection.JavaConverters._
import org.junit.runners.Parameterized import org.junit.runners.Parameterized
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.Parameterized.Parameters import org.junit.runners.Parameterized.Parameters
@ -30,7 +30,7 @@ import kafka.server.{KafkaConfig, KafkaServer}
import kafka.zk.ZooKeeperTestHarness import kafka.zk.ZooKeeperTestHarness
import kafka.utils.TestUtils import kafka.utils.TestUtils
import org.apache.kafka.common.TopicPartition import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.serialization.ByteArraySerializer import org.apache.kafka.common.serialization.ByteArraySerializer
@RunWith(value = classOf[Parameterized]) @RunWith(value = classOf[Parameterized])

View File

@ -14,22 +14,21 @@ package kafka.api
import java.io.FileOutputStream import java.io.FileOutputStream
import java.util.Collections import java.util.Collections
import java.util.concurrent.{ExecutionException, Future, TimeUnit} import java.util.concurrent.{ExecutionException, TimeUnit}
import scala.collection.JavaConverters._
import scala.collection.JavaConverters._
import org.apache.kafka.clients.admin.{AdminClient, AdminClientConfig} import org.apache.kafka.clients.admin.{AdminClient, AdminClientConfig}
import org.apache.kafka.clients.consumer.{KafkaConsumer, ConsumerConfig} import org.apache.kafka.clients.consumer.{ConsumerConfig, KafkaConsumer}
import org.apache.kafka.clients.producer.{KafkaProducer, ProducerConfig, ProducerRecord, RecordMetadata} import org.apache.kafka.clients.producer.{KafkaProducer, ProducerConfig, ProducerRecord}
import org.apache.kafka.common.{KafkaException, TopicPartition} import org.apache.kafka.common.{KafkaException, TopicPartition}
import org.apache.kafka.common.errors.SaslAuthenticationException import org.apache.kafka.common.errors.SaslAuthenticationException
import org.apache.kafka.common.protocol.SecurityProtocol
import org.apache.kafka.common.serialization.ByteArrayDeserializer import org.apache.kafka.common.serialization.ByteArrayDeserializer
import org.junit.{After, Before, Test} import org.junit.{After, Before, Test}
import org.junit.Assert._ import org.junit.Assert._
import kafka.admin.ConsumerGroupCommand.{ConsumerGroupCommandOptions, KafkaConsumerGroupService} import kafka.admin.ConsumerGroupCommand.{ConsumerGroupCommandOptions, KafkaConsumerGroupService}
import kafka.server.KafkaConfig import kafka.server.KafkaConfig
import kafka.utils.{JaasTestUtils, TestUtils, ZkUtils} import kafka.utils.{JaasTestUtils, TestUtils, ZkUtils}
import org.apache.kafka.common.security.auth.SecurityProtocol
class SaslClientsWithInvalidCredentialsTest extends IntegrationTestHarness with SaslSetup { class SaslClientsWithInvalidCredentialsTest extends IntegrationTestHarness with SaslSetup {
private val kafkaClientSaslMechanism = "SCRAM-SHA-256" private val kafkaClientSaslMechanism = "SCRAM-SHA-256"

View File

@ -20,9 +20,9 @@ import java.util.Properties
import kafka.utils.TestUtils import kafka.utils.TestUtils
import kafka.utils.Implicits._ import kafka.utils.Implicits._
import org.apache.kafka.common.protocol.SecurityProtocol
import org.apache.kafka.common.config.SaslConfigs import org.apache.kafka.common.config.SaslConfigs
import org.apache.kafka.common.errors.GroupAuthorizationException import org.apache.kafka.common.errors.GroupAuthorizationException
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.{Before, Test} import org.junit.{Before, Test}
import scala.collection.immutable.List import scala.collection.immutable.List

View File

@ -14,10 +14,10 @@ package kafka.api
import java.io.File import java.io.File
import org.apache.kafka.common.protocol.SecurityProtocol
import kafka.server.KafkaConfig import kafka.server.KafkaConfig
import org.junit.{After, Before, Test} import org.junit.{After, Before, Test}
import kafka.utils.{JaasTestUtils, TestUtils} import kafka.utils.{JaasTestUtils, TestUtils}
import org.apache.kafka.common.security.auth.SecurityProtocol
import scala.collection.JavaConverters._ import scala.collection.JavaConverters._

View File

@ -15,10 +15,10 @@ package kafka.api
import java.io.File import java.io.File
import java.util.Locale import java.util.Locale
import org.apache.kafka.common.protocol.SecurityProtocol
import kafka.server.KafkaConfig import kafka.server.KafkaConfig
import kafka.utils.{JaasTestUtils, TestUtils} import kafka.utils.{JaasTestUtils, TestUtils}
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.{After, Before, Test} import org.junit.{After, Before, Test}
class SaslPlainPlaintextConsumerTest extends BaseConsumerTest with SaslSetup { class SaslPlainPlaintextConsumerTest extends BaseConsumerTest with SaslSetup {

View File

@ -13,7 +13,7 @@
package kafka.api package kafka.api
import kafka.utils.JaasTestUtils import kafka.utils.JaasTestUtils
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.{After, Before} import org.junit.{After, Before}
class SaslPlaintextConsumerTest extends BaseConsumerTest with SaslSetup { class SaslPlaintextConsumerTest extends BaseConsumerTest with SaslSetup {

View File

@ -18,7 +18,6 @@ package kafka.api
import org.apache.kafka.common.security.scram.ScramMechanism import org.apache.kafka.common.security.scram.ScramMechanism
import kafka.utils.JaasTestUtils import kafka.utils.JaasTestUtils
import kafka.admin.ConfigCommand
import kafka.utils.ZkUtils import kafka.utils.ZkUtils
import scala.collection.JavaConverters._ import scala.collection.JavaConverters._
import org.junit.Before import org.junit.Before

View File

@ -15,14 +15,13 @@ package kafka.api
import java.io.File import java.io.File
import kafka.security.auth.{All, Allow, Alter, AlterConfigs, Authorizer, ClusterAction, Create, Delete, Deny, Describe, Operation, PermissionType, SimpleAclAuthorizer, Topic, Acl => AuthAcl, Resource => AuthResource} import kafka.security.auth.{All, Allow, Alter, AlterConfigs, Authorizer, ClusterAction, Create, Delete, Deny, Describe, Operation, PermissionType, SimpleAclAuthorizer, Topic, Acl => AuthAcl, Resource => AuthResource}
import org.apache.kafka.common.protocol.SecurityProtocol
import kafka.server.KafkaConfig import kafka.server.KafkaConfig
import kafka.utils.{CoreUtils, JaasTestUtils, TestUtils} import kafka.utils.{CoreUtils, JaasTestUtils, TestUtils}
import org.apache.kafka.clients.admin.{AdminClient, CreateAclsOptions, DeleteAclsOptions} import org.apache.kafka.clients.admin.{AdminClient, CreateAclsOptions, DeleteAclsOptions}
import org.apache.kafka.common.acl.{AccessControlEntry, AccessControlEntryFilter, AclBinding, AclBindingFilter, AclOperation, AclPermissionType} import org.apache.kafka.common.acl.{AccessControlEntry, AccessControlEntryFilter, AclBinding, AclBindingFilter, AclOperation, AclPermissionType}
import org.apache.kafka.common.errors.{ClusterAuthorizationException, InvalidRequestException} import org.apache.kafka.common.errors.{ClusterAuthorizationException, InvalidRequestException}
import org.apache.kafka.common.resource.{Resource, ResourceFilter, ResourceType} import org.apache.kafka.common.resource.{Resource, ResourceFilter, ResourceType}
import org.apache.kafka.common.security.auth.KafkaPrincipal import org.apache.kafka.common.security.auth.{KafkaPrincipal, SecurityProtocol}
import org.junit.Assert.assertEquals import org.junit.Assert.assertEquals
import org.junit.{After, Assert, Before, Test} import org.junit.{After, Assert, Before, Test}

View File

@ -14,9 +14,9 @@ package kafka.api
import java.io.File import java.io.File
import org.apache.kafka.common.protocol.SecurityProtocol
import kafka.server.KafkaConfig import kafka.server.KafkaConfig
import kafka.utils.JaasTestUtils import kafka.utils.JaasTestUtils
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.{After, Before} import org.junit.{After, Before}
class SaslSslConsumerTest extends BaseConsumerTest with SaslSetup { class SaslSslConsumerTest extends BaseConsumerTest with SaslSetup {

View File

@ -14,7 +14,7 @@ package kafka.api
import java.io.File import java.io.File
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
class SslConsumerTest extends BaseConsumerTest { class SslConsumerTest extends BaseConsumerTest {
override protected def securityProtocol = SecurityProtocol.SSL override protected def securityProtocol = SecurityProtocol.SSL

View File

@ -18,8 +18,7 @@
package kafka.api package kafka.api
import org.apache.kafka.common.config.internals.BrokerSecurityConfigs import org.apache.kafka.common.config.internals.BrokerSecurityConfigs
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth._
import org.apache.kafka.common.security.auth.{AuthenticationContext, KafkaPrincipal, KafkaPrincipalBuilder, SslAuthenticationContext}
import org.junit.Before import org.junit.Before
object SslEndToEndAuthorizationTest { object SslEndToEndAuthorizationTest {

View File

@ -19,7 +19,7 @@ package kafka.api
import java.io.File import java.io.File
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
class SslProducerSendTest extends BaseProducerSendTest { class SslProducerSendTest extends BaseProducerSendTest {
override protected def securityProtocol = SecurityProtocol.SSL override protected def securityProtocol = SecurityProtocol.SSL

View File

@ -25,12 +25,11 @@ import kafka.utils.{ShutdownableThread, TestUtils}
import org.apache.kafka.clients.consumer.ConsumerConfig import org.apache.kafka.clients.consumer.ConsumerConfig
import org.apache.kafka.clients.producer.internals.ErrorLoggingCallback import org.apache.kafka.clients.producer.internals.ErrorLoggingCallback
import org.apache.kafka.common.TopicPartition import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.Assert._
import org.junit.Test import org.junit.Test
import scala.collection.JavaConverters._ import scala.collection.JavaConverters._
import org.junit.Assert._
import scala.collection.mutable import scala.collection.mutable

View File

@ -29,7 +29,7 @@ import org.apache.kafka.clients.consumer.{ConsumerConfig, KafkaConsumer, OffsetA
import org.apache.kafka.clients.producer.{KafkaProducer, ProducerRecord} import org.apache.kafka.clients.producer.{KafkaProducer, ProducerRecord}
import org.apache.kafka.common.TopicPartition import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.errors.ProducerFencedException import org.apache.kafka.common.errors.ProducerFencedException
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.{After, Before, Test} import org.junit.{After, Before, Test}
import org.junit.Assert._ import org.junit.Assert._

View File

@ -18,10 +18,8 @@ import java.io.File
import java.util.Properties import java.util.Properties
import kafka.admin.AdminUtils import kafka.admin.AdminUtils
import kafka.server._ import kafka.server._
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.protocol.SecurityProtocol
import org.junit.Before import org.junit.Before
import org.apache.kafka.common.metrics.Sanitizer import org.apache.kafka.common.metrics.Sanitizer

View File

@ -20,7 +20,7 @@ import java.util.Properties
import kafka.admin.AdminUtils import kafka.admin.AdminUtils
import kafka.server.{ConfigEntityName, KafkaConfig, QuotaId} import kafka.server.{ConfigEntityName, KafkaConfig, QuotaId}
import kafka.utils.JaasTestUtils import kafka.utils.JaasTestUtils
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.{After, Before} import org.junit.{After, Before}
import org.apache.kafka.common.metrics.Sanitizer import org.apache.kafka.common.metrics.Sanitizer

View File

@ -19,7 +19,6 @@ package kafka.admin
import kafka.api.TopicMetadata import kafka.api.TopicMetadata
import org.junit.Assert._ import org.junit.Assert._
import org.apache.kafka.common.protocol.SecurityProtocol
import kafka.zk.ZooKeeperTestHarness import kafka.zk.ZooKeeperTestHarness
import kafka.utils.TestUtils._ import kafka.utils.TestUtils._
import kafka.utils.TestUtils import kafka.utils.TestUtils
@ -28,6 +27,7 @@ import kafka.client.ClientUtils
import kafka.server.{KafkaConfig, KafkaServer} import kafka.server.{KafkaConfig, KafkaServer}
import org.apache.kafka.common.errors.InvalidReplicaAssignmentException import org.apache.kafka.common.errors.InvalidReplicaAssignmentException
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.{After, Before, Test} import org.junit.{After, Before, Test}
class AddPartitionsTest extends ZooKeeperTestHarness { class AddPartitionsTest extends ZooKeeperTestHarness {

View File

@ -20,7 +20,7 @@ import java.util.Properties
import kafka.admin.ConfigCommand.ConfigCommandOptions import kafka.admin.ConfigCommand.ConfigCommandOptions
import kafka.common.InvalidConfigException import kafka.common.InvalidConfigException
import kafka.server.{ConfigEntityName, QuotaId} import kafka.server.ConfigEntityName
import kafka.utils.{Logging, ZkUtils} import kafka.utils.{Logging, ZkUtils}
import kafka.zk.ZooKeeperTestHarness import kafka.zk.ZooKeeperTestHarness

View File

@ -26,7 +26,8 @@ import TestUtils.createBroker
import java.nio.ByteBuffer import java.nio.ByteBuffer
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.{Errors, SecurityProtocol} import org.apache.kafka.common.protocol.Errors
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.utils.Time import org.apache.kafka.common.utils.Time
import org.junit._ import org.junit._
import org.scalatest.junit.JUnitSuite import org.scalatest.junit.JUnitSuite

View File

@ -19,7 +19,7 @@ package kafka.cluster
import kafka.utils.TestUtils import kafka.utils.TestUtils
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.Assert.{assertEquals, assertNotEquals, assertNull} import org.junit.Assert.{assertEquals, assertNotEquals, assertNull}
import org.junit.Test import org.junit.Test

View File

@ -24,8 +24,7 @@ import kafka.common.KafkaException
import kafka.server._ import kafka.server._
import kafka.utils.TestUtils import kafka.utils.TestUtils
import kafka.zk.ZooKeeperTestHarness import kafka.zk.ZooKeeperTestHarness
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.{KafkaPrincipal, SecurityProtocol}
import org.apache.kafka.common.security.auth.KafkaPrincipal
import org.junit.{After, Before} import org.junit.{After, Before}
import scala.collection.mutable.{ArrayBuffer, Buffer} import scala.collection.mutable.{ArrayBuffer, Buffer}

View File

@ -17,7 +17,6 @@
package kafka.log package kafka.log
import java.io.File import java.io.File
import java.util.concurrent.ConcurrentLinkedDeque
import kafka.utils.TestUtils import kafka.utils.TestUtils
import kafka.utils.TestUtils.checkEquals import kafka.utils.TestUtils.checkEquals

View File

@ -34,10 +34,10 @@ import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.memory.MemoryPool import org.apache.kafka.common.memory.MemoryPool
import org.apache.kafka.common.metrics.Metrics import org.apache.kafka.common.metrics.Metrics
import org.apache.kafka.common.network.{ChannelBuilder, ChannelState, KafkaChannel, ListenerName, NetworkReceive, NetworkSend, Selector, Send} import org.apache.kafka.common.network.{ChannelBuilder, ChannelState, KafkaChannel, ListenerName, NetworkReceive, NetworkSend, Selector, Send}
import org.apache.kafka.common.protocol.{ApiKeys, SecurityProtocol} import org.apache.kafka.common.protocol.ApiKeys
import org.apache.kafka.common.record.{MemoryRecords, RecordBatch} import org.apache.kafka.common.record.MemoryRecords
import org.apache.kafka.common.requests.{AbstractRequest, ProduceRequest, RequestHeader} import org.apache.kafka.common.requests.{AbstractRequest, ProduceRequest, RequestHeader}
import org.apache.kafka.common.security.auth.KafkaPrincipal import org.apache.kafka.common.security.auth.{KafkaPrincipal, SecurityProtocol}
import org.apache.kafka.common.utils.{LogContext, MockTime, Time} import org.apache.kafka.common.utils.{LogContext, MockTime, Time}
import org.junit.Assert._ import org.junit.Assert._
import org.junit._ import org.junit._

View File

@ -20,7 +20,7 @@ package kafka.producer
import java.util.Properties import java.util.Properties
import java.util.concurrent.LinkedBlockingQueue import java.util.concurrent.LinkedBlockingQueue
import org.apache.kafka.common.protocol.{Errors, SecurityProtocol} import org.apache.kafka.common.protocol.Errors
import org.junit.Assert.{assertEquals, assertTrue} import org.junit.Assert.{assertEquals, assertTrue}
import org.easymock.EasyMock import org.easymock.EasyMock
import org.junit.Test import org.junit.Test
@ -36,6 +36,7 @@ import kafka.utils.TestUtils._
import scala.collection.Map import scala.collection.Map
import scala.collection.mutable.ArrayBuffer import scala.collection.mutable.ArrayBuffer
import kafka.utils._ import kafka.utils._
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.utils.Time import org.apache.kafka.common.utils.Time
@deprecated("This test has been deprecated and it will be removed in a future release.", "0.10.0.0") @deprecated("This test has been deprecated and it will be removed in a future release.", "0.10.0.0")

View File

@ -20,7 +20,7 @@ package kafka.server
import org.junit.Assert._ import org.junit.Assert._
import kafka.utils.TestUtils import kafka.utils.TestUtils
import kafka.zk.ZooKeeperTestHarness import kafka.zk.ZooKeeperTestHarness
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.{After, Test} import org.junit.{After, Test}
import scala.collection.mutable.ArrayBuffer import scala.collection.mutable.ArrayBuffer

View File

@ -27,8 +27,9 @@ import kafka.network.SocketServer
import kafka.utils._ import kafka.utils._
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.types.Struct import org.apache.kafka.common.protocol.types.Struct
import org.apache.kafka.common.protocol.{ApiKeys, SecurityProtocol} import org.apache.kafka.common.protocol.ApiKeys
import org.apache.kafka.common.requests.{AbstractRequest, AbstractRequestResponse, RequestHeader, ResponseHeader} import org.apache.kafka.common.requests.{AbstractRequest, AbstractRequestResponse, RequestHeader, ResponseHeader}
import org.apache.kafka.common.security.auth.SecurityProtocol
abstract class BaseRequestTest extends KafkaServerTestHarness { abstract class BaseRequestTest extends KafkaServerTestHarness {
private var correlationId = 0 private var correlationId = 0

View File

@ -22,7 +22,6 @@ import org.apache.kafka.common.metrics.{MetricConfig, Metrics, Quota, Sanitizer}
import org.apache.kafka.common.utils.MockTime import org.apache.kafka.common.utils.MockTime
import org.junit.Assert.{assertEquals, assertTrue} import org.junit.Assert.{assertEquals, assertTrue}
import org.junit.{Before, Test} import org.junit.{Before, Test}
import kafka.admin.ConfigCommand
class ClientQuotaManagerTest { class ClientQuotaManagerTest {
private val time = new MockTime private val time = new MockTime

View File

@ -27,9 +27,10 @@ import kafka.utils._
import org.apache.kafka.common.TopicPartition import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.types.Type import org.apache.kafka.common.protocol.types.Type
import org.apache.kafka.common.protocol.{ApiKeys, Errors, SecurityProtocol} import org.apache.kafka.common.protocol.{ApiKeys, Errors}
import org.apache.kafka.common.record.{CompressionType, SimpleRecord, RecordBatch, MemoryRecords} import org.apache.kafka.common.record.{CompressionType, MemoryRecords, SimpleRecord}
import org.apache.kafka.common.requests.{ProduceRequest, ProduceResponse, ResponseHeader} import org.apache.kafka.common.requests.{ProduceRequest, ProduceResponse, ResponseHeader}
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.Assert._ import org.junit.Assert._
import org.junit.Test import org.junit.Test

View File

@ -37,12 +37,12 @@ import org.apache.kafka.common.errors.UnsupportedVersionException
import org.apache.kafka.common.memory.MemoryPool import org.apache.kafka.common.memory.MemoryPool
import org.apache.kafka.common.metrics.Metrics import org.apache.kafka.common.metrics.Metrics
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.{ApiKeys, Errors, SecurityProtocol} import org.apache.kafka.common.protocol.{ApiKeys, Errors}
import org.apache.kafka.common.record.RecordBatch import org.apache.kafka.common.record.RecordBatch
import org.apache.kafka.common.requests.ProduceResponse.PartitionResponse import org.apache.kafka.common.requests.ProduceResponse.PartitionResponse
import org.apache.kafka.common.requests.WriteTxnMarkersRequest.TxnMarkerEntry import org.apache.kafka.common.requests.WriteTxnMarkersRequest.TxnMarkerEntry
import org.apache.kafka.common.requests._ import org.apache.kafka.common.requests._
import org.apache.kafka.common.security.auth.KafkaPrincipal import org.apache.kafka.common.security.auth.{KafkaPrincipal, SecurityProtocol}
import org.apache.kafka.common.utils.Utils import org.apache.kafka.common.utils.Utils
import org.easymock.{Capture, EasyMock, IAnswer} import org.easymock.{Capture, EasyMock, IAnswer}
import org.junit.Assert.{assertEquals, assertTrue} import org.junit.Assert.{assertEquals, assertTrue}

View File

@ -26,7 +26,7 @@ import kafka.utils.{CoreUtils, TestUtils}
import org.apache.kafka.common.config.ConfigException import org.apache.kafka.common.config.ConfigException
import org.apache.kafka.common.metrics.Sensor import org.apache.kafka.common.metrics.Sensor
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.SecurityProtocol import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.Assert._ import org.junit.Assert._
import org.junit.Test import org.junit.Test
import org.scalatest.Assertions.intercept import org.scalatest.Assertions.intercept

View File

@ -30,7 +30,8 @@ import kafka.utils.TestUtils._
import kafka.zk.ZooKeeperTestHarness import kafka.zk.ZooKeeperTestHarness
import org.apache.kafka.common.metrics.Metrics import org.apache.kafka.common.metrics.Metrics
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.{ApiKeys, Errors, SecurityProtocol} import org.apache.kafka.common.protocol.{ApiKeys, Errors}
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.utils.Time import org.apache.kafka.common.utils.Time
import org.junit.{After, Before, Test} import org.junit.{After, Before, Test}

View File

@ -22,9 +22,10 @@ import util.Arrays.asList
import kafka.common.BrokerEndPointNotAvailableException import kafka.common.BrokerEndPointNotAvailableException
import org.apache.kafka.common.TopicPartition import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.{ApiKeys, Errors, SecurityProtocol} import org.apache.kafka.common.protocol.{ApiKeys, Errors}
import org.apache.kafka.common.requests.UpdateMetadataRequest import org.apache.kafka.common.requests.UpdateMetadataRequest
import org.apache.kafka.common.requests.UpdateMetadataRequest.{Broker, EndPoint} import org.apache.kafka.common.requests.UpdateMetadataRequest.{Broker, EndPoint}
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.junit.Test import org.junit.Test
import org.junit.Assert._ import org.junit.Assert._

View File

@ -20,7 +20,7 @@ package kafka.server
import kafka.utils.TestUtils import kafka.utils.TestUtils
import org.apache.kafka.common.TopicPartition import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.protocol.{ApiKeys, Errors} import org.apache.kafka.common.protocol.{ApiKeys, Errors}
import org.apache.kafka.common.record.{CompressionType, DefaultRecordBatch, MemoryRecords, RecordBatch, SimpleRecord} import org.apache.kafka.common.record.{CompressionType, DefaultRecordBatch, MemoryRecords, SimpleRecord}
import org.apache.kafka.common.requests.{ProduceRequest, ProduceResponse} import org.apache.kafka.common.requests.{ProduceRequest, ProduceResponse}
import org.junit.Assert._ import org.junit.Assert._
import org.junit.Test import org.junit.Test

View File

@ -30,12 +30,12 @@ import org.apache.kafka.common.resource.{ResourceFilter, Resource => AdminResour
import org.apache.kafka.common.{Node, TopicPartition} import org.apache.kafka.common.{Node, TopicPartition}
import org.apache.kafka.common.metrics.{KafkaMetric, Quota, Sensor} import org.apache.kafka.common.metrics.{KafkaMetric, Quota, Sensor}
import org.apache.kafka.common.network.ListenerName import org.apache.kafka.common.network.ListenerName
import org.apache.kafka.common.protocol.{ApiKeys, SecurityProtocol} import org.apache.kafka.common.protocol.ApiKeys
import org.apache.kafka.common.protocol.types.Struct import org.apache.kafka.common.protocol.types.Struct
import org.apache.kafka.common.record._ import org.apache.kafka.common.record._
import org.apache.kafka.common.requests.CreateAclsRequest.AclCreation import org.apache.kafka.common.requests.CreateAclsRequest.AclCreation
import org.apache.kafka.common.requests.{Resource => RResource, ResourceType => RResourceType, _} import org.apache.kafka.common.requests.{Resource => RResource, ResourceType => RResourceType, _}
import org.apache.kafka.common.security.auth.{AuthenticationContext, KafkaPrincipal, KafkaPrincipalBuilder} import org.apache.kafka.common.security.auth.{AuthenticationContext, KafkaPrincipal, KafkaPrincipalBuilder, SecurityProtocol}
import org.junit.Assert._ import org.junit.Assert._
import org.junit.{After, Before, Test} import org.junit.{After, Before, Test}

View File

@ -19,7 +19,7 @@ package kafka.server
import java.net.Socket import java.net.Socket
import java.util.Collections import java.util.Collections
import org.apache.kafka.common.protocol.{ApiKeys, Errors, SecurityProtocol} import org.apache.kafka.common.protocol.{ApiKeys, Errors}
import org.apache.kafka.common.requests.{ApiVersionsRequest, ApiVersionsResponse} import org.apache.kafka.common.requests.{ApiVersionsRequest, ApiVersionsResponse}
import org.apache.kafka.common.requests.SaslHandshakeRequest import org.apache.kafka.common.requests.SaslHandshakeRequest
import org.apache.kafka.common.requests.SaslHandshakeResponse import org.apache.kafka.common.requests.SaslHandshakeResponse
@ -27,6 +27,7 @@ import org.junit.{After, Before, Test}
import org.junit.Assert._ import org.junit.Assert._
import kafka.api.{KafkaSasl, SaslSetup} import kafka.api.{KafkaSasl, SaslSetup}
import kafka.utils.JaasTestUtils import kafka.utils.JaasTestUtils
import org.apache.kafka.common.security.auth.SecurityProtocol
class SaslApiVersionsRequestTest extends BaseRequestTest with SaslSetup { class SaslApiVersionsRequestTest extends BaseRequestTest with SaslSetup {
override protected def securityProtocol = SecurityProtocol.SASL_PLAINTEXT override protected def securityProtocol = SecurityProtocol.SASL_PLAINTEXT

View File

@ -47,8 +47,8 @@ import org.apache.kafka.common.TopicPartition
import org.apache.kafka.common.header.Header import org.apache.kafka.common.header.Header
import org.apache.kafka.common.internals.Topic import org.apache.kafka.common.internals.Topic
import org.apache.kafka.common.network.{ListenerName, Mode} import org.apache.kafka.common.network.{ListenerName, Mode}
import org.apache.kafka.common.protocol.SecurityProtocol
import org.apache.kafka.common.record._ import org.apache.kafka.common.record._
import org.apache.kafka.common.security.auth.SecurityProtocol
import org.apache.kafka.common.serialization.{ByteArraySerializer, Serializer} import org.apache.kafka.common.serialization.{ByteArraySerializer, Serializer}
import org.apache.kafka.common.utils.Time import org.apache.kafka.common.utils.Time
import org.apache.kafka.common.utils.Utils._ import org.apache.kafka.common.utils.Utils._

View File

@ -81,6 +81,8 @@
metric named <code>records-consumed-total</code>.</li> metric named <code>records-consumed-total</code>.</li>
<li>Mx4j will only be enabled if the system property <code>kafka_mx4jenable</code> is set to <code>true</code>. Due to a logic <li>Mx4j will only be enabled if the system property <code>kafka_mx4jenable</code> is set to <code>true</code>. Due to a logic
inversion bug, it was previously enabled by default and disabled if <code>kafka_mx4jenable</code> was set to <code>true</code>.</li> inversion bug, it was previously enabled by default and disabled if <code>kafka_mx4jenable</code> was set to <code>true</code>.</li>
<li>The package <code>org.apache.kafka.common.security.auth</code> in the clients jar has been made public and added to the javadocs.
Internal classes which had previously been located in this package have been moved elsewhere.</li>
</ul> </ul>
<h5><a id="upgrade_100_new_protocols" href="#upgrade_100_new_protocols">New Protocol Versions</a></h5> <h5><a id="upgrade_100_new_protocols" href="#upgrade_100_new_protocols">New Protocol Versions</a></h5>

View File

@ -20,7 +20,7 @@ import net.sourceforge.argparse4j.ArgumentParsers;
import net.sourceforge.argparse4j.inf.ArgumentParser; import net.sourceforge.argparse4j.inf.ArgumentParser;
import net.sourceforge.argparse4j.inf.ArgumentParserException; import net.sourceforge.argparse4j.inf.ArgumentParserException;
import net.sourceforge.argparse4j.inf.Namespace; import net.sourceforge.argparse4j.inf.Namespace;
import org.apache.kafka.common.protocol.SecurityProtocol; import org.apache.kafka.common.security.auth.SecurityProtocol;
import org.apache.kafka.common.utils.Exit; import org.apache.kafka.common.utils.Exit;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator; import org.apache.log4j.PropertyConfigurator;