Search in sources :

Example 1 with KafkaAuthorizationSimpleBuilder

use of io.strimzi.api.kafka.model.KafkaAuthorizationSimpleBuilder in project strimzi by strimzi.

the class KafkaBrokerConfigurationBuilderTest method testSimpleAuthorizationWithoutSuperUsers.

@ParallelTest
public void testSimpleAuthorizationWithoutSuperUsers() {
    KafkaAuthorization auth = new KafkaAuthorizationSimpleBuilder().build();
    String configuration = new KafkaBrokerConfigurationBuilder(Reconciliation.DUMMY_RECONCILIATION).withAuthorization("my-cluster", auth).build();
    assertThat(configuration, isEquivalent("authorizer.class.name=kafka.security.authorizer.AclAuthorizer\n" + "super.users=User:CN=my-cluster-kafka,O=io.strimzi;User:CN=my-cluster-entity-topic-operator,O=io.strimzi;User:CN=my-cluster-entity-user-operator,O=io.strimzi;User:CN=my-cluster-kafka-exporter,O=io.strimzi;User:CN=my-cluster-cruise-control,O=io.strimzi;User:CN=cluster-operator,O=io.strimzi"));
}
Also used : KafkaAuthorization(io.strimzi.api.kafka.model.KafkaAuthorization) KafkaAuthorizationSimpleBuilder(io.strimzi.api.kafka.model.KafkaAuthorizationSimpleBuilder) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 2 with KafkaAuthorizationSimpleBuilder

use of io.strimzi.api.kafka.model.KafkaAuthorizationSimpleBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaBrokerConfigurationBuilderTest method testSimpleAuthorizationWithSuperUsers.

@ParallelTest
public void testSimpleAuthorizationWithSuperUsers() {
    KafkaAuthorization auth = new KafkaAuthorizationSimpleBuilder().addToSuperUsers("jakub", "CN=kuba").build();
    String configuration = new KafkaBrokerConfigurationBuilder(Reconciliation.DUMMY_RECONCILIATION).withAuthorization("my-cluster", auth).build();
    assertThat(configuration, isEquivalent("authorizer.class.name=kafka.security.authorizer.AclAuthorizer\n" + "super.users=User:CN=my-cluster-kafka,O=io.strimzi;User:CN=my-cluster-entity-topic-operator,O=io.strimzi;User:CN=my-cluster-entity-user-operator,O=io.strimzi;User:CN=my-cluster-kafka-exporter,O=io.strimzi;User:CN=my-cluster-cruise-control,O=io.strimzi;User:CN=cluster-operator,O=io.strimzi;User:jakub;User:CN=kuba"));
}
Also used : KafkaAuthorization(io.strimzi.api.kafka.model.KafkaAuthorization) KafkaAuthorizationSimpleBuilder(io.strimzi.api.kafka.model.KafkaAuthorizationSimpleBuilder) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 3 with KafkaAuthorizationSimpleBuilder

use of io.strimzi.api.kafka.model.KafkaAuthorizationSimpleBuilder in project strimzi by strimzi.

the class KafkaBrokerConfigurationBuilderTest method testSimpleAuthorizationWithSuperUsers.

@ParallelTest
public void testSimpleAuthorizationWithSuperUsers() {
    KafkaAuthorization auth = new KafkaAuthorizationSimpleBuilder().addToSuperUsers("jakub", "CN=kuba").build();
    String configuration = new KafkaBrokerConfigurationBuilder(Reconciliation.DUMMY_RECONCILIATION).withAuthorization("my-cluster", auth).build();
    assertThat(configuration, isEquivalent("authorizer.class.name=kafka.security.authorizer.AclAuthorizer\n" + "super.users=User:CN=my-cluster-kafka,O=io.strimzi;User:CN=my-cluster-entity-topic-operator,O=io.strimzi;User:CN=my-cluster-entity-user-operator,O=io.strimzi;User:CN=my-cluster-kafka-exporter,O=io.strimzi;User:CN=my-cluster-cruise-control,O=io.strimzi;User:CN=cluster-operator,O=io.strimzi;User:jakub;User:CN=kuba"));
}
Also used : KafkaAuthorization(io.strimzi.api.kafka.model.KafkaAuthorization) KafkaAuthorizationSimpleBuilder(io.strimzi.api.kafka.model.KafkaAuthorizationSimpleBuilder) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 4 with KafkaAuthorizationSimpleBuilder

use of io.strimzi.api.kafka.model.KafkaAuthorizationSimpleBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaBrokerConfigurationBuilderTest method testSimpleAuthorizationWithoutSuperUsers.

@ParallelTest
public void testSimpleAuthorizationWithoutSuperUsers() {
    KafkaAuthorization auth = new KafkaAuthorizationSimpleBuilder().build();
    String configuration = new KafkaBrokerConfigurationBuilder(Reconciliation.DUMMY_RECONCILIATION).withAuthorization("my-cluster", auth).build();
    assertThat(configuration, isEquivalent("authorizer.class.name=kafka.security.authorizer.AclAuthorizer\n" + "super.users=User:CN=my-cluster-kafka,O=io.strimzi;User:CN=my-cluster-entity-topic-operator,O=io.strimzi;User:CN=my-cluster-entity-user-operator,O=io.strimzi;User:CN=my-cluster-kafka-exporter,O=io.strimzi;User:CN=my-cluster-cruise-control,O=io.strimzi;User:CN=cluster-operator,O=io.strimzi"));
}
Also used : KafkaAuthorization(io.strimzi.api.kafka.model.KafkaAuthorization) KafkaAuthorizationSimpleBuilder(io.strimzi.api.kafka.model.KafkaAuthorizationSimpleBuilder) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Aggregations

KafkaAuthorization (io.strimzi.api.kafka.model.KafkaAuthorization)4 KafkaAuthorizationSimpleBuilder (io.strimzi.api.kafka.model.KafkaAuthorizationSimpleBuilder)4 ParallelTest (io.strimzi.test.annotations.ParallelTest)4 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)4