英文:
How to add additional topic permissions in RBMQ with definitions.json
问题
有人知道如何通过definitions.json配置文件为用户提供额外的主题权限(例如amq.topic)吗?(我知道可以通过管理控制台设置,但我不想手动设置。)
我已经尝试了以下方法,但没有提供额外的主题权限:
{
"user": "guest",
"vhost": "/",
"configure": ".*",
"write": ".*",
"read": ".*"
},
{
"user": "guest",
"vhost": "/",
"configure": "amq.topic",
"write": ".*",
"read": ".*"
}
英文:
Does anybody know how to give a user additional topic permissions (e.g. amq.topic) through the definitions.json config file? (I know it's possible through the management console, but I don't want to set it up manually.)
I already tried following which is not giving any additional topic permissions:
{
"user": "guest",
"vhost": "/",
"configure": ".*",
"write": ".*",
"read": ".*"
},
{
"user": "guest",
"vhost": "/",
"configure": "amq.topic",
"write": ".*",
"read": ".*"
},
答案1
得分: 2
你需要添加一个"topic_permissions"部分,其中包含你想要的配置:
"topic_permissions": [
{
"user": "guest",
"vhost": "/",
"exchange": "amq.topic",
"write": "[^.]+\\.sample\\.[^.]+",
"read": ""
}
]
通常,我会手动在管理界面中创建这些内容,然后导出定义以查看它们是如何被“翻译”的。
英文:
You need to add a topic_permissions section, with the config you want:
"topic_permissions": [
{
"user": "guest",
"vhost": "/",
"exchange": "amq.topic",
"write": "[^.]+\\.sample\\.[^.]+",
"read": ""
}
]
To figure out those things, I usually create them manually in the admin interface, then export the definition to see how it is "translated".
答案2
得分: 0
查看来自(填写用户名/密码)的topic_permissions
部分:
curl --silent --user yourusername:yourpass --header "Content-type: application/json" http://127.0.0.1:15672/api/definitions | jq . | tee config.json
或者不包含交换机的示例:
"topic_permissions": [
{
"user": "yourusername",
"vhost": "/",
"exchange": "",
"write": ".*",
"read": ".*"
}
]
英文:
See topic_permissions
section from (fill user/pass):
curl --silent --user yourusername:yourpass --header "Content-type: application/json" http://127.0.0.1:15672/api/definitions | jq . | tee config.json
Or example without exchange:
"topic_permissions": [
{
"user": "yourusername",
"vhost": "/",
"exchange": "",
"write": ".*",
"read": ".*"
}
]
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论