package filters

import "k8s.io/kubernetes/pkg/genericapiserver/endpoints/filters"

Package filters contains all the http handler chain filters which _are_ api related, i.e. which are prerequisite for the API services to work (in contrast to the filters in the server package which are not part of the API contract).

Index

Functions

func GetAuthorizerAttributes

func GetAuthorizerAttributes(ctx request.Context) (authorizer.Attributes, error)

func Unauthorized

func Unauthorized(supportsBasicAuth bool) http.HandlerFunc

func WithAudit

func WithAudit(handler http.Handler, requestContextMapper request.RequestContextMapper, 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 WithAuthentication

func WithAuthentication(handler http.Handler, mapper genericapirequest.RequestContextMapper, auth authenticator.Request, failed http.Handler) http.Handler

WithAuthentication creates an http handler that tries to authenticate the given request as a user, and then stores any such user found onto the provided context for the request. If authentication fails or returns an error the failed handler is used. On success, "Authorization" header is removed from the request and handler is invoked to serve the request.

func WithAuthorization

func WithAuthorization(handler http.Handler, requestContextMapper request.RequestContextMapper, 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 request.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 request.RequestContextMapper) http.Handler

WithRequestInfo attaches a RequestInfo to the context.

Source Files

audit.go authentication.go authorization.go doc.go impersonation.go requestinfo.go

Version
v1.6.0-alpha.1
Published
Jan 30, 2017
Platform
darwin/amd64
Imports
21 packages
Last checked
2 minutes ago

Tools for package owners.