feat: hCaptcha middleware

This commit is contained in:
yusing
2025-05-04 17:21:12 +08:00
parent e275ee634c
commit f9a8aede20
15 changed files with 793 additions and 10 deletions

View File

@@ -0,0 +1,21 @@
package captcha
import (
"net/http"
"time"
"github.com/yusing/go-proxy/internal/gperr"
)
type Provider interface {
CSPDirectives() []string
CSPSources() []string
Verify(r *http.Request) error
SessionExpiry() time.Duration
ScriptHTML() string
FormHTML() string
}
var (
ErrCaptchaVerificationFailed = gperr.New("captcha verification failed")
)