Documentation
¶
Overview ¶
Package signupprotection applies bot verification and bounded throttles to public password signup.
Index ¶
Constants ¶
This section is empty.
Variables ¶
ErrClientIPUnavailable means the configured source did not contain one valid address.
Functions ¶
This section is empty.
Types ¶
type ClientIPResolver ¶
ClientIPResolver derives a client address from one configured source.
func NewCloudflareClientIPResolver ¶
func NewCloudflareClientIPResolver() ClientIPResolver
NewCloudflareClientIPResolver trusts exactly one CF-Connecting-IP value. The origin must accept traffic exclusively from Cloudflare when this is used.
func NewDirectClientIPResolver ¶
func NewDirectClientIPResolver() ClientIPResolver
NewDirectClientIPResolver reads the network peer and ignores proxy headers.
type PasswordSignupAttempt ¶
PasswordSignupAttempt contains the untrusted inputs needed at the public password-signup request boundary.
type PasswordSignupProtection ¶
type PasswordSignupProtection interface {
Check(context.Context, PasswordSignupAttempt) *apperrors.ServiceError
}
PasswordSignupProtection decides whether password signup may continue.
func NewDisabledPasswordSignupProtection ¶
func NewDisabledPasswordSignupProtection() PasswordSignupProtection
NewDisabledPasswordSignupProtection preserves self-hosted signup without cloud verification or throttling.
func NewPasswordSignupProtection ¶
func NewPasswordSignupProtection(spec PasswordSignupProtectionSpec) (PasswordSignupProtection, error)
NewPasswordSignupProtection constructs cloud password-signup protection.
type PasswordSignupProtectionSpec ¶
type PasswordSignupProtectionSpec struct {
Verifier turnstile.Verifier
IPThrottle ThrottleSpec
EmailThrottle ThrottleSpec
}
PasswordSignupProtectionSpec contains the cloud verifier and bounded limits.