You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2018/08/14 04:06:47 UTC

[GitHub] linhu93 edited a comment on issue #403: ACL feature request

linhu93 edited a comment on issue #403: ACL feature request
URL: https://github.com/apache/rocketmq/issues/403#issuecomment-412746295
 
 
   # 第二组,为RocketMQ添加ACL功能
    
   ## Goal
   
   为RocketMQ添加权限控制,使得某个用户对某个topic有写权限,某个group的某个consumer对某个topic有读权限。
   
   ## Design
   
   在NameServer中添加RocketMQ的权限控制表
   含义	       rocketmq.client.name	主题	               权限
   属性名	instanceName	                topic         	operation
   取值		 “name”                         “topicName”         r/w
   RocketMQ可以使用CLI admin tools实现管理。在bash mqadmin列表中添加对ACL的操作,并将权限控制表推送到NameServer上,实现对权限控制表的读写操作(其他操作后续可以扩展)。
   目前操作主要包含权限读写两类,其RequestCode分别为ACL_WRITE_CONFIG = 323和ACL_READ_CONFIG = 324。
   写入权限控制项
   bash mqadmin aclWrite -i “instanceName” -t “topic” -o “operation”
   其中operation为“r”或“w”表示读写权限
   读取权限控制项
   bash mqadmin aclRead -i “instanceName” -t “topic” -r “r”
   
   ## Impl
   
   Add adminTool impl, RpcHook impl and NameServer communication protocol.
   
   ### RPCHook相关位置添加权限审查逻辑实现
   
   实现RPCHook子类,用BrokerOuterAPI和NameServer通信,然后根据Request类型判断是否具有相应权限,没有则拒绝;
   启动Broker的地方,即BrokerStartup中注册RPCHook;
   完善BrokerOuterAPI实现Broker和NameServer的通信,拉取ACL控制表;
   
   ## Test
   
   UnitTest for most functions.
   
   ## Verification
   
   Verified,compile succeed.
   
   ## Future work
   
   NameServer listener implementation to improve cache,  namesrv act table persistence store.
   
   ## 现存问题
   
   ### RPCHook问题
   
   现有调用RPCHook的位置,只是用RPCHook进行Request的预处理和后处理,且RPCHook中的函数是返回值为void的,无法优雅地实现请求拒绝。
   
   [PR addr](https://github.com/apache/rocketmq/pull/415)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services