More auth CLi
This commit is contained in:
10
auth/auth.go
10
auth/auth.go
@@ -2,12 +2,18 @@ package auth
|
||||
|
||||
import "errors"
|
||||
|
||||
// auth is a generic interface to implement password-based authentication and authorization
|
||||
type Auth interface {
|
||||
// Auther is a generic interface to implement password-based authentication and authorization
|
||||
type Auther interface {
|
||||
Authenticate(user, pass string) (*User, error)
|
||||
Authorize(user *User, topic string, perm Permission) error
|
||||
}
|
||||
|
||||
type Manager interface {
|
||||
AddUser(username, password string, role Role) error
|
||||
RemoveUser(username string) error
|
||||
ChangePassword(username, password string) error
|
||||
}
|
||||
|
||||
type User struct {
|
||||
Name string
|
||||
Role Role
|
||||
|
||||
Reference in New Issue
Block a user