mirror of
https://github.com/TecharoHQ/anubis.git
synced 2025-08-04 02:08:59 -04:00

This makes each check into its own type that has encapsulated check logic, meaning that it's easier to add new checker implementations in the future. Signed-off-by: Xe Iaso <me@xeiaso.net>
20 lines
345 B
Go
20 lines
345 B
Go
package policy
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/TecharoHQ/anubis/internal"
|
|
"github.com/TecharoHQ/anubis/lib/policy/config"
|
|
)
|
|
|
|
type Bot struct {
|
|
Name string
|
|
Action config.Rule
|
|
Challenge *config.ChallengeRules
|
|
Rules Checker
|
|
}
|
|
|
|
func (b Bot) Hash() string {
|
|
return internal.SHA256sum(fmt.Sprintf("%s::%s", b.Name, b.Rules.Hash()))
|
|
}
|