Skip to content

Annotations need to be updated! #127

Open
@Swayingleaves

Description

@Swayingleaves

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions