feat: transform circuitbreaker layer in authn-network layer
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user