Documentation
¶
Index ¶
- func Allow(sar authorizationv1.SubjectAccessReview) (authorizationv1.SubjectAccessReview, error)
- func Deny(sar authorizationv1.SubjectAccessReview) (authorizationv1.SubjectAccessReview, error)
- func NoOpinion(sar authorizationv1.SubjectAccessReview) (authorizationv1.SubjectAccessReview, error)
- type AuthzHandler
- type AuthzHandlerFunc
- type TLSServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Allow ¶
func Allow(sar authorizationv1.SubjectAccessReview) (authorizationv1.SubjectAccessReview, error)
Allow returns a handler function that always allows requests.
func Deny ¶
func Deny(sar authorizationv1.SubjectAccessReview) (authorizationv1.SubjectAccessReview, error)
Deny returns a handler function that always denies requests.
func NoOpinion ¶
func NoOpinion(sar authorizationv1.SubjectAccessReview) (authorizationv1.SubjectAccessReview, error)
NoOpinion returns a handler function that expresses no opinion (neither allows nor denies).
Types ¶
type AuthzHandler ¶
type AuthzHandler struct {
// contains filtered or unexported fields
}
AuthzHandler is an http.Handler that processes Kubernetes authorization webhook requests.
func NewAuthzHandler ¶
func NewAuthzHandler(handler AuthzHandlerFunc) *AuthzHandler
NewAuthzHandler creates a new authorization webhook handler with an initial handler function.
func (*AuthzHandler) ServeHTTP ¶
func (h *AuthzHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*AuthzHandler) SetHandler ¶
func (h *AuthzHandler) SetHandler(handler AuthzHandlerFunc)
SetHandler changes the handler function at runtime.
type AuthzHandlerFunc ¶
type AuthzHandlerFunc func(authorizationv1.SubjectAccessReview) (authorizationv1.SubjectAccessReview, error)
AuthzHandlerFunc is a function that generates a response for a SubjectAccessReview.
type TLSServer ¶
type TLSServer struct {
// contains filtered or unexported fields
}
TLSServer is a simple in-process HTTPS server for testing.
func NewTLSServer ¶
func NewTLSServer(port int, hostnames []string, pkiDirectory string, handler http.Handler) (*TLSServer, error)
NewTLSServer creates a new TLS server with auto-generated certificates. The certificates are saved in testdata/.{test-name}/.