Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #11 from CloudKarafka/acl-bug
Browse files Browse the repository at this point in the history
prefix User to principal
  • Loading branch information
snichme authored Aug 31, 2020
2 parents a11d2f9 + 1572087 commit 54a3c0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/api/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,15 @@ func aclRequestFromHttpRequest(r *http.Request, checkKeys bool) (zookeeper.AclRe
}
}
}
principal := acl["principal"]
if !strings.HasPrefix(principal, "User:") {
principal = fmt.Sprintf("User:%s", principal)
}
req := zookeeper.AclRequest{
ResourceType: resource,
PatternType: pattern,
Name: acl["name"],
Principal: acl["principal"],
Principal: principal,
Permission: strings.ToUpper(acl["permission"]),
PermissionType: strings.ToUpper(acl["permission_type"]),
Host: acl["host"],
Expand Down

0 comments on commit 54a3c0d

Please sign in to comment.