Skip to main content

Module pending

Module pending 

Source
Expand description

Durable email-verification proofs and UIAA ownership claims.

Pending rows bind a client secret, token, address, expiry, and use state to a deterministic session identifier. Keyed in-memory locks serialize local updates while database transactions keep claim indexes aligned with proof state.

Re-exportsยง

use std::time::Duration; ๐Ÿ”’
use std::time::SystemTime; ๐Ÿ”’
use aws_lc_rs::constant_time::verify_slices_are_equal; ๐Ÿ”’
use base64::Engine as _; ๐Ÿ”’
use base64::engine::general_purpose::URL_SAFE_NO_PAD as b64encode; ๐Ÿ”’
use ruma::thirdparty::Medium; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use tuwunel_core::Err; ๐Ÿ”’
use tuwunel_core::Result; ๐Ÿ”’
use tuwunel_core::implement; ๐Ÿ”’
use tuwunel_core::result::NotFound; ๐Ÿ”’
use tuwunel_core::smallstr::SmallString; ๐Ÿ”’
use tuwunel_core::utils; ๐Ÿ”’
use tuwunel_core::utils::hash::sha256; ๐Ÿ”’
use tuwunel_core::utils::time::deadline_has_passed; ๐Ÿ”’
use tuwunel_core::utils::time::timepoint_from_now; ๐Ÿ”’
use tuwunel_database::Cbor; ๐Ÿ”’
use tuwunel_database::Deserialized; ๐Ÿ”’
use super::Association; ๐Ÿ”’
use super::UiaaKey; ๐Ÿ”’

Structsยง

Pending ๐Ÿ”’
Stored state for a pending third-party identifier validation.
PendingOutcome
Outcome of creating or reusing a pending verification session.

Enumsยง

PendingUse ๐Ÿ”’
Single-use state of a validated pending session.

Constantsยง

MAX_VERIFY_ATTEMPTS ๐Ÿ”’
Failed-validation ceiling: the session self-destructs once this many wrong submissions have been counted, so the Nth burns and N-1 are tolerated. Caps token brute-force (mirrors the device-grant ceiling).
TOKEN_LENGTH ๐Ÿ”’
Characters minted for the single-use, server-private validation token.
UIAA_SESSION_TTL ๐Ÿ”’
Persistence lifetime shared by UIAA sessions and their threepid claims.

Functionsยง

ct_eq ๐Ÿ”’
derive_sid ๐Ÿ”’
Deterministic session id binding the request identity to one storage key.
expired ๐Ÿ”’

Type Aliasesยง

ClaimSid ๐Ÿ”’