Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions kafka/adminapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ const (
ResourceUnknown ResourceType = C.RD_KAFKA_RESOURCE_UNKNOWN
// ResourceAny - match any resource type (DescribeConfigs)
ResourceAny ResourceType = C.RD_KAFKA_RESOURCE_ANY
// ResourceTransactionalID - Transactional ID
ResourceTransactionalID ResourceType = C.RD_KAFKA_RESOURCE_TRANSACTIONAL_ID
// ResourceTopic - Topic
ResourceTopic ResourceType = C.RD_KAFKA_RESOURCE_TOPIC
// ResourceGroup - Group
Expand All @@ -512,6 +514,8 @@ func ResourceTypeFromString(typeString string) (ResourceType, error) {
switch strings.ToUpper(typeString) {
case "ANY":
return ResourceAny, nil
case "TRANSACTIONAL_ID":
return ResourceTransactionalID, nil
case "TOPIC":
return ResourceTopic, nil
case "GROUP":
Expand Down
11 changes: 10 additions & 1 deletion kafka/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2143,6 +2143,15 @@ func (its *IntegrationTestSuite) TestAdminACLs() {
Operation: ACLOperationRead,
PermissionType: ACLPermissionTypeAllow,
},
{
Type: ResourceTransactionalID,
Name: group,
ResourcePatternType: ResourcePatternTypePrefixed,
Principal: "User:test-user-2",
Host: "*",
Operation: ACLOperationAll,
PermissionType: ACLPermissionTypeAllow,
},
{
Type: ResourceTopic,
Name: topic,
Expand Down Expand Up @@ -2213,7 +2222,7 @@ func (its *IntegrationTestSuite) TestAdminACLs() {
if err != nil {
t.Fatalf("CreateACLs() failed: %s", err)
}
expectedCreateACLs = []CreateACLResult{{Error: noError}, {Error: noError}, {Error: noError}}
expectedCreateACLs = []CreateACLResult{{Error: noError}, {Error: noError}, {Error: noError}, {Error: noError}}
checkExpectedResult(expectedCreateACLs, resultCreateACLs)
}

Expand Down