Documentation
¶
Overview ¶
Package cors implements a PreRequest CORS plugin that validates the request origin, applies CORS response headers, and short-circuits preflight requests.
Index ¶
- Constants
- type CorsData
- type Plugin
- func (p *Plugin) Execute(_ context.Context, in appplugins.ExecInput) (*appplugins.Result, error)
- func (p *Plugin) MandatoryStages() []policy.Stage
- func (p *Plugin) MutatesMetadata() bool
- func (p *Plugin) MutatesRequestBody() bool
- func (p *Plugin) MutatesResponseBody() bool
- func (p *Plugin) Name() string
- func (p *Plugin) SupportedModes() []policy.Mode
- func (p *Plugin) SupportedStages() []policy.Stage
- func (p *Plugin) ValidateConfig(settings map[string]any) error
Constants ¶
View Source
const PluginName = "cors"
PluginName is the catalog name used in policy configuration.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CorsData ¶
type CorsData struct {
Origin string `json:"origin"`
Method string `json:"method"`
Preflight bool `json:"preflight"`
Allowed bool `json:"allowed"`
RequestedMethod string `json:"requested_method,omitempty"`
AllowedMethods []string `json:"allowed_methods,omitempty"`
}
CorsData is the per-invocation trace payload describing the CORS decision.
type Plugin ¶
type Plugin struct{}
Plugin enforces a per-policy CORS policy.
func (*Plugin) Execute ¶
func (p *Plugin) Execute(_ context.Context, in appplugins.ExecInput) (*appplugins.Result, error)
func (*Plugin) MandatoryStages ¶
func (*Plugin) MutatesMetadata ¶ added in v0.2.3
func (*Plugin) MutatesRequestBody ¶ added in v0.2.3
func (*Plugin) MutatesResponseBody ¶ added in v0.2.3
func (*Plugin) SupportedModes ¶
func (*Plugin) SupportedStages ¶
Click to show internal directories.
Click to hide internal directories.