chore(lib/challenge): refactor Validate to take ValidateInput

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-07-02 22:23:10 +00:00
parent 9245c4beec
commit 32afc9c040
5 changed files with 22 additions and 7 deletions

View File

@@ -48,6 +48,11 @@ type IssueInput struct {
OGTags map[string]string
}
type ValidateInput struct {
Rule *policy.Bot
Challenge string
}
type Impl interface {
// Setup registers any additional routes with the Impl for assets or API routes.
Setup(mux *http.ServeMux)
@@ -56,5 +61,5 @@ type Impl interface {
Issue(r *http.Request, lg *slog.Logger, in *IssueInput) (templ.Component, error)
// Validate a challenge, making sure that it passes muster.
Validate(r *http.Request, lg *slog.Logger, rule *policy.Bot, challenge string) error
Validate(r *http.Request, lg *slog.Logger, in *ValidateInput) error
}