Documentation ¶
Index ¶
- Constants
- func FindValueFromGroups(groups []string, key string) (bool, string)
- func GetClusterFromGroups(groups []string) string
- func GetValueFromGroups(groups []string, key string) string
- func GroupWithProject(project string) string
- func IsAnonymous(groups []string) bool
- func LocalFrom(ctx context.Context) bool
- func LongRunningRequestCheck(longRunningVerbs, longRunningSubresources sets.String, ...) apirequest.LongRunningRequestCheck
- func MakeAllIgnoreAuthPathPrefixes(pathPrefixes []string) []string
- func ProjectIDFrom(ctx context.Context) string
- func RequestIDFrom(ctx context.Context) string
- func TenantIDFrom(ctx context.Context) string
- func Unauthorized(s runtime.NegotiatedSerializer, supportsBasicAuth bool) http.Handler
- func WithAuthentication(handler http.Handler, auth authenticator.Request, failed http.Handler, ...) http.Handler
- func WithLocal(handler http.Handler) http.Handler
- func WithProject(handler http.Handler) http.Handler
- func WithRequestID(handler http.Handler) http.Handler
- func WithTenantID(handler http.Handler) http.Handler
Constants ¶
const HeaderRequestID = "X-Remote-Extra-RequestID"
HeaderRequestID is the header name of extra request ID.
const HeaderTenantID = "X-TKE-TenantID"
HeaderTenantID is the header name of tenantID.
const ( // ProjectIDKey defines the key representing the project id in the additional // information mapping table of the user information. ProjectIDKey = "projectid" )
Variables ¶
This section is empty.
Functions ¶
func FindValueFromGroups ¶ added in v1.9.1
func GetClusterFromGroups ¶ added in v1.3.1
func GetValueFromGroups ¶ added in v1.3.1
func GroupWithProject ¶ added in v1.4.0
func IsAnonymous ¶ added in v1.6.0
func LongRunningRequestCheck ¶
func LongRunningRequestCheck(longRunningVerbs, longRunningSubresources sets.String, longRunningPathPrefixes []string) apirequest.LongRunningRequestCheck
LongRunningRequestCheck returns true if the given request has one of the specified verbs or one of the specified subresources, or is matched path prefix request.
func ProjectIDFrom ¶ added in v1.3.1
ProjectIDFrom get the project id from request context.
func RequestIDFrom ¶
RequestIDFrom get the request id from request context.
func TenantIDFrom ¶ added in v1.3.1
TenantIDFrom get the tenant id from request context.
func Unauthorized ¶
func Unauthorized(s runtime.NegotiatedSerializer, supportsBasicAuth bool) http.Handler
func WithAuthentication ¶
func WithAuthentication(handler http.Handler, auth authenticator.Request, failed http.Handler, apiAuds authenticator.Audiences, ignorePathPrefixes []string) 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 WithRequestID ¶
WithRequestID adds the unique requestID to the context of the http access chain.
Types ¶
This section is empty.