Merge branch 'master' into service-accounts

# Conflicts:
#	pkg/oidc/authorization.go
This commit is contained in:
Livio Amstutz 2020-09-07 12:36:10 +02:00
commit 6a0dd7c270
24 changed files with 395 additions and 142 deletions

View file

@ -18,6 +18,13 @@ var (
}
)
type Decoder interface {
Decode(dst interface{}, src map[string][]string) error
}
type Encoder interface {
Encode(src interface{}, dst map[string][]string) error
}
func FormRequest(endpoint string, request interface{}) (*http.Request, error) {
form := make(map[string][]string)
encoder := schema.NewEncoder()
@ -56,7 +63,7 @@ func HttpRequest(client *http.Client, req *http.Request, response interface{}) e
return nil
}
func URLEncodeResponse(resp interface{}, encoder *schema.Encoder) (string, error) {
func URLEncodeResponse(resp interface{}, encoder Encoder) (string, error) {
values := make(map[string][]string)
err := encoder.Encode(resp, values)
if err != nil {