en/decoding abstraction
This commit is contained in:
parent
2966355b0e
commit
4a10ffaaa2
13 changed files with 367 additions and 69 deletions
|
@ -7,11 +7,10 @@ import (
|
|||
|
||||
"github.com/caos/oidc/pkg/oidc"
|
||||
"github.com/caos/oidc/pkg/utils"
|
||||
"github.com/gorilla/schema"
|
||||
)
|
||||
|
||||
type UserinfoProvider interface {
|
||||
Decoder() *schema.Decoder
|
||||
Decoder() utils.Decoder
|
||||
Crypto() Crypto
|
||||
Storage() Storage
|
||||
}
|
||||
|
@ -35,7 +34,7 @@ func Userinfo(w http.ResponseWriter, r *http.Request, userinfoProvider UserinfoP
|
|||
utils.MarshalJSON(w, info)
|
||||
}
|
||||
|
||||
func getAccessToken(r *http.Request, decoder *schema.Decoder) (string, error) {
|
||||
func getAccessToken(r *http.Request, decoder utils.Decoder) (string, error) {
|
||||
authHeader := r.Header.Get("authorization")
|
||||
if authHeader != "" {
|
||||
parts := strings.Split(authHeader, "Bearer ")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue