Skip to content

Commit

Permalink
fixup! feat (config): add support for a http.RoundTripper
Browse files Browse the repository at this point in the history
  • Loading branch information
jimlambrt committed Aug 1, 2024
1 parent 09a526c commit df91265
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion oidc/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func (c *Config) Validate() error {
}
}
if c.ProviderCA != "" && c.RoundTripper != nil {
return fmt.Errorf("%s: you cannot specify both a ProviderCA and Transport: %w", op, ErrInvalidParameter)
return fmt.Errorf("%s: you cannot specify both a ProviderCA and RoundTripper: %w", op, ErrInvalidParameter)
}

if c.ProviderConfig != nil {
Expand Down
2 changes: 1 addition & 1 deletion oidc/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ func (p *Provider) HTTPClient() (*http.Client, error) {

switch {
case p.config.RoundTripper != nil && p.config.ProviderCA != "":
return nil, fmt.Errorf("%s: you cannot specify config for both a ProviderCA and Transport: %w", op, ErrInvalidParameter)
return nil, fmt.Errorf("%s: you cannot specify config for both a ProviderCA and RoundTripper: %w", op, ErrInvalidParameter)
case p.config.ProviderCA != "":
certPool := x509.NewCertPool()
if ok := certPool.AppendCertsFromPEM([]byte(p.config.ProviderCA)); !ok {
Expand Down
2 changes: 1 addition & 1 deletion oidc/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ func TestHTTPClient(t *testing.T) {
_, err := p.HTTPClient()
require.Error(t, err)
assert.ErrorIs(t, err, ErrInvalidParameter)
assert.ErrorContains(t, err, "you cannot specify config for both a ProviderCA and Transport")
assert.ErrorContains(t, err, "you cannot specify config for both a ProviderCA and RoundTripper")
})
}

Expand Down

0 comments on commit df91265

Please sign in to comment.