Versions in this module Expand all Collapse all v0 v0.1.1 Nov 12, 2026 v0.1.0 Oct 14, 2026 Changes in this version + const AnnotationVerified + const CaptchaFoxEndpoint + const DefaultMinScore + const DefaultTimeout + const HCaptchaEndpoint + const PluginName + const ReCAPTCHAEndpoint + const TokenHeader + const TurnstileEndpoint + var DefaultProtected = []auth.EndpointID + var ErrFailed = auth.NewError("captcha.failed", http.StatusForbidden, ...) + var ErrMissing = auth.NewError("captcha.missing", http.StatusBadRequest, ...) + var ErrNoSecret = errors.New("captcha: the provider secret key is empty") + var ErrNoVerifier = errors.New("captcha: pass a Verifier such as captcha.Turnstile(secret)") + var ErrNothingProtected = errors.New(...) + var ErrUnavailable = auth.NewError("captcha.unavailable", http.StatusServiceUnavailable, ...) + func MatchPath(pattern, route string) bool + type Option func(*Plugin) + func ChallengeOnly() Option + func Protect(ids ...auth.EndpointID) Option + func ProtectPaths(patterns ...string) Option + func WithHeader(name string) Option + func WithTimeout(d time.Duration) Option + type Plugin struct + func New(v Verifier, opts ...Option) *Plugin + func (p *Plugin) Init(a *auth.Auth) error + func (p *Plugin) Name() string + func (p *Plugin) OperationHooks() []auth.OperationHook + func (p *Plugin) PassChallenge(ctx context.Context, c *auth.Call) error + func (p *Plugin) Protected() []auth.EndpointID + func (p *Plugin) Validate(cfg *auth.Config) error + type ProviderOption func(*SiteVerify) + func WithAllowedHostnames(hosts ...string) ProviderOption + func WithEndpoint(u string) ProviderOption + func WithExpectedAction(action string) ProviderOption + func WithHTTPClient(c *http.Client) ProviderOption + func WithMinScore(score float64) ProviderOption + func WithSiteKey(key string) ProviderOption + type SiteVerify struct + func CaptchaFox(secret string, opts ...ProviderOption) *SiteVerify + func HCaptcha(secret string, opts ...ProviderOption) *SiteVerify + func ReCAPTCHA(secret string, opts ...ProviderOption) *SiteVerify + func Turnstile(secret string, opts ...ProviderOption) *SiteVerify + func (s *SiteVerify) Provider() string + func (s *SiteVerify) Validate(*auth.Config) error + func (s *SiteVerify) Verify(ctx context.Context, token, remoteIP string) error + type Verifier interface + Verify func(ctx context.Context, token, remoteIP string) error + type VerifierFunc func(ctx context.Context, token, remoteIP string) error + func (f VerifierFunc) Verify(ctx context.Context, token, remoteIP string) error