Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCacheCheckFailed = errors.New("phone cache: security check failed")
ErrCacheCheckFailed is returned when an operation is rejected due to a cache failure under FailClosed.
Functions ¶
func HashIdentifier ¶
HashIdentifier produces an opaque hex hash of sensitive identifiers (phone number, user ID) to prevent exposing plaintext phone numbers in cache keys or logs.
Types ¶
type FailurePolicy ¶
type FailurePolicy string
FailurePolicy defines how cache failures (e.g. timeout, partition) are handled for security controls.
const ( // FailOpen allows operations when cache operations fail, prioritizing availability. FailOpen FailurePolicy = "fail_open" // FailClosed rejects operations when cache operations fail, prioritizing abuse mitigation. FailClosed FailurePolicy = "fail_closed" )
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter manages rate limiting and cooldown periods for OTP requests.
func NewLimiter ¶
NewLimiter constructs a Limiter instance.
Click to show internal directories.
Click to hide internal directories.