1pub mod adapter;
2mod contracts;
3mod database_hooks;
4mod decorated;
5mod jwks;
6mod migrations;
7pub mod oauth_clients;
8mod org_extensions;
9mod secondary_sessions;
10pub mod secondary_storage;
11mod session_deletion;
12mod sso;
13pub mod stateless;
14mod wallets;
15use crate::schema::AuthSchema;
16pub(crate) use contracts::UserCreateTransform;
17use contracts::create_data;
18pub use contracts::{
19 AccountStore, AdapterAfterHook, AdapterEvent, ApiKeyStore, AuthTransaction,
20 BoxedTransactionValue, ConsumeApiKeyResult, DeviceCodeStore, InvitationCreateOptions,
21 InvitationStore, ListOrganizationMembersParams, MemberPageQuery, MemberStore, NumericTextInput,
22 OrganizationStore, PasskeyStore, SessionCreatedHook, SessionStore, TransactionFuture,
23 TransactionStore, TransactionWork, TwoFactorStore, TypedTransactionFuture,
24 UserCreationDefaults, UserStore, VerificationStore, transaction, verification_reservation_key,
25};
26pub use database_hooks::{DatabaseHookContext, DatabaseHooks, HookBackend, HookControl};
27pub(crate) use decorated::{
28 AdapterCallbacks, PluginStore, SessionCreatedCallbacks, UserTransforms,
29};
30pub use jwks::JwkStore;
31pub use migrations::SchemaMigrator;
32pub use oauth_clients::{
33 CreateOAuthClient, CreateOAuthClientResource, CreateOAuthConsent, CreateOAuthResource,
34 CreateOAuthToken, OAuthClient, OAuthClientResource, OAuthClientStore, OAuthConsent,
35 OAuthResource, OAuthToken, OAuthTokenKind,
36};
37pub use org_extensions::{OrganizationRoleStore, TeamStore, team_membership_key};
38#[cfg(feature = "redis-cache")]
39pub use secondary_storage::RedisAdapter;
40pub use secondary_storage::{CacheAdapter, MemoryCacheAdapter};
41pub(crate) use session_deletion::SessionDeletionHooks;
42pub use session_deletion::{SessionDeletionHook, SessionDeletionWork};
43pub use sso::{SsoProvider, SsoProviderStore};
44pub use wallets::WalletAddressStore;
45
46pub trait AuthStore<S: AuthSchema>:
47 UserStore<S>
48 + SessionStore<S>
49 + AccountStore<S>
50 + VerificationStore<S>
51 + OrganizationStore
52 + MemberStore
53 + InvitationStore
54 + OAuthClientStore
55 + SsoProviderStore
56 + TeamStore
57 + OrganizationRoleStore
58 + WalletAddressStore
59 + TwoFactorStore
60 + ApiKeyStore
61 + PasskeyStore
62 + DeviceCodeStore
63 + JwkStore
64 + TransactionStore<S>
65 + Send
66 + Sync
67{
68}
69
70impl<S, T> AuthStore<S> for T
71where
72 S: AuthSchema,
73 T: UserStore<S>
74 + SessionStore<S>
75 + AccountStore<S>
76 + VerificationStore<S>
77 + OrganizationStore
78 + MemberStore
79 + InvitationStore
80 + OAuthClientStore
81 + SsoProviderStore
82 + TeamStore
83 + OrganizationRoleStore
84 + WalletAddressStore
85 + TwoFactorStore
86 + ApiKeyStore
87 + PasskeyStore
88 + DeviceCodeStore
89 + JwkStore
90 + TransactionStore<S>
91 + Send
92 + Sync,
93{
94}