Documentation
¶
Overview ¶
Package plugin provides the gateway plugin system for extending the proxy pipeline with custom request/response processing logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GraphQLConfig ¶
type GraphQLConfig struct {
// MaxDepth limits query nesting depth (0 = unlimited).
MaxDepth int `json:"maxDepth"`
// MaxComplexity limits estimated query complexity (0 = unlimited).
MaxComplexity int `json:"maxComplexity"`
// BlockIntrospection rejects __schema and __type queries.
BlockIntrospection bool `json:"blockIntrospection"`
// AllowedOperations limits which operation types are permitted.
// Empty = all allowed. Values: "query", "mutation", "subscription".
AllowedOperations []string `json:"allowedOperations,omitempty"`
}
GraphQLConfig configures GraphQL-specific gateway behaviour.
type GraphQLGuard ¶
type GraphQLGuard struct {
// contains filtered or unexported fields
}
GraphQLGuard enforces depth limits, complexity limits, and introspection blocking on GraphQL routes.
func NewGraphQLGuard ¶
func NewGraphQLGuard(cfg GraphQLConfig) *GraphQLGuard
NewGraphQLGuard creates a guard with the given configuration.
type GraphQLPlugin ¶
type GraphQLPlugin struct {
bastion.BasePlugin
// contains filtered or unexported fields
}
GraphQLPlugin is a GatewayPlugin that enforces GraphQL rules on routes with Protocol == ProtocolGraphQL.
func NewGraphQLPlugin ¶
func NewGraphQLPlugin(cfg GraphQLConfig) *GraphQLPlugin
NewGraphQLPlugin creates a plugin with a global GraphQL config. Per-route configs can be set via SetRouteConfig.
func (*GraphQLPlugin) SetRouteConfig ¶
func (p *GraphQLPlugin) SetRouteConfig(routeID string, cfg GraphQLConfig)
SetRouteConfig sets a per-route GraphQL configuration.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager registers and invokes gateway plugins. It integrates with the HookEngine to participate in the proxy pipeline.
func (*Manager) PluginNames ¶
PluginNames returns the names of all registered plugins.
func (*Manager) Plugins ¶
func (pm *Manager) Plugins() []bastion.GatewayPlugin
Plugins returns a snapshot of all registered plugins.
func (*Manager) Register ¶
func (pm *Manager) Register(plugin bastion.GatewayPlugin, hooks *bastion.HookEngine)
Register adds a plugin. It also wires the plugin into the provided HookEngine so existing hook-based callers invoke plugin methods.