server

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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