feat: transform circuitbreaker layer in authn-network layer
Some checks are pending
Cadoles/bouncer/pipeline/head Build started...
Cadoles/bouncer/pipeline/pr-develop Build started...

This commit is contained in:
2024-05-17 17:29:26 +02:00
parent 5ed194618a
commit 5a34d5917f
25 changed files with 450 additions and 338 deletions

View File

@ -10,14 +10,23 @@ import (
)
type LayerOptions struct {
MatchURLs []string `mapstructure:"matchURLs"`
Headers HeadersOptions `mapstructure:"headers"`
MatchURLs []string `mapstructure:"matchURLs"`
Headers HeadersOptions `mapstructure:"headers"`
Templates TemplatesOptions `mapstructure:"templates"`
}
type HeadersOptions struct {
Rules []string `mapstructure:"rules"`
}
type TemplatesOptions struct {
Forbidden TemplateOptions `mapstructure:"forbidden"`
}
type TemplateOptions struct {
Block string `mapstructure:"block"`
}
func DefaultLayerOptions() LayerOptions {
return LayerOptions{
MatchURLs: []string{"*"},
@ -36,7 +45,13 @@ func DefaultLayerOptions() LayerOptions {
`,
},
},
Templates: TemplatesOptions{
Forbidden: TemplateOptions{
Block: "default",
},
},
}
}
func fromStoreOptions(storeOptions store.LayerOptions) (*LayerOptions, error) {