Files
hmq/plugins/auth/authfile/acl.go
turtletramp 6be79cbe88 Bugfix - authfile plugin did wrongly use username as IP and IP as username in ACL checks (#100)
* adding test + fix issue with wrong order in acl check

* reduce to featureset from original fork
2020-12-02 10:05:46 +08:00

24 lines
472 B
Go

package acl
type aclAuth struct {
config *ACLConfig
}
func Init() *aclAuth {
aclConfig, err := AclConfigLoad("./plugins/auth/authfile/acl.conf")
if err != nil {
panic(err)
}
return &aclAuth{
config: aclConfig,
}
}
func (a *aclAuth) CheckConnect(clientID, username, password string) bool {
return true
}
func (a *aclAuth) CheckACL(action, clientID, username, ip, topic string) bool {
return checkTopicAuth(a.config, action, ip, username, clientID, topic)
}