Simplify API endpoints; add endpoint tests

This commit is contained in:
binwiederhier 2022-12-28 19:55:11 -05:00
parent 7ca9afad57
commit 367d024a2d
6 changed files with 113 additions and 75 deletions

View file

@ -336,8 +336,7 @@ func (a *Manager) resolvePerms(read, write bool, perm Permission) error {
return ErrUnauthorized
}
// AddUser adds a user with the given username, password and role. The password should be hashed
// before it is stored in a persistence layer.
// AddUser adds a user with the given username, password and role
func (a *Manager) AddUser(username, password string, role Role) error {
if !AllowedUsername(username) || !AllowedRole(role) {
return ErrInvalidArgument