Use OIDC config for retrieving user information (#3006)

Also extracts a request.NewClient method
This commit is contained in:
andig 2022-03-26 10:52:06 +01:00 • committed by GitHub
parent 4a921e3825
commit 10449032ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 55 additions and 88 deletions

View file

@ -17,16 +17,19 @@ type Helper struct {
*http.Client
}
// NewClient creates http client with default transport
func NewClient(log *util.Logger) *http.Client {
return &http.Client{
Timeout: Timeout,
Transport: NewTripper(log, transport.Default()),
}
}
// NewHelper creates http helper for simplified PUT GET logic
func NewHelper(log *util.Logger) *Helper {
r := &Helper{
Client: &http.Client{
Timeout: Timeout,
Transport: NewTripper(log, transport.Default()),
},
return &Helper{
Client: NewClient(log),
}
return r
}
// DoBody executes HTTP request and returns the response body