begin parsing
This commit is contained in:
parent
4b2f7c9de4
commit
3d5de74d02
4 changed files with 73 additions and 17 deletions
|
@ -4,11 +4,24 @@ import (
|
|||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/schema"
|
||||
|
||||
"github.com/caos/oidc/pkg/oidc"
|
||||
)
|
||||
|
||||
func ParseAuthRequest(w http.ResponseWriter, r *http.Request) (*oidc.AuthRequest, error) {
|
||||
return nil, errors.New("Unimplemented") //TODO: impl
|
||||
err := r.ParseForm()
|
||||
if err != nil {
|
||||
return nil, errors.New("Unimplemented") //TODO: impl
|
||||
}
|
||||
authReq := new(oidc.AuthRequest)
|
||||
|
||||
//TODO:
|
||||
d := schema.NewDecoder()
|
||||
d.IgnoreUnknownKeys(true)
|
||||
|
||||
err = d.Decode(authReq, r.Form)
|
||||
return authReq, err
|
||||
}
|
||||
|
||||
func ValidateAuthRequest(authRequest *oidc.AuthRequest) error {
|
||||
|
|
|
@ -14,5 +14,6 @@ require (
|
|||
github.com/caos/oidc/pkg/utils v0.0.0-00010101000000-000000000000
|
||||
github.com/caos/utils/logging v0.0.0-20191104132131-b318678afbef
|
||||
github.com/gorilla/mux v1.7.3
|
||||
github.com/gorilla/schema v1.1.0
|
||||
github.com/stretchr/testify v1.4.0
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue