mirror of
https://github.com/fhmq/hmq.git
synced 2026-04-24 10:38:34 +00:00
* adding test + fix issue with wrong order in acl check * reduce to featureset from original fork
24 lines
472 B
Go
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)
|
|
}
|