Documentation ¶
Overview ¶
Copyright Jetstack Ltd. See LICENSE for details.
Index ¶
- func BearerToken(req *http.Request) string
- func NoImpersonation(req *http.Request) bool
- func RemoteAddr(req *http.Request) (*http.Request, string)
- func WithBearerToken(req *http.Request, header http.Header) *http.Request
- func WithImpersonationConfig(req *http.Request, conf *ImpersonationRequest) *http.Request
- func WithNoImpersonation(req *http.Request) *http.Request
- type ImpersonationRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BearerToken ¶
BearerToken will return the bearer token stored in the request context.
func NoImpersonation ¶
NoImpersonation returns whether the noImpersonation context key has been set
func RemoteAddr ¶
RemoteAddress will attempt to return the source client address if available in the request context. If it is not, it will be gathered from the request and entered into the context.
func WithBearerToken ¶
WithBearerToken will add the bearer token to the request context from an http.Header to the request context.
func WithImpersonationConfig ¶
func WithImpersonationConfig(req *http.Request, conf *ImpersonationRequest) *http.Request
WithImpersonationConfig returns a copy of parent in which contains the impersonation configuration.
Types ¶
type ImpersonationRequest ¶
type ImpersonationRequest struct { ImpersonationConfig *transport.ImpersonationConfig InboundUser *user.Info ImpersonatedUser *user.Info }
func ImpersonationConfig ¶
func ImpersonationConfig(req *http.Request) *ImpersonationRequest
ImpersonationConfig returns the impersonation configuration held in the context if existing.