mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-21 21:47:16 +00:00
- Add GatewayNamespacedName, AllowedGatewaySpec, GatewayRuleSpec types to pkg/api/ - Add Gateways field to NamespaceRuleEnforceBody for per-namespace gateway rules - Add HTTPRoute validation webhook to enforce allowed gateways - Add HTTPRoute default mutation webhook to inject default Gateway parentRef - Update Helm chart with validating/mutating webhook configurations for httproutes - Update CRD schemas for tenants and rulestatuses - Add GatewayForbiddenError and ReasonForbiddenGateway event reason Co-authored-by: oliverbaehler <26610571+oliverbaehler@users.noreply.github.com>
22 lines
644 B
Go
22 lines
644 B
Go
// Copyright 2020-2026 Project Capsule Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package httproute
|
|
|
|
import (
|
|
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
|
|
|
|
"github.com/projectcapsule/capsule/pkg/runtime/handlers"
|
|
)
|
|
|
|
// Handler builds a handlers.Handler that wraps all provided
|
|
// TypedHandlerWithTenantWithRuleset[*gatewayv1.HTTPRoute] implementations.
|
|
func Handler(handler ...handlers.TypedHandlerWithTenantWithRuleset[*gatewayv1.HTTPRoute]) handlers.Handler {
|
|
return &handlers.TypedTenantWithRulesetHandler[*gatewayv1.HTTPRoute]{
|
|
Factory: func() *gatewayv1.HTTPRoute {
|
|
return &gatewayv1.HTTPRoute{}
|
|
},
|
|
Handlers: handler,
|
|
}
|
|
}
|