mirror of
https://github.com/fhmq/hmq.git
synced 2026-08-31 14:54:52 +00:00
replace plugin
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"github.com/fhmq/rhmq/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{}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user