1
0
Fork 0
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:
Philipp Heckel 2022-01-23 00:54:18 -05:00
parent f388fd9c90
commit e309775ac1
8 changed files with 257 additions and 23 deletions

View file

@ -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