mirror of
https://github.com/balkian/mqtt-poc.git
synced 2025-07-01 21:22:22 +00:00
22 lines
441 B
Go
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
|
|
}
|