identity providers and bearerauth

This commit is contained in:
Marco Realacci 2022-11-18 13:05:40 +01:00
parent 5f3d4df33a
commit 626b7fa3e9
32 changed files with 1317 additions and 12 deletions

View file

@ -8,6 +8,7 @@ package reqcontext
import (
"github.com/gofrs/uuid"
"github.com/notherealmarco/WASAPhoto/service/database"
"github.com/sirupsen/logrus"
)
@ -18,4 +19,12 @@ type RequestContext struct {
// Logger is a custom field logger for the request
Logger logrus.FieldLogger
Auth Authorization
}
type Authorization interface {
GetType() string
Authorized(db database.AppDatabase) (bool, error)
UserAuthorized(db database.AppDatabase, uid string) (bool, error)
}