kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject kafka git commit: KAFKA-2838; Allow comma in super users, allow comma in CLI authz prop…
Date Sat, 14 Nov 2015 01:36:22 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.9.0 8857d279f -> 3c33858fb


KAFKA-2838; Allow comma in super users, allow comma in CLI authz prop…

…erties.

Author: Parth Brahmbhatt <brahmbhatt.parth@gmail.com>

Reviewers: Sriharsha Chintalapani <harsha@hortonworks.com>, Jun Rao <junrao@gmail.com>

Closes #529 from Parth-Brahmbhatt/KAFKA-2838

(cherry picked from commit 8e6bae21c64699245cf24dbaac3942f32a2a241b)
Signed-off-by: Jun Rao <junrao@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/3c33858f
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/3c33858f
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/3c33858f

Branch: refs/heads/0.9.0
Commit: 3c33858fb47697764a206e760f1051cb31f05129
Parents: 8857d27
Author: Parth Brahmbhatt <brahmbhatt.parth@gmail.com>
Authored: Fri Nov 13 17:36:09 2015 -0800
Committer: Jun Rao <junrao@gmail.com>
Committed: Fri Nov 13 17:36:19 2015 -0800

----------------------------------------------------------------------
 core/src/main/scala/kafka/admin/AclCommand.scala                 | 4 +---
 .../src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala | 2 +-
 .../scala/unit/kafka/security/auth/SimpleAclAuthorizerTest.scala | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/3c33858f/core/src/main/scala/kafka/admin/AclCommand.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/admin/AclCommand.scala b/core/src/main/scala/kafka/admin/AclCommand.scala
index 3a6986f..377315d 100644
--- a/core/src/main/scala/kafka/admin/AclCommand.scala
+++ b/core/src/main/scala/kafka/admin/AclCommand.scala
@@ -257,12 +257,10 @@ object AclCommand {
       .defaultsTo(classOf[SimpleAclAuthorizer].getName)
 
     val authorizerPropertiesOpt = parser.accepts("authorizer-properties", "REQUIRED: properties
required to configure an instance of Authorizer. " +
-      "These are comma separated key=val pairs. For the default authorizer the example values
are: " +
-      "zookeeper.connect=localhost:2181")
+      "These are key=val pairs. For the default authorizer the example values are: zookeeper.connect=localhost:2181")
       .withRequiredArg
       .describedAs("authorizer-properties")
       .ofType(classOf[String])
-      .withValuesSeparatedBy(Delimiter)
 
     val topicOpt = parser.accepts("topic", "Comma separated list of topic to which acls should
be added or removed. " +
       "A value of * indicates acl should apply to all topics.")

http://git-wip-us.apache.org/repos/asf/kafka/blob/3c33858f/core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala b/core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala
index 7bfb092..76645da 100644
--- a/core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala
+++ b/core/src/main/scala/kafka/security/auth/SimpleAclAuthorizer.scala
@@ -84,7 +84,7 @@ class SimpleAclAuthorizer extends Authorizer with Logging {
     val kafkaConfig = KafkaConfig.fromProps(props)
 
     superUsers = configs.get(SimpleAclAuthorizer.SuperUsersProp).collect {
-      case str: String if str.nonEmpty => str.split(",").map(s => KafkaPrincipal.fromString(s.trim)).toSet
+      case str: String if str.nonEmpty => str.split(";").map(s => KafkaPrincipal.fromString(s.trim)).toSet
     }.getOrElse(Set.empty[KafkaPrincipal])
 
     shouldAllowEveryoneIfNoAclIsFound = configs.get(SimpleAclAuthorizer.AllowEveryoneIfNoAclIsFoundProp).map(_.toString.toBoolean).getOrElse(false)

http://git-wip-us.apache.org/repos/asf/kafka/blob/3c33858f/core/src/test/scala/unit/kafka/security/auth/SimpleAclAuthorizerTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/security/auth/SimpleAclAuthorizerTest.scala b/core/src/test/scala/unit/kafka/security/auth/SimpleAclAuthorizerTest.scala
index 6238f6d..76a768a 100644
--- a/core/src/test/scala/unit/kafka/security/auth/SimpleAclAuthorizerTest.scala
+++ b/core/src/test/scala/unit/kafka/security/auth/SimpleAclAuthorizerTest.scala
@@ -34,7 +34,7 @@ class SimpleAclAuthorizerTest extends ZooKeeperTestHarness {
   val testHostName = "test.host.com"
   var session = new Session(testPrincipal, testHostName)
   var resource: Resource = null
-  val superUsers = "User:superuser1, User:superuser2"
+  val superUsers = "User:superuser1; User:superuser2"
   val username = "alice"
   var config: KafkaConfig = null
 


Mime
View raw message