cd686ffdf3
This change updates the TLS config used by all pinniped components. There are no configuration knobs associated with this change. Thus this change tightens our static defaults. There are four TLS config levels: 1. Secure (TLS 1.3 only) 2. Default (TLS 1.2+ best ciphers that are well supported) 3. Default LDAP (TLS 1.2+ with less good ciphers) 4. Legacy (currently unused, TLS 1.2+ with all non-broken ciphers) Highlights per component: 1. pinniped CLI - uses "secure" config against KAS - uses "default" for all other connections 2. concierge - uses "secure" config as an aggregated API server - uses "default" config as a impersonation proxy API server - uses "secure" config against KAS - uses "default" config for JWT authenticater (mostly, see code) - no changes to webhook authenticater (see code) 3. supervisor - uses "default" config as a server - uses "secure" config against KAS - uses "default" config against OIDC IDPs - uses "default LDAP" config against LDAP IDPs Signed-off-by: Monis Khan <mok@vmware.com>
38 lines
786 B
Go
38 lines
786 B
Go
// Copyright 2021 the Pinniped contributors. All Rights Reserved.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package roundtripper
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"k8s.io/apimachinery/pkg/util/net"
|
|
)
|
|
|
|
var _ http.RoundTripper = Func(nil)
|
|
|
|
type Func func(*http.Request) (*http.Response, error)
|
|
|
|
func (f Func) RoundTrip(req *http.Request) (*http.Response, error) {
|
|
return f(req)
|
|
}
|
|
|
|
var _ net.RoundTripperWrapper = &wrapper{}
|
|
|
|
type wrapper struct {
|
|
delegate http.RoundTripper
|
|
f Func
|
|
}
|
|
|
|
func (w *wrapper) RoundTrip(req *http.Request) (*http.Response, error) {
|
|
return w.f.RoundTrip(req)
|
|
}
|
|
|
|
func (w *wrapper) WrappedRoundTripper() http.RoundTripper {
|
|
return w.delegate
|
|
}
|
|
|
|
func WrapFunc(delegate http.RoundTripper, f Func) net.RoundTripperWrapper {
|
|
return &wrapper{delegate: delegate, f: f}
|
|
}
|