Skip to main content

Module token_expiry

Module token_expiry 

Source
Expand description

Access-token expiries a foreign database keeps in a column of its own.

That column is keyed by device, while this server keeps the expiry beside the owner in the shared token column. A token the origin issued reads as never expiring here until its expiry is adopted, which waits for an OIDC provider the session can refresh against.

Re-exportsΒ§

use std::fmt; πŸ”’
use std::str::from_utf8; πŸ”’
use std::sync::Arc; πŸ”’
use futures::FutureExt; πŸ”’
use futures::Stream; πŸ”’
use futures::TryStreamExt; πŸ”’
use futures::future::BoxFuture; πŸ”’
use ruma::DeviceId; πŸ”’
use ruma::OwnedDeviceId; πŸ”’
use ruma::OwnedUserId; πŸ”’
use ruma::UserId; πŸ”’
use tuwunel_core::Result; πŸ”’
use tuwunel_core::result::NotFound; πŸ”’
use tuwunel_core::smallstr::SmallString; πŸ”’
use tuwunel_core::utils::IterStream; πŸ”’
use tuwunel_core::utils::TryReadyExt; πŸ”’
use tuwunel_core::utils::stream::TryBroadbandExt; πŸ”’
use tuwunel_database::KeyBuf; πŸ”’
use tuwunel_database::Map; πŸ”’
use tuwunel_database::SEP; πŸ”’
use super::Check; πŸ”’
use super::Report; πŸ”’
use super::ScanExt; πŸ”’
use super::Summary; πŸ”’
use super::leading_record; πŸ”’
use super::tally; πŸ”’
use crate::Services; πŸ”’
use crate::users::device::TOKEN_LENGTH; πŸ”’

StructsΒ§

Held πŸ”’
A token this server holds, with the owner its stored value names.

EnumsΒ§

Finding
A token a foreign expiry column names whose expiry is not as this server needs it, or a row this check cannot read.
Row πŸ”’
One row of the origin column, decoded.
Token πŸ”’
The token an origin row’s device holds here, as both passes read it.

ConstantsΒ§

ORIGIN_COLUMN πŸ”’

StaticsΒ§

CHECK πŸ”’

FunctionsΒ§

classify πŸ”’
Classifies a stored token value as both passes read it.
device πŸ”’
Reads a key as a user id and a device id, as a release build decodes it.
findings πŸ”’
origin
Opens the origin column, if the database holds one.
pair πŸ”’
Splits a key or value into its first two records and whatever follows them, as a release build reads a pair.
row πŸ”’
rows πŸ”’
Streams every row of the origin column, decoded.
scan
Streams each token the origin column names whose expiry is not as this server needs it.
token πŸ”’
Reads the token a device holds here and classifies its stored value against the recorded expiry.
token_value πŸ”’
Reads a stored token value as a release build decodes it.
walk πŸ”’

Type AliasesΒ§

AccessToken πŸ”’
Column πŸ”’
Findings πŸ”’