View Source
const HeaderRequestID = "X-Remote-Extra-RequestID"

HeaderRequestID is the header name of extra request ID.

View Source
const HeaderTenantID = "X-TKE-TenantID"

HeaderTenantID is the header name of tenantID.

View Source
const (
	// ProjectIDKey defines the key representing the project id in the additional
	// information mapping table of the user information.
	ProjectIDKey = "projectid"


This section is empty.


func GetClusterFromGroups added in v1.3.1

func GetClusterFromGroups(groups []string) string

func GetValueFromGroups added in v1.3.1

func GetValueFromGroups(groups []string, key string) string

func GroupWithProject added in v1.4.0

func GroupWithProject(project string) string

func IsAnonymous added in v1.6.0

func IsAnonymous(groups []string) bool

func LocalFrom

func LocalFrom(ctx context.Context) bool

LocalFrom get the local identity from request context.

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 MakeAllIgnoreAuthPathPrefixes

func MakeAllIgnoreAuthPathPrefixes(pathPrefixes []string) []string

func ProjectIDFrom added in v1.3.1

func ProjectIDFrom(ctx context.Context) string

ProjectIDFrom get the project id from request context.

func RequestIDFrom

func RequestIDFrom(ctx context.Context) string

RequestIDFrom get the request id from request context.

func TenantIDFrom added in v1.3.1

func TenantIDFrom(ctx context.Context) string

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 WithLocal

func WithLocal(handler http.Handler) http.Handler

WithLocal adds the local identify to the context of the http access chain.

func WithProject added in v1.3.1

func WithProject(handler http.Handler) http.Handler

func WithRequestID

func WithRequestID(handler http.Handler) http.Handler

WithRequestID adds the unique requestID to the context of the http access chain.

func WithTenantID added in v1.3.1

func WithTenantID(handler http.Handler) http.Handler

WithTenantID adds the unique tenantID to the context of the http access chain.


This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL