Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface { // Handle yields a response to an TokenReview. // // The supplied context is extracted from the received http.Request, allowing wrapping // http.Handlers to inject values into and control cancelation of downstream request processing. Handle(context.Context, Request) Response }
Handler can handle an TokenReview.
type HandlerFunc ¶
HandlerFunc implements Handler interface using a single function.
type Request ¶
type Request struct {
authorizationv1.SubjectAccessReview
}
Request defines the input for an authorization handler. It contains information to identify the object in question (group, version, kind, resource, subresource, name, namespace), as well as the operation in question (e.g. Get, Create, etc), and the object itself.
type Response ¶
type Response struct {
authorizationv1.SubjectAccessReview
}
Response is the output of an authorization handler. It contains a response indicating if a given operation is allowed.
func Allowed ¶
Allowed constructs a response indicating that the given user is authorized to perform the given action. The reason parameter is optional.
func AuthorizationResponse ¶
AuthorizationResponse returns a response an authorization request.
func Denied ¶
Denied constructs a response indicating that the given user is denied to perform the given action. The reason parameter is optional.
type Webhook ¶
type Webhook struct { // Handler actually processes an authentication request returning whether it was authenticated or unauthenticated, // and potentially patches to apply to the handler. Handler Handler // WithContextFunc will allow you to take the http.Request.Context() and // add any additional information such as passing the request path or // headers thus allowing you to read them from within the handler WithContextFunc func(context.Context, *http.Request) context.Context // contains filtered or unexported fields }
Webhook represents each individual webhook.
func NewWebhookForAuthorizer ¶
func NewWebhookForAuthorizer(authz authorizer.Authorizer) *Webhook