Documentation ¶
Index ¶
- func ClusterPathFromAndStrip(req *http.Request) (logicalcluster.Path, *url.URL, bool, error)
- func IsPartialMetadataRequest(ctx context.Context) bool
- func WithAcceptHeader(apiHandler http.Handler) http.Handler
- func WithAuditEventClusterAnnotation(handler http.Handler) http.HandlerFunc
- func WithBlockInactiveLogicalClusters(handler http.Handler, ...) http.HandlerFunc
- func WithClusterScope(apiHandler http.Handler) http.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClusterPathFromAndStrip ¶ added in v0.11.0
ClusterPathFromAndStrip parses the request for a logical cluster path, returns it if found and strips it from the request URL path.
func IsPartialMetadataRequest ¶
IsPartialMetadataRequest determines if it is PartialObjectMetadata request based on the value stored in the context.
A PartialObjectMetadata request gets only object metadata.
func WithAcceptHeader ¶
WithAcceptHeader makes the Accept header available for code in the handler chain. It is needed for Wildcard requests, when finding the CRD with a common schema. For PartialObjectMeta requests we cand weaken the schema requirement and allow different schemas across workspaces.
func WithAuditEventClusterAnnotation ¶
func WithAuditEventClusterAnnotation(handler http.Handler) http.HandlerFunc
WithAuditEventClusterAnnotation adds the cluster name into the annotation of an audit event. Needs initialized annotations.
func WithBlockInactiveLogicalClusters ¶ added in v0.25.0
func WithBlockInactiveLogicalClusters(handler http.Handler, kcpClusterClient informersv1alpha1.LogicalClusterClusterInformer) http.HandlerFunc
WithBlockInactiveLogicalClusters ensures that any requests to logical clusters marked inactive are rejected.
func WithClusterScope ¶
func WithClusterScope(apiHandler http.Handler) http.HandlerFunc
WithClusterScope reads a cluster name from the URL path and puts it into the context. It also trims "/clusters/" prefix from the URL.
Types ¶
This section is empty.