Start refactoring

This commit is contained in:
Aurélie Delhaie
2023-05-29 17:44:50 +02:00
parent 55ac50f3be
commit c06843cd28
31 changed files with 1125 additions and 1267 deletions

View File

@@ -0,0 +1,25 @@
package authentication
import (
"errors"
"opensavecloudserver/data/repository/user"
)
type (
Authenticator interface {
Authenticate(username, password string) ([]byte, error)
Validate(token string) (Session, error)
}
Session interface {
UserID() user.ID
Scopes() []Scope
Roles() []user.Role
}
Scope string
)
var (
ErrBadPassword = errors.New("failed to verify password")
)