kubernetesk8s.io/kubernetes/pkg/apiserver/filters Index | Files

package filters

import "k8s.io/kubernetes/pkg/apiserver/filters"

Package filters contains all the http handler chain filters which _are_ api related.

Index

Functions

func WithAudit

func WithAudit(handler http.Handler, attributeGetter RequestAttributeGetter, out io.Writer) http.Handler

WithAudit decorates a http.Handler with audit logging information for all the requests coming to the server. If out is nil, no decoration takes place. Each audit log contains two entries: 1. the request line containing:

2. the response line containing:

func WithAuthorization

func WithAuthorization(handler http.Handler, getAttribs RequestAttributeGetter, a authorizer.Authorizer) http.Handler

WithAuthorizationCheck passes all authorized requests on to handler, and returns a forbidden error otherwise.

func WithImpersonation

func WithImpersonation(handler http.Handler, requestContextMapper api.RequestContextMapper, a authorizer.Authorizer) http.Handler

WithImpersonation is a filter that will inspect and check requests that attempt to change the user.Info for their requests

func WithRequestInfo

func WithRequestInfo(handler http.Handler, resolver *request.RequestInfoFactory, requestContextMapper api.RequestContextMapper) http.Handler

WithRequestInfo attaches a RequestInfo to the context.

Types

type RequestAttributeGetter

type RequestAttributeGetter interface {
	GetAttribs(req *http.Request) (authorizer.Attributes, error)
}

RequestAttributeGetter is a function that extracts authorizer.Attributes from an http.Request

func NewRequestAttributeGetter

func NewRequestAttributeGetter(requestContextMapper api.RequestContextMapper) RequestAttributeGetter

NewAttributeGetter returns an object which implements the RequestAttributeGetter interface.

Source Files

audit.go authorization.go doc.go errors.go impersonation.go requestinfo.go

Version
v1.5.1
Published
Dec 14, 2016
Platform
js/wasm
Imports
19 packages
Last checked
33 minutes ago

Tools for package owners.