Browse Source

调整acl

develop
H Vs 9 months ago
parent
commit
bd64f12e20
1 changed files with 32 additions and 0 deletions
  1. +32
    -0
      TelpoKafkaConsole.WebApi/Controllers/ScramAclsController.cs

+ 32
- 0
TelpoKafkaConsole.WebApi/Controllers/ScramAclsController.cs View File

@@ -36,6 +36,22 @@ namespace TelpoKafkaConsole.WebApi.Controllers
// 创建 alcs // 创建 alcs
List<AclBinding> aclBindings = new() List<AclBinding> aclBindings = new()
{ {
new AclBinding()
{
Pattern = new ResourcePattern
{
Type = ResourceType.Broker,
Name = "kafka-cluster",
ResourcePatternType = ResourcePatternType.Literal
},
Entry = new AccessControlEntry
{
Principal = $"User:{consumer.Name}",
Host = "*",
Operation = AclOperation.All,
PermissionType = AclPermissionType.Deny
}
},
new AclBinding() new AclBinding()
{ {
Pattern = new ResourcePattern Pattern = new ResourcePattern
@@ -95,6 +111,22 @@ namespace TelpoKafkaConsole.WebApi.Controllers
// 创建 alcs // 创建 alcs
List<AclBinding> aclBindings = new() List<AclBinding> aclBindings = new()
{ {
new AclBinding()
{
Pattern = new ResourcePattern
{
Type = ResourceType.Broker,
Name = "kafka-cluster",
ResourcePatternType = ResourcePatternType.Literal
},
Entry = new AccessControlEntry
{
Principal = $"User:{producer.Name}",
Host = "*",
Operation = AclOperation.All,
PermissionType = AclPermissionType.Deny
}
},
new AclBinding() new AclBinding()
{ {
Pattern = new ResourcePattern Pattern = new ResourcePattern


Loading…
Cancel
Save