Open
Description
when i read /cmd/config/auth-mysql.yml
acl:
table: acl
user-column: username # or client_id, set this parameter based on the actual field name
topic-column: topic
access-column: access # 0 Deny、1 publish (Write)、2 subscribe (Read)、3 pubsub (ReadWrite)
I inserted MySQL ACL table data based on this comment, and it took me a long time to find out why I couldn't subscribe to this topic because
INSERT INTO `mqtt`.`acl` (`username`, `topic`, `access`) VALUES ('subscriber', 'devices/#', 2,);
Upon checking the code, it was discovered that the correct code mapping should be
acl:
table: acl
user-column: username # or client_id, set this parameter based on the actual field name
topic-column: topic
access-column: access #0 Deny, 1 subscribe (Read), 2 publish (Write), 3 pubsub (ReadWrite)
form mqtt/hooks/auth/ledger.go
const (
Deny Access = iota // user cannot access the topic
ReadOnly // user can only subscribe to the topic
WriteOnly // user can only publish to the topic
ReadWrite // user can both publish and subscribe to the topic
)
Metadata
Metadata
Assignees
Labels
No labels