Documentation ¶
Overview ¶
Package common contains a bunch of helper functions, interfaces and methods for the ctrdac application.
Index ¶
- Variables
- func ContextDialer(u Upstream) func(ctx context.Context, addr string) (net.Conn, error)
- func TLSContextDialer(u Upstream) ...
- func TLSDialer(u Upstream) func(netw, addr string, cfg *tls.Config) (net.Conn, error)
- type ContextKey
- type Listener
- type ProxyServer
- type ProxyServerConfig
- type RequestWrapper
- type Upstream
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // RequestContext is the key in the context that exposes the original http.Request RequestContext = &ContextKey{Name: "req"} )
Functions ¶
func ContextDialer ¶
ContextDialer returns a dialer suitable to use for http.DialTLS
Types ¶
type ContextKey ¶
type ContextKey struct {
Name string
}
ContextKey is the root type of info we attach to the context
type Listener ¶
type Listener interface { // GetListener returns the low level golang net.Listener for this path listener. GetListener() net.Listener // ConfigureHooks configured a http.Server so that information about the peers // is populated into the context. ConfigureHooks(server *http.Server) error // PopulateUserInfo sets the listener specific attributes on AuthzRequest, e.g. // the client certificates in the case of mTLS or the remote uid in the case of UDS PopulateUserInfo(ctx context.Context, ar *k8sac.AdmissionRequest) error }
Listener is the common interface of the mTLS and the UDS listeners.
type ProxyServer ¶
type ProxyServer interface { PopulateUserInfo(ctx context.Context, authzReq *k8sac.AdmissionRequest) error GetConfig() ProxyServerConfig }
ProxyServer is an interface to the ctrdac proxy server; it is passed across the subpackages that need to interact with/fetch info from the proxy server.
type ProxyServerConfig ¶
type ProxyServerConfig struct { ProxyListenerSocket string ProxyListenerParams string UpstreamContainerdSocket string DockerSocket string ValidatingWebhooks []string MutatingWebhooks []string NoK8sConversion bool }
ProxyServerConfig holds the supported configuration options of the ctrdac proxy server
type RequestWrapper ¶
RequestWrapper is a wrapper struct that exposes the underlying http.Request in gRPC context
Click to show internal directories.
Click to hide internal directories.