server

package
v0.31.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allow

Allow returns a handler function that always allows requests.

func Deny

Deny returns a handler function that always denies requests.

func NoOpinion

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

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}/.

func (*TLSServer) CAFile

func (s *TLSServer) CAFile() string

CAFile returns the path to the CA certificate file.

func (*TLSServer) Start

func (s *TLSServer) Start(ctx context.Context) error

Start starts the server on the given port and blocks until it's ready.

func (*TLSServer) Stop

func (s *TLSServer) Stop() error

Stop stops the server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL