mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-05-06 04:42:36 +02:00
identity providers and bearerauth
This commit is contained in:
parent
5f3d4df33a
commit
626b7fa3e9
32 changed files with 1317 additions and 12 deletions
18
service/api/authorization/auth-manager.go
Normal file
18
service/api/authorization/auth-manager.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package authorization
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/notherealmarco/WASAPhoto/service/api/reqcontext"
|
||||
)
|
||||
|
||||
func BuildAuth(header string) (reqcontext.Authorization, error) {
|
||||
auth, err := BuildBearer(header)
|
||||
if err != nil {
|
||||
if err.Error() == "invalid authorization header" {
|
||||
return nil, errors.New("method not supported") // todo: better error description
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
return auth, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue