mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-05-30 02:15:40 +02:00
More auth CLi
This commit is contained in:
parent
f388fd9c90
commit
e309775ac1
8 changed files with 257 additions and 23 deletions
auth
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue