mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-17 05:44:57 +00:00
fix: reorder fields in AnubisRule struct for better alignment
This commit is contained in:
@@ -36,12 +36,13 @@ type RobotsRule struct {
|
|||||||
IsBlacklist bool // true if this is a specifically denied user agent
|
IsBlacklist bool // true if this is a specifically denied user agent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//betteralign:ignore, we want name to be the first field
|
||||||
type AnubisRule struct {
|
type AnubisRule struct {
|
||||||
|
Name string `yaml:"name" json:"name"`
|
||||||
|
Action string `yaml:"action" json:"action"`
|
||||||
Expression map[string]interface{} `yaml:"expression,omitempty" json:"expression,omitempty"`
|
Expression map[string]interface{} `yaml:"expression,omitempty" json:"expression,omitempty"`
|
||||||
Challenge *config.ChallengeRules `yaml:"challenge,omitempty" json:"challenge,omitempty"`
|
Challenge *config.ChallengeRules `yaml:"challenge,omitempty" json:"challenge,omitempty"`
|
||||||
Weight *config.Weight `yaml:"weight,omitempty" json:"weight,omitempty"`
|
Weight *config.Weight `yaml:"weight,omitempty" json:"weight,omitempty"`
|
||||||
Name string `yaml:"name" json:"name"`
|
|
||||||
Action string `yaml:"action" json:"action"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
2
cmd/robots2policy/testdata/simple.yaml
vendored
2
cmd/robots2policy/testdata/simple.yaml
vendored
@@ -5,4 +5,4 @@
|
|||||||
- name: robots-txt-policy-disallow-2
|
- name: robots-txt-policy-disallow-2
|
||||||
action: CHALLENGE
|
action: CHALLENGE
|
||||||
expression:
|
expression:
|
||||||
single: path.startsWith("/private")
|
single: path.startsWith("/private")
|
||||||
|
|||||||
Reference in New Issue
Block a user