Skip to main content

Module threepid

Module threepid 

Source

ModulesΒ§

binding πŸ”’
canonical πŸ”’
pending πŸ”’
ratelimit πŸ”’

StructsΒ§

Association
Validated (medium, address) pair handed back when a pending verification is consumed by the add flow.
Binding πŸ”’
CBOR value of a userid_email row: the per-binding metadata, with the address carried in the composite key.
Data πŸ”’
PendingOutcome
Result of [create_or_reuse_pending]: the session id to hand the client, and the freshly minted token when a new message must be sent. A reused session yields None, signalling no new mail.
Service
Third-party identifier (email) storage and the requestToken throttle. Holds the forward (user, email) bindings, the reverse email -> user lookup, the pending email verification sessions, and the per-IP and per-address token buckets.

FunctionsΒ§

canonicalize_email
Canonicalize an email address for storage and matching: case-fold the whole address and lower-case the domain. This is stronger than str::to_lowercase, which leaves ß intact; case-folding maps it to ss so Strauß@Example.com and strauss@example.com collide on one key.

Type AliasesΒ§

EmailKey πŸ”’
Stack-string key for the per-address throttle bucket; the modal email canonical address fits inline.
Ratelimiter πŸ”’
Token-bucket table keyed on a throttle axis: last-refill instant and remaining tokens per key.