From bd64f12e20b8c704e53cc3121cc93377163ef064 Mon Sep 17 00:00:00 2001 From: H Vs Date: Wed, 22 May 2024 10:40:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4acl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ScramAclsController.cs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/TelpoKafkaConsole.WebApi/Controllers/ScramAclsController.cs b/TelpoKafkaConsole.WebApi/Controllers/ScramAclsController.cs index 5d42967..12df26c 100644 --- a/TelpoKafkaConsole.WebApi/Controllers/ScramAclsController.cs +++ b/TelpoKafkaConsole.WebApi/Controllers/ScramAclsController.cs @@ -36,6 +36,22 @@ namespace TelpoKafkaConsole.WebApi.Controllers // 创建 alcs List 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() { Pattern = new ResourcePattern @@ -95,6 +111,22 @@ namespace TelpoKafkaConsole.WebApi.Controllers // 创建 alcs List 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() { Pattern = new ResourcePattern