Skip to main content

alibi_core/store/
mod.rs

1pub mod adapter;
2mod contracts;
3mod database_hooks;
4mod decorated;
5mod jwks;
6mod migrations;
7pub mod oauth_clients;
8mod org_extensions;
9pub mod scim;
10mod scim_group_patch;
11pub use scim_group_patch::{
12    ScimGroupPatch, ScimGroupPatchKind, ScimGroupPatchOperation, apply_scim_group_patch,
13    check_scim_group_cardinality, prepare_scim_group_patch,
14};
15mod secondary_sessions;
16pub mod secondary_storage;
17mod session_deletion;
18mod sso;
19pub mod stateless;
20mod wallets;
21use crate::schema::AuthSchema;
22pub(crate) use contracts::UserCreateTransform;
23use contracts::create_data;
24pub use contracts::{
25    AccountStore, AdapterAfterHook, AdapterEvent, AfterCommitErrorPolicy, ApiKeyStore,
26    AuthTransaction, BoxedTransactionValue, ConsumeApiKeyResult, DeviceCodeStore,
27    InvitationCreateOptions, InvitationStore, ListOrganizationMembersParams, MemberPageQuery,
28    MemberStore, NumericTextInput, OrganizationStore, PasskeyStore, SessionCreatedHook,
29    SessionStore, TransactionFuture, TransactionStore, TransactionWork, TwoFactorStore,
30    TypedTransactionFuture, UserCreationDefaults, UserStore, VerificationStore, transaction,
31    transaction_with_policy, verification_reservation_id, verification_reservation_key,
32    write_transaction,
33};
34pub use database_hooks::{DatabaseHookContext, DatabaseHooks, HookBackend, HookControl};
35pub(crate) use decorated::{
36    AdapterCallbacks, PluginStore, SessionCreatedCallbacks, UserTransforms,
37};
38pub use jwks::JwkStore;
39pub use migrations::SchemaMigrator;
40pub use oauth_clients::{
41    CreateOAuthClient, CreateOAuthClientResource, CreateOAuthConsent, CreateOAuthResource,
42    CreateOAuthToken, OAuthClient, OAuthClientResource, OAuthClientStore, OAuthConsent,
43    OAuthResource, OAuthToken, OAuthTokenKind,
44};
45pub use org_extensions::{OrganizationRoleStore, TeamStore, team_membership_key};
46pub use scim::{
47    CreateScimGroup, CreateScimManagedConnection, CreateScimProjectionGrant, CreateScimUser,
48    DecommissionScimManagedConnection, ReplaceScimGroup, ReplaceScimUser,
49    RevokeScimManagedCredential, RotateScimManagedCredential, ScimAuthorizationSource,
50    ScimConnectionBinding, ScimGroupMemberRecord, ScimGroupMemberships, ScimGroupPage,
51    ScimGroupRecord, ScimIdentitySource, ScimIdentityState, ScimIdentityTombstone,
52    ScimManagedConnection, ScimManagedConnectionEvent, ScimManagedConnectionState,
53    ScimManagedCreation, ScimManagedCredential, ScimManagedStore, ScimProjectedUserState,
54    ScimProjectionCandidate, ScimProjectionPreparedUser, ScimRoleExistenceInput,
55    ScimRoleMappingInput, ScimUserAttributes, ScimUserMutationContext, ScimUserPage,
56    ScimUserRecord, scim_group_membership_key,
57};
58#[cfg(feature = "redis-cache")]
59pub use secondary_storage::RedisAdapter;
60pub use secondary_storage::{CacheAdapter, MemoryCacheAdapter};
61pub(crate) use session_deletion::SessionDeletionHooks;
62pub use session_deletion::{SessionDeletionHook, SessionDeletionWork};
63pub use sso::{
64    SsoFieldType, SsoProvider, SsoProviderStore, SsoProviderUpdate, SsoProviderUpdateWork,
65    prepare_sso_fields, project_sso_provider, sso_field_column, sso_field_definition,
66    validate_sso_fields,
67};
68pub use wallets::WalletAddressStore;
69
70pub trait AuthStore<S: AuthSchema>:
71    UserStore<S>
72    + SessionStore<S>
73    + AccountStore<S>
74    + VerificationStore<S>
75    + OrganizationStore
76    + MemberStore
77    + InvitationStore
78    + OAuthClientStore
79    + SsoProviderStore
80    + ScimManagedStore
81    + TeamStore
82    + OrganizationRoleStore
83    + WalletAddressStore
84    + TwoFactorStore
85    + ApiKeyStore
86    + PasskeyStore
87    + DeviceCodeStore
88    + JwkStore
89    + TransactionStore<S>
90    + Send
91    + Sync
92{
93}
94
95impl<S, T> AuthStore<S> for T
96where
97    S: AuthSchema,
98    T: UserStore<S>
99        + SessionStore<S>
100        + AccountStore<S>
101        + VerificationStore<S>
102        + OrganizationStore
103        + MemberStore
104        + InvitationStore
105        + OAuthClientStore
106        + SsoProviderStore
107        + ScimManagedStore
108        + TeamStore
109        + OrganizationRoleStore
110        + WalletAddressStore
111        + TwoFactorStore
112        + ApiKeyStore
113        + PasskeyStore
114        + DeviceCodeStore
115        + JwkStore
116        + TransactionStore<S>
117        + Send
118        + Sync,
119{
120}