mirror of
https://github.com/fhmq/hmq.git
synced 2026-04-24 10:38:34 +00:00
24 lines
358 B
Go
24 lines
358 B
Go
package auth
|
|
|
|
import (
|
|
"github.com/fhmq/hmq/plugins/auth/authhttp"
|
|
)
|
|
|
|
const (
|
|
AuthHTTP = "authhttp"
|
|
)
|
|
|
|
type Auth interface {
|
|
CheckACL(action, username, topic string) bool
|
|
CheckConnect(clientID, username, password string) bool
|
|
}
|
|
|
|
func NewAuth(name string) Auth {
|
|
switch name {
|
|
case AuthHTTP:
|
|
return authhttp.Init()
|
|
default:
|
|
return &mockAuth{}
|
|
}
|
|
}
|