1
0
mirror of https://github.com/balkian/mqtt-poc.git synced 2025-07-01 21:22:22 +00:00
mqtt-poc/golang/auth.go
J. Fernando Sánchez a1e0d0b4b0 First commit
2018-02-22 17:38:21 +01:00

22 lines
441 B
Go

package main
import "github.com/VolantMQ/volantmq/auth"
type internalAuth struct {
creds map[string]string
}
func (a internalAuth) Password(user, password string) auth.Status {
if hash, ok := a.creds[user]; ok {
if password == hash {
return auth.StatusAllow
}
}
return auth.StatusDeny
}
// nolint: golint
func (a internalAuth) ACL(clientID, user, topic string, access auth.AccessType) auth.Status {
return auth.StatusAllow
}