Skip to main content

Module threepid

Module threepid 

Source
Expand description

Email third-party identifier bindings and verification sessions.

The service stores bidirectional email bindings, durable pending proofs, and UIAA ownership claims. Process-local token buckets separately limit verification requests by caller address and canonical email.

Re-exportsยง

use std::collections::HashMap; ๐Ÿ”’
use std::net::IpAddr; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use std::sync::Mutex; ๐Ÿ”’
use std::time::Instant; ๐Ÿ”’
use ruma::MilliSecondsSinceUnixEpoch; ๐Ÿ”’
use ruma::OwnedDeviceId; ๐Ÿ”’
use ruma::OwnedUserId; ๐Ÿ”’
use ruma::thirdparty::Medium; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use tuwunel_core::Result; ๐Ÿ”’
use tuwunel_core::smallstr::SmallString; ๐Ÿ”’
use tuwunel_core::utils::MutexMap; ๐Ÿ”’
use tuwunel_database::Database; ๐Ÿ”’
use tuwunel_database::Map; ๐Ÿ”’
pub use self::canonical::canonicalize_email;
pub use self::pending::PendingOutcome;

Modulesยง

binding ๐Ÿ”’
Persistent email-to-user bindings.
canonical ๐Ÿ”’
Canonical email keys for binding and verification lookups.
pending ๐Ÿ”’
Durable email-verification proofs and UIAA ownership claims.
ratelimit ๐Ÿ”’
Verification-request limits keyed by source and destination.

Structsยง

Association
Validated third-party identifier consumed from a pending proof.
Binding ๐Ÿ”’
CBOR value of a userid_email row: the per-binding metadata, with the address carried in the composite key.
Data ๐Ÿ”’
Service
Manages email threepid bindings, verification sessions, and request limits.

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.
UiaaKey
Identifies the exact UIAA session that owns a validated threepid.
UiaaSessionId
Stores a UIAA session identifier inline in the common case.