mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-04-05 10:17:42 +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>
25 lines
598 B
Go
25 lines
598 B
Go
// Copyright 2020-2026 Project Capsule Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package route
|
|
|
|
import "github.com/projectcapsule/capsule/pkg/runtime/handlers"
|
|
|
|
type httproute struct {
|
|
handlers []handlers.Handler
|
|
}
|
|
|
|
// HTTPRoute returns a Webhook that handles admission requests for
|
|
// gateway.networking.k8s.io/v1 HTTPRoute resources.
|
|
func HTTPRoute(handler ...handlers.Handler) handlers.Webhook {
|
|
return &httproute{handlers: handler}
|
|
}
|
|
|
|
func (w *httproute) GetHandlers() []handlers.Handler {
|
|
return w.handlers
|
|
}
|
|
|
|
func (w *httproute) GetPath() string {
|
|
return "/httproutes/validating"
|
|
}
|