Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acl.conf的配置被覆盖了 #14

Open
GordonHuangYong opened this issue Mar 15, 2021 · 1 comment
Open

acl.conf的配置被覆盖了 #14

GordonHuangYong opened this issue Mar 15, 2021 · 1 comment

Comments

@GordonHuangYong
Copy link

GordonHuangYong commented Mar 15, 2021

插件中, onClientCheckAcl覆盖了acl.conf的配置.

而官方文档中描述

内置 ACL 是优先级最低规则表,在所有的 ACL 检查完成后,如果仍然未命中则检查默认的 ACL 规则。

期望此插件不要覆盖acl.conf. 可以做成像认证那样, 做成链式检查.

acl.conf

{allow, {user, "dashboard"}, subscribe, ["$SYS/#"]}.

{allow, {ipaddr, "127.0.0.1"}, pubsub, ["$SYS/#", "#"]}.

{deny, all, subscribe, ["$SYS/#", {eq, "#"}, {eq, "/test"}]}.

{allow, all}.

java

@Override
    public boolean onClientCheckAcl(ClientInfo clientInfo, PubSub pubsub, Topic topic, boolean result) {
        System.err.printf("[Java] onClientCheckAcl: clientinfo: %s, pubsub: %s, topic: %s, result: %s\n", clientInfo, pubsub, topic, result);
       //false, 发现所有主题都不能订阅了
       //true, 可以订阅任意主题.包括"/test"
        return false;
    }
@HJianBo
Copy link
Member

HJianBo commented Mar 16, 2021

This is because you returned false, so the ACL check failed.

Returning a value like ignore is not currently supported on 4.2.x implementations. However, it is supported in the 4.3 implementations. You can try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants