mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-05-05 20:32:35 +02:00
Solved some todo(s)
This commit is contained in:
parent
05acfb045f
commit
a3cf4f17f8
5 changed files with 27 additions and 30 deletions
|
@ -8,19 +8,9 @@ package reqcontext
|
|||
|
||||
import (
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/notherealmarco/WASAPhoto/service/database"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type AuthStatus int
|
||||
|
||||
const (
|
||||
AUTHORIZED = 0
|
||||
UNAUTHORIZED = 1
|
||||
FORBIDDEN = 2
|
||||
USER_NOT_FOUND = 3
|
||||
) // todo: here?
|
||||
|
||||
// RequestContext is the context of the request, for request-dependent parameters
|
||||
type RequestContext struct {
|
||||
// ReqUUID is the request unique ID
|
||||
|
@ -31,10 +21,3 @@ type RequestContext struct {
|
|||
|
||||
Auth Authorization
|
||||
}
|
||||
|
||||
type Authorization interface {
|
||||
GetType() string
|
||||
GetUserID() string
|
||||
Authorized(db database.AppDatabase) (AuthStatus, error)
|
||||
UserAuthorized(db database.AppDatabase, uid string) (AuthStatus, error)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue