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

@@ -385,8 +385,12 @@ func (s *Server) PassChallenge(w http.ResponseWriter, r *http.Request) {
}
challengeStr := s.challengeFor(r, rule.Challenge.Difficulty)
in := &challenge.ValidateInput{
Challenge: challengeStr,
Rule: rule,
}
if err := impl.Validate(r, lg, rule, challengeStr); err != nil {
if err := impl.Validate(r, lg, in); err != nil {
failedValidations.WithLabelValues(rule.Challenge.Algorithm).Inc()
var cerr *challenge.Error
s.ClearCookie(w, CookieOpts{Path: cookiePath, Host: r.Host})