mirror of
https://github.com/TecharoHQ/anubis.git
synced 2025-08-03 09:48:08 -04:00

* style: fix formatting in .air.toml and installation.mdx * feat: add --strip-base-prefix flag to modify request paths when forwarding Closes: #638 * refactor: apply structpacking (betteralign) * fix: add validation for strip-base-prefix and base-prefix configuration * fix: improve request path handling by cloning request and modifying URL path * chore: remove integration tests as they are too annoying to debug on my system
21 lines
371 B
Go
21 lines
371 B
Go
package policy
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/TecharoHQ/anubis/internal"
|
|
"github.com/TecharoHQ/anubis/lib/policy/config"
|
|
)
|
|
|
|
type Bot struct {
|
|
Rules Checker
|
|
Challenge *config.ChallengeRules
|
|
Weight *config.Weight
|
|
Name string
|
|
Action config.Rule
|
|
}
|
|
|
|
func (b Bot) Hash() string {
|
|
return internal.SHA256sum(fmt.Sprintf("%s::%s", b.Name, b.Rules.Hash()))
|
|
}
|