mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 10:18:59 +02:00
feat: hCaptcha middleware
This commit is contained in:
21
internal/net/gphttp/middleware/captcha/provider.go
Normal file
21
internal/net/gphttp/middleware/captcha/provider.go
Normal 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")
|
||||
)
|
||||
Reference in New Issue
Block a user