mas_data_model/
lib.rs

1// Copyright 2024 New Vector Ltd.
2// Copyright 2021-2024 The Matrix.org Foundation C.I.C.
3//
4// SPDX-License-Identifier: AGPL-3.0-only
5// Please see LICENSE in the repository root for full details.
6
7#![allow(clippy::module_name_repetitions)]
8
9use thiserror::Error;
10
11pub(crate) mod compat;
12pub mod oauth2;
13pub(crate) mod policy_data;
14mod site_config;
15pub(crate) mod tokens;
16pub(crate) mod upstream_oauth2;
17pub(crate) mod user_agent;
18pub(crate) mod users;
19
20/// Error when an invalid state transition is attempted.
21#[derive(Debug, Error)]
22#[error("invalid state transition")]
23pub struct InvalidTransitionError;
24
25pub use ulid::Ulid;
26
27pub use self::{
28    compat::{
29        CompatAccessToken, CompatRefreshToken, CompatRefreshTokenState, CompatSession,
30        CompatSessionState, CompatSsoLogin, CompatSsoLoginState, Device, ToScopeTokenError,
31    },
32    oauth2::{
33        AuthorizationCode, AuthorizationGrant, AuthorizationGrantStage, Client, DeviceCodeGrant,
34        DeviceCodeGrantState, InvalidRedirectUriError, JwksOrJwksUri, Pkce, Session, SessionState,
35    },
36    policy_data::PolicyData,
37    site_config::{CaptchaConfig, CaptchaService, SessionExpirationConfig, SiteConfig},
38    tokens::{
39        AccessToken, AccessTokenState, RefreshToken, RefreshTokenState, TokenFormatError, TokenType,
40    },
41    upstream_oauth2::{
42        UpstreamOAuthAuthorizationSession, UpstreamOAuthAuthorizationSessionState,
43        UpstreamOAuthLink, UpstreamOAuthProvider, UpstreamOAuthProviderClaimsImports,
44        UpstreamOAuthProviderDiscoveryMode, UpstreamOAuthProviderImportAction,
45        UpstreamOAuthProviderImportPreference, UpstreamOAuthProviderPkceMode,
46        UpstreamOAuthProviderResponseMode, UpstreamOAuthProviderSubjectPreference,
47        UpstreamOAuthProviderTokenAuthMethod,
48    },
49    user_agent::{DeviceType, UserAgent},
50    users::{
51        Authentication, AuthenticationMethod, BrowserSession, Password, User, UserEmail,
52        UserEmailAuthentication, UserEmailAuthenticationCode, UserRecoverySession,
53        UserRecoveryTicket, UserRegistration, UserRegistrationPassword,
54    },
55};