@bymax-one/nest-auth 1.5.5 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2951,6 +2951,25 @@ interface AuthDocumentSecurityParams {
2951
2951
  */
2952
2952
  declare function authDocumentSecurity({ guard, tokenDelivery }: AuthDocumentSecurityParams): readonly OpenApiSecurityRequirement[];
2953
2953
 
2954
+ /**
2955
+ * @fileoverview Tells a Redis outage from a Redis error, and answers the first with a typed 503.
2956
+ *
2957
+ * Every authentication decision here awaits Redis. When the store cannot answer, the request has
2958
+ * nothing to decide with: it is refused, and what the client can act on is that the refusal is
2959
+ * temporary. The answer is `AuthException(SERVICE_UNAVAILABLE)`, whose body carries the library
2960
+ * code and nothing of the store, and whose `cause` keeps the ioredis error for a host's logger.
2961
+ *
2962
+ * @layer Service
2963
+ */
2964
+
2965
+ /**
2966
+ * Whether an error is the typed 503 this module raises.
2967
+ *
2968
+ * @param error - A caught value.
2969
+ * @returns `true` for an `AuthException` carrying `SERVICE_UNAVAILABLE`.
2970
+ */
2971
+ declare function isServiceUnavailable(error: unknown): error is AuthException;
2972
+
2954
2973
  /**
2955
2974
  * Email provider plugin contract for @bymax-one/nest-auth.
2956
2975
  *
@@ -4063,6 +4082,12 @@ declare class NoOpAuthHooks implements IAuthHooks {
4063
4082
  interface DashboardJwtPayload {
4064
4083
  /** Unique JWT ID (UUID v4) generated by TokenManagerService for revocation. */
4065
4084
  jti: string;
4085
+ /**
4086
+ * The session this token belongs to: the refresh family id, unchanged through every rotation.
4087
+ * Absent on a token minted before the claim existed, which the re-authentication gate treats as
4088
+ * a session that earned no recent authentication.
4089
+ */
4090
+ sid?: string | undefined;
4066
4091
  /** Subject — the authenticated user's internal identifier. */
4067
4092
  sub: string;
4068
4093
  /** Tenant the user belongs to; used for data isolation. */
@@ -4119,6 +4144,8 @@ interface DashboardJwtPayload {
4119
4144
  interface PlatformJwtPayload {
4120
4145
  /** Unique JWT ID (UUID v4) generated by TokenManagerService for revocation. */
4121
4146
  jti: string;
4147
+ /** The session this token belongs to, as on {@link DashboardJwtPayload.sid}. */
4148
+ sid?: string | undefined;
4122
4149
  /** Subject — the platform administrator's internal identifier. */
4123
4150
  sub: string;
4124
4151
  /** Administrator's platform-level role (e.g. `'super_admin'`, `'support'`). */
@@ -5750,6 +5777,18 @@ declare class AllowAllBreachChecker implements IPasswordBreachChecker {
5750
5777
  isBreached(_password: string): Promise<boolean>;
5751
5778
  }
5752
5779
 
5780
+ /**
5781
+ * The Lua script that writes a new refresh session, and the check of what is passed to it.
5782
+ *
5783
+ * @layer Redis
5784
+ */
5785
+ /** A record written in the same step as the session: its key, its value and its lifetime in seconds. */
5786
+ interface SessionExtra {
5787
+ readonly key: string;
5788
+ readonly value: string;
5789
+ readonly ttl: number;
5790
+ }
5791
+
5753
5792
  /**
5754
5793
  * @fileoverview The verified-identity snapshot bound to a WebSocket upgrade ticket.
5755
5794
  *
@@ -6012,6 +6051,8 @@ declare class AuthRedisService {
6012
6051
  familyId: string;
6013
6052
  userId: string;
6014
6053
  refreshTtl: number;
6054
+ /** Records written in the same step, each with its own TTL; see {@link CREATE_SESSION_LUA}. */
6055
+ extras?: readonly SessionExtra[];
6015
6056
  }): Promise<void>;
6016
6057
  /**
6017
6058
  * Writes the session a grace recovery produced, atomically with the check that the account
@@ -7050,6 +7091,7 @@ declare class AccountStatusService {
7050
7091
  private readonly userRepo;
7051
7092
  private readonly options;
7052
7093
  private readonly platformUserRepo?;
7094
+ private readonly logger;
7053
7095
  /**
7054
7096
  * @param redis - The auth module's Redis service, holding the status and verified caches.
7055
7097
  * @param userRepo - The consumer's dashboard user repository, read on a cache miss.
@@ -7116,6 +7158,19 @@ declare class AccountStatusService {
7116
7158
  readonly userId: string;
7117
7159
  readonly tenantId: string;
7118
7160
  }): Promise<void>;
7161
+ /**
7162
+ * Stores one cached fact, best effort.
7163
+ *
7164
+ * The repository has already answered when this runs, so the decision does not depend on the
7165
+ * write: a store that cannot take it must not turn that decision into an error, and above all
7166
+ * must not answer a blocked account with an outage a client retries. A failed write is logged
7167
+ * without the store's text and the next request reads the repository again.
7168
+ *
7169
+ * @param key - The cache key.
7170
+ * @param value - The fact just read from the repository.
7171
+ * @param ttl - The cache lifetime in seconds.
7172
+ */
7173
+ private fillCache;
7119
7174
  /**
7120
7175
  * The same decision as {@link assertDashboardAccountUsable}, read from the repository now.
7121
7176
  *
@@ -9421,10 +9476,10 @@ declare class SessionService {
9421
9476
  /**
9422
9477
  * Records a new session in Redis and enforces the concurrent session limit.
9423
9478
  *
9424
- * Stores device and activity metadata under `sd:{hash}` with the same TTL
9425
- * as the refresh token. Calls `enforceSessionLimit` to evict the oldest
9426
- * session when the user has exceeded their limit. Fires the `onNewSession`
9427
- * hook (fire-and-forget) after the session is recorded.
9479
+ * The device and activity record under `sd:{hash}` is written with the session itself, by
9480
+ * `TokenManagerService.issueTokens`, so it cannot be missing for a session that exists. This
9481
+ * method calls `enforceSessionLimit` to evict the oldest session when the user has exceeded
9482
+ * their limit, and fires the `onNewSession` hook (fire-and-forget).
9428
9483
  *
9429
9484
  * @remarks
9430
9485
  * **Caller ordering contract:** This method must be called **after**
@@ -9777,6 +9832,15 @@ declare class TokenManagerService {
9777
9832
  mfaVerified?: boolean;
9778
9833
  credentialProved?: boolean;
9779
9834
  }): Promise<AuthResult>;
9835
+ /**
9836
+ * The records a new dashboard session is written with, beyond the session itself.
9837
+ *
9838
+ * The recent-authentication mark is there only when a credential was presented in this request;
9839
+ * a refresh proves possession of a token, so `reissueTokens` never writes it. It keeps its own
9840
+ * short lifetime and its key names the session, so another session of the same account cannot
9841
+ * use it. The session detail is there only when sessions are enabled.
9842
+ */
9843
+ private dashboardExtras;
9780
9844
  /**
9781
9845
  * Issues access + refresh tokens for a successfully authenticated platform admin.
9782
9846
  *
@@ -9795,9 +9859,7 @@ declare class TokenManagerService {
9795
9859
  /**
9796
9860
  * Writes the per-session detail record for a platform session under `psd:{hash}`.
9797
9861
  *
9798
- * The dashboard plane gets the equivalent `sd:{hash}` record from {@link SessionService},
9799
- * but platform sessions never had one, so a session listing had nothing to describe them
9800
- * with. The field set and the Unix-millisecond timestamps mirror the dashboard record
9862
+ * The field set and the Unix-millisecond timestamps mirror the dashboard record
9801
9863
  * exactly, so either backend sharing this Redis reads the same shape.
9802
9864
  *
9803
9865
  * @param tokenHash - SHA-256 of the raw refresh token; the key's `{hash}` segment.
@@ -9964,17 +10026,6 @@ declare class TokenManagerService {
9964
10026
  * @returns The record with `familyId`, `familyCreatedAt` and `mfaVerified` normalized.
9965
10027
  */
9966
10028
  private withOptionalFields;
9967
- /**
9968
- * Serializes a session record for storage, omitting an empty `familyId`.
9969
- *
9970
- * rust-auth skips the field when empty (`skip_serializing_if`), so emitting `"familyId":""`
9971
- * here would make the same session serialize to different bytes on each side and break the
9972
- * shared-Redis contract. A record with no family simply has no key.
9973
- *
9974
- * @param session - The record to store.
9975
- * @returns The JSON string written under an `rt:`/`prt:` key.
9976
- */
9977
- private serializeSession;
9978
10029
  /**
9979
10030
  * Constructs a session record from identity fields and request metadata.
9980
10031
  *
@@ -10968,6 +11019,18 @@ declare class MfaRecordService {
10968
11019
  * @throws {@link AuthException} `MFA_STATE_CONFLICT` when another transition holds the lock.
10969
11020
  */
10970
11021
  transition(context: 'dashboard' | 'platform', userId: string, tenantId: string | undefined, mutate: (current: AuthUser | AuthPlatformUser) => MfaRecordUpdate | null): Promise<boolean>;
11022
+ /**
11023
+ * Releases the transition lock this call took, whatever the store answers.
11024
+ *
11025
+ * A compare-and-delete: only a lock still holding this call's nonce is removed. A release that
11026
+ * fails is logged and swallowed, because the transition has already been decided by then: an
11027
+ * error here would replace the transition's own result, answering failure for a write that
11028
+ * committed or hiding the error that did occur. The lock's short TTL ends it on its own.
11029
+ *
11030
+ * @param lockKey - The account's lock key.
11031
+ * @param lockToken - The nonce this call wrote when it took the lock.
11032
+ */
11033
+ private releaseLock;
10971
11034
  /**
10972
11035
  * Claims a matched recovery code for exactly one challenge.
10973
11036
  *
@@ -11405,12 +11468,22 @@ declare class ReauthenticationService {
11405
11468
  * @param userId - The account being changed, part of the counter's key.
11406
11469
  * @param passwordHash - The account's stored hash, or `null` for an OAuth-only account.
11407
11470
  * @param password - The password the caller submitted, if any.
11471
+ * @param tenantId - The caller's tenant on the dashboard plane, part of the key.
11472
+ * @param sid - The caller's session, from its token; only an account with no password reads it.
11408
11473
  * @throws {@link AuthException} `ACCOUNT_LOCKED` once the failure budget for this flow is
11409
11474
  * spent, or `INVALID_CREDENTIALS` when the account has a password and the submitted one is
11410
11475
  * absent or wrong. The latter is deliberately the same code a failed login returns: an
11411
11476
  * attacker holding a stolen token learns nothing from it that a failed login does not tell them.
11412
11477
  */
11413
- assertReauthenticated(context: MfaFlowPlane, userId: string, passwordHash: string | null, password: string | undefined, tenantId: string | undefined): Promise<void>;
11478
+ assertReauthenticated(context: MfaFlowPlane, userId: string, passwordHash: string | null, password: string | undefined, tenantId: string | undefined, sid: string | undefined): Promise<void>;
11479
+ /**
11480
+ * The recent-authentication mark of the caller's own session, or `null` when there is none.
11481
+ *
11482
+ * The proof is the caller's own: the mark is keyed by the session that earned it, so another
11483
+ * session of the same account cannot borrow it. A token with no usable `sid`, one minted before
11484
+ * the claim existed, names no session and earns nothing, so no key is read for it.
11485
+ */
11486
+ private recentMark;
11414
11487
  }
11415
11488
 
11416
11489
  /**
@@ -11482,6 +11555,7 @@ declare class MfaService {
11482
11555
  *
11483
11556
  * @param userId - Internal ID of the user enabling MFA.
11484
11557
  * @param context - Which repository to use: `'dashboard'` (default) or `'platform'`.
11558
+ * @param sid - The caller's session (its token's `sid`), for an account with no local password.
11485
11559
  * @returns Setup result containing the secret, QR URI, and plain recovery codes.
11486
11560
  * @throws `MFA_ALREADY_ENABLED` if MFA is already active on the account.
11487
11561
  * @throws `MFA_NOT_ENABLED` if `context === 'platform'` and the platform user
@@ -11489,7 +11563,7 @@ declare class MfaService {
11489
11563
  * reused (rather than introducing a new one) because the consumer-facing
11490
11564
  * meaning is the same: "platform MFA cannot operate".
11491
11565
  */
11492
- setup(userId: string, context?: 'dashboard' | 'platform', password?: string, tenantId?: string): Promise<MfaSetupResult>;
11566
+ setup(userId: string, context?: 'dashboard' | 'platform', password?: string, tenantId?: string, sid?: string): Promise<MfaSetupResult>;
11493
11567
  /**
11494
11568
  * Verifies the first TOTP code from the user's authenticator app and permanently
11495
11569
  * enables MFA on the account.
@@ -14159,7 +14233,7 @@ declare class WorkspaceCallerService {
14159
14233
  * lockout ceiling, `auth.reauthentication_required` for a passwordless account with no recent
14160
14234
  * sign-in.
14161
14235
  */
14162
- reauthenticate(caller: Pick<DashboardJwtPayload, 'sub' | 'tenantId'>, password: string | undefined): Promise<void>;
14236
+ reauthenticate(caller: Pick<DashboardJwtPayload, 'sub' | 'tenantId' | 'sid'>, password: string | undefined): Promise<void>;
14163
14237
  private find;
14164
14238
  }
14165
14239
 
@@ -14308,7 +14382,7 @@ declare class WorkspaceService {
14308
14382
  */
14309
14383
 
14310
14384
  /** The verified token of the caller: who they are and the tenant they belong to. */
14311
- type Caller = Pick<DashboardJwtPayload, 'sub' | 'tenantId'>;
14385
+ type Caller = Pick<DashboardJwtPayload, 'sub' | 'tenantId' | 'sid'>;
14312
14386
  /** What a hand-over of ownership names: the receiver, the role the giver keeps, and the giver's proof. */
14313
14387
  interface HandOver {
14314
14388
  /** The member who becomes an owner. */
@@ -14548,5 +14622,5 @@ declare class WorkspaceInvitationService {
14548
14622
  private activeWorkspace;
14549
14623
  }
14550
14624
 
14551
- export { ALLOW_PENDING_WORKSPACE_KEY, ANY_WORKSPACE_MEMBER, API_KEY_MAX_LABEL_LENGTH, API_KEY_MAX_OVERLAP_SECONDS, AUTH_EMAIL_KINDS, AUTH_ERROR_CODES, AUTH_ERROR_MESSAGES, AUTH_ERROR_STATUS, AUTH_SECRET_MIN_LENGTH, AUTH_SECURITY_SCHEMES, AUTH_THROTTLE_CONFIGS, AcceptInvitationDto, AccountStatusService, AllowAllBreachChecker, AllowPendingWorkspace, ApiKeyGuard, ApiKeyScopes, ApiKeyService, AuthException, AuthExceptionFilter, AuthRateLimit, AuthRateLimitGuard, AuthRevocationService, AuthService, AuthTokenVerifierService, Authenticated, BYMAX_AUTH_API_KEY_CLOCK, BYMAX_AUTH_API_KEY_REPOSITORY, BYMAX_AUTH_BREACH_CHECKER, BYMAX_AUTH_EMAIL_PROVIDER, BYMAX_AUTH_HOOKS, BYMAX_AUTH_MEMBERSHIP_REPOSITORY, BYMAX_AUTH_OPTIONS, BYMAX_AUTH_PLATFORM_USER_REPOSITORY, BYMAX_AUTH_REDIS_CLIENT, BYMAX_AUTH_USER_REPOSITORY, BYMAX_AUTH_WORKSPACE_REPOSITORY, BruteForceService, BymaxAuthModule, ChangePasswordDto, CommonPasswordChecker, CreateInvitationDto, CurrentApiKey, CurrentUser, CurrentWorkspace, CurrentWsWorkspace, DefaultAuthEmailProvider, EmailChangeService, ForgotPasswordDto, HibpBreachChecker, IS_PUBLIC_KEY, InvitationService, JwtAuthGuard, JwtPlatformGuard, LoginDto, MembershipBumpFailedError, MembershipService, MfaChallengeDto, MfaDisableDto, MfaRegenerateRecoveryCodesDto, MfaRequiredGuard, MfaService, MfaVerifyDto, NoOpAuthHooks, NoOpEmailProvider, OAuthService, OptionalAuthGuard, OtpService, PLATFORM_ROLES_KEY, PasswordResetService, PlatformAuthService, PlatformLoginDto, PlatformRoles, PlatformRolesGuard, Public, ROLES_KEY, ReauthenticationService, RegisterDto, RequestEncoding, RequestEncodingGuard, ResendOtpDto, ResendVerificationDto, ResetPasswordDto, Roles, RolesGuard, SKIP_MFA_KEY, SelfOrAdminGuard, ServiceKey, SessionService, SkipMfa, TokenDeliveryService, TrustedOriginGuard, UserStatusGuard, VerifyEmailDto, VerifyOtpDto, WORKSPACE_CURSOR_MAX_LENGTH, WORKSPACE_CURSOR_PART_MAX_LENGTH, WORKSPACE_ID_MAX_LENGTH, WORKSPACE_OWNER_ROLE_MAX_LENGTH, WORKSPACE_PERMISSION_KEY, WORKSPACE_ROLES_KEY, WS_TICKET_TTL_SECONDS, WorkspaceAccessService, WorkspaceActionsService, WorkspaceCallerService, WorkspaceGuard, WorkspaceInvitationService, WorkspacePermission, WorkspaceRoles, WorkspaceService, WsAuthExceptionFilter, WsJwtGuard, WsTicketService, WsWorkspaceGuard, assertWorkspaceId, authDocumentSecurity, createAuthValidationPipe, decodeWorkspaceCursor, decodeWorkspaceScopedName, decrypt, describeChannelStatus, describeError, encodeWorkspaceCursor, encrypt, generateSecureToken, hasRole, hmacSha256, isWorkspaceOwnerRole, readWorkspacePosition, redactSecrets, reduceToBaseWord, sanitizeHeaders, sha256, sleep, stampJobContext, timingSafeCompare, workspacePositionOf, workspaceQueryKey, workspaceScopedName };
14625
+ export { ALLOW_PENDING_WORKSPACE_KEY, ANY_WORKSPACE_MEMBER, API_KEY_MAX_LABEL_LENGTH, API_KEY_MAX_OVERLAP_SECONDS, AUTH_EMAIL_KINDS, AUTH_ERROR_CODES, AUTH_ERROR_MESSAGES, AUTH_ERROR_STATUS, AUTH_SECRET_MIN_LENGTH, AUTH_SECURITY_SCHEMES, AUTH_THROTTLE_CONFIGS, AcceptInvitationDto, AccountStatusService, AllowAllBreachChecker, AllowPendingWorkspace, ApiKeyGuard, ApiKeyScopes, ApiKeyService, AuthException, AuthExceptionFilter, AuthRateLimit, AuthRateLimitGuard, AuthRevocationService, AuthService, AuthTokenVerifierService, Authenticated, BYMAX_AUTH_API_KEY_CLOCK, BYMAX_AUTH_API_KEY_REPOSITORY, BYMAX_AUTH_BREACH_CHECKER, BYMAX_AUTH_EMAIL_PROVIDER, BYMAX_AUTH_HOOKS, BYMAX_AUTH_MEMBERSHIP_REPOSITORY, BYMAX_AUTH_OPTIONS, BYMAX_AUTH_PLATFORM_USER_REPOSITORY, BYMAX_AUTH_REDIS_CLIENT, BYMAX_AUTH_USER_REPOSITORY, BYMAX_AUTH_WORKSPACE_REPOSITORY, BruteForceService, BymaxAuthModule, ChangePasswordDto, CommonPasswordChecker, CreateInvitationDto, CurrentApiKey, CurrentUser, CurrentWorkspace, CurrentWsWorkspace, DefaultAuthEmailProvider, EmailChangeService, ForgotPasswordDto, HibpBreachChecker, IS_PUBLIC_KEY, InvitationService, JwtAuthGuard, JwtPlatformGuard, LoginDto, MembershipBumpFailedError, MembershipService, MfaChallengeDto, MfaDisableDto, MfaRegenerateRecoveryCodesDto, MfaRequiredGuard, MfaService, MfaVerifyDto, NoOpAuthHooks, NoOpEmailProvider, OAuthService, OptionalAuthGuard, OtpService, PLATFORM_ROLES_KEY, PasswordResetService, PlatformAuthService, PlatformLoginDto, PlatformRoles, PlatformRolesGuard, Public, ROLES_KEY, ReauthenticationService, RegisterDto, RequestEncoding, RequestEncodingGuard, ResendOtpDto, ResendVerificationDto, ResetPasswordDto, Roles, RolesGuard, SKIP_MFA_KEY, SelfOrAdminGuard, ServiceKey, SessionService, SkipMfa, TokenDeliveryService, TrustedOriginGuard, UserStatusGuard, VerifyEmailDto, VerifyOtpDto, WORKSPACE_CURSOR_MAX_LENGTH, WORKSPACE_CURSOR_PART_MAX_LENGTH, WORKSPACE_ID_MAX_LENGTH, WORKSPACE_OWNER_ROLE_MAX_LENGTH, WORKSPACE_PERMISSION_KEY, WORKSPACE_ROLES_KEY, WS_TICKET_TTL_SECONDS, WorkspaceAccessService, WorkspaceActionsService, WorkspaceCallerService, WorkspaceGuard, WorkspaceInvitationService, WorkspacePermission, WorkspaceRoles, WorkspaceService, WsAuthExceptionFilter, WsJwtGuard, WsTicketService, WsWorkspaceGuard, assertWorkspaceId, authDocumentSecurity, createAuthValidationPipe, decodeWorkspaceCursor, decodeWorkspaceScopedName, decrypt, describeChannelStatus, describeError, encodeWorkspaceCursor, encrypt, generateSecureToken, hasRole, hmacSha256, isServiceUnavailable, isWorkspaceOwnerRole, readWorkspacePosition, redactSecrets, reduceToBaseWord, sanitizeHeaders, sha256, sleep, stampJobContext, timingSafeCompare, workspacePositionOf, workspaceQueryKey, workspaceScopedName };
14552
14626
  export type { AcceptedInvitation, AcceptedSignup, AccountRemovalAudit, ActingMember, ApiKeyAccessEvent, ApiKeyClock, ApiKeyDenyReason, ApiKeyPrincipal, AuthApiKey, AuthApiKeySummary, AuthDocumentSecurityParams, AuthEmailCatalogue, AuthEmailContext, AuthEmailKind, AuthEmailMessage, AuthEmailSink, AuthErrorCode, AuthFieldError, AuthGuardFamily, AuthMembership, AuthModuleAsyncOptions, AuthPlane, AuthPlatformUser, AuthRateLimitWindow, AuthResult, AuthUser, AuthWorkspace, AuthenticatedRequest, BearerAuthResponse, BeforeRegisterResult, BeforeWorkspaceCreateResult, BootstrapInvitationRecord, BothAuthResponse, BymaxAuthModuleOptions, BymaxAuthRateLimitOptions, ChangeMembershipRoleParams, ClientIpSource, CookieAuthResponse, CountOwnedParams, CreateMembershipParams, CreateMembershipResult, CreateSessionParams, CreateUserData, CreateWithOAuthData, CreateWorkspaceResult, CreateWorkspaceWithOwnerParams, CurrentWorkspaceContext, DashboardJwtPayload, DefaultAuthEmailProviderOptions, DeliveryErrorPolicy, DeliveryErrorPolicyMap, FinalizeResult, FindUserByEmailParams, FindUserByOAuthIdParams, GuardedWriteResult, HookContext, IApiKeyRepository, IAuthHooks, IEmailProvider, IMembershipRepository, IPasswordBreachChecker, IPlatformUserRepository, IUserRepository, IWorkspaceRepository, InviteData, IssueApiKeyInput, IssuedApiKey, LastActiveWorkspaceRef, LinkOAuthParams, ListMembershipsForUserParams, ListMembershipsForWorkspaceParams, ListSessionsParams, ListSoleOwnedParams, LiveSessionParams, MemberChangeResult, MemberInvitationRecord, MembershipPage, MembershipRef, MembershipStatus, MembershipWithWorkspace, MfaChallengeResult, MfaSetupResult, MfaTempPayload, MyWorkspaces, OAuthLoginResult, OAuthMfaChallengeResult, OAuthProfile, OAuthProviderPlugin, OpenApiSecurityRequirement, PlatformAuthResult, PlatformAuthenticatedRequest, PlatformBearerAuthResponse, PlatformJwtPayload, RegistrationMode, RemoveAllMembershipsParams, RemoveAllMembershipsResult, RemoveMembershipParams, RemovedMembership, RenameWorkspaceParams, RenameWorkspaceResult, RequestEncodingPolicy, ResolvedOptions, ResolvedWorkspaceMember, RevocableTokenPayload, RevokeAllExceptCurrentParams, RevokeAllSessionsParams, RevokeSessionParams, RotateApiKeyInput, RotatedTokenResult, SafeAuthPlatformUser, SafeAuthUser, ScheduledDeletion, SessionAlertInfo, SessionInfo, SetLastActiveWorkspaceParams, SignupRequest, StoredWorkspaceInvitation, TenantResolverRequest, TenantScopedUserRef, TransferOwnershipParams, TransferOwnershipResult, UpdateEmailParams, UpdateEmailVerifiedParams, UpdateMfaData, UpdateMfaParams, UpdatePasswordParams, UpdatePlatformMfaData, UpdateStatusParams, UpdateWorkspaceStatusParams, UpdateWorkspaceStatusResult, VerifiedAccessToken, VerifiedWorkspaceAccessToken, VerifyAccessTokenOptions, WorkspaceAccess, WorkspaceAccessView, WorkspaceAction, WorkspaceActor, WorkspaceAuditEvent, WorkspaceCheck, WorkspaceInvitationPreview, WorkspaceInvitationView, WorkspaceInviteData, WorkspaceJobContext, WorkspaceOptions, WorkspacePermissionOptions, WorkspaceRef, WorkspaceRequest, WorkspaceRoleList, WorkspaceStatus, WsTicketSnapshot };
@@ -2951,6 +2951,25 @@ interface AuthDocumentSecurityParams {
2951
2951
  */
2952
2952
  declare function authDocumentSecurity({ guard, tokenDelivery }: AuthDocumentSecurityParams): readonly OpenApiSecurityRequirement[];
2953
2953
 
2954
+ /**
2955
+ * @fileoverview Tells a Redis outage from a Redis error, and answers the first with a typed 503.
2956
+ *
2957
+ * Every authentication decision here awaits Redis. When the store cannot answer, the request has
2958
+ * nothing to decide with: it is refused, and what the client can act on is that the refusal is
2959
+ * temporary. The answer is `AuthException(SERVICE_UNAVAILABLE)`, whose body carries the library
2960
+ * code and nothing of the store, and whose `cause` keeps the ioredis error for a host's logger.
2961
+ *
2962
+ * @layer Service
2963
+ */
2964
+
2965
+ /**
2966
+ * Whether an error is the typed 503 this module raises.
2967
+ *
2968
+ * @param error - A caught value.
2969
+ * @returns `true` for an `AuthException` carrying `SERVICE_UNAVAILABLE`.
2970
+ */
2971
+ declare function isServiceUnavailable(error: unknown): error is AuthException;
2972
+
2954
2973
  /**
2955
2974
  * Email provider plugin contract for @bymax-one/nest-auth.
2956
2975
  *
@@ -4063,6 +4082,12 @@ declare class NoOpAuthHooks implements IAuthHooks {
4063
4082
  interface DashboardJwtPayload {
4064
4083
  /** Unique JWT ID (UUID v4) generated by TokenManagerService for revocation. */
4065
4084
  jti: string;
4085
+ /**
4086
+ * The session this token belongs to: the refresh family id, unchanged through every rotation.
4087
+ * Absent on a token minted before the claim existed, which the re-authentication gate treats as
4088
+ * a session that earned no recent authentication.
4089
+ */
4090
+ sid?: string | undefined;
4066
4091
  /** Subject — the authenticated user's internal identifier. */
4067
4092
  sub: string;
4068
4093
  /** Tenant the user belongs to; used for data isolation. */
@@ -4119,6 +4144,8 @@ interface DashboardJwtPayload {
4119
4144
  interface PlatformJwtPayload {
4120
4145
  /** Unique JWT ID (UUID v4) generated by TokenManagerService for revocation. */
4121
4146
  jti: string;
4147
+ /** The session this token belongs to, as on {@link DashboardJwtPayload.sid}. */
4148
+ sid?: string | undefined;
4122
4149
  /** Subject — the platform administrator's internal identifier. */
4123
4150
  sub: string;
4124
4151
  /** Administrator's platform-level role (e.g. `'super_admin'`, `'support'`). */
@@ -5750,6 +5777,18 @@ declare class AllowAllBreachChecker implements IPasswordBreachChecker {
5750
5777
  isBreached(_password: string): Promise<boolean>;
5751
5778
  }
5752
5779
 
5780
+ /**
5781
+ * The Lua script that writes a new refresh session, and the check of what is passed to it.
5782
+ *
5783
+ * @layer Redis
5784
+ */
5785
+ /** A record written in the same step as the session: its key, its value and its lifetime in seconds. */
5786
+ interface SessionExtra {
5787
+ readonly key: string;
5788
+ readonly value: string;
5789
+ readonly ttl: number;
5790
+ }
5791
+
5753
5792
  /**
5754
5793
  * @fileoverview The verified-identity snapshot bound to a WebSocket upgrade ticket.
5755
5794
  *
@@ -6012,6 +6051,8 @@ declare class AuthRedisService {
6012
6051
  familyId: string;
6013
6052
  userId: string;
6014
6053
  refreshTtl: number;
6054
+ /** Records written in the same step, each with its own TTL; see {@link CREATE_SESSION_LUA}. */
6055
+ extras?: readonly SessionExtra[];
6015
6056
  }): Promise<void>;
6016
6057
  /**
6017
6058
  * Writes the session a grace recovery produced, atomically with the check that the account
@@ -7050,6 +7091,7 @@ declare class AccountStatusService {
7050
7091
  private readonly userRepo;
7051
7092
  private readonly options;
7052
7093
  private readonly platformUserRepo?;
7094
+ private readonly logger;
7053
7095
  /**
7054
7096
  * @param redis - The auth module's Redis service, holding the status and verified caches.
7055
7097
  * @param userRepo - The consumer's dashboard user repository, read on a cache miss.
@@ -7116,6 +7158,19 @@ declare class AccountStatusService {
7116
7158
  readonly userId: string;
7117
7159
  readonly tenantId: string;
7118
7160
  }): Promise<void>;
7161
+ /**
7162
+ * Stores one cached fact, best effort.
7163
+ *
7164
+ * The repository has already answered when this runs, so the decision does not depend on the
7165
+ * write: a store that cannot take it must not turn that decision into an error, and above all
7166
+ * must not answer a blocked account with an outage a client retries. A failed write is logged
7167
+ * without the store's text and the next request reads the repository again.
7168
+ *
7169
+ * @param key - The cache key.
7170
+ * @param value - The fact just read from the repository.
7171
+ * @param ttl - The cache lifetime in seconds.
7172
+ */
7173
+ private fillCache;
7119
7174
  /**
7120
7175
  * The same decision as {@link assertDashboardAccountUsable}, read from the repository now.
7121
7176
  *
@@ -9421,10 +9476,10 @@ declare class SessionService {
9421
9476
  /**
9422
9477
  * Records a new session in Redis and enforces the concurrent session limit.
9423
9478
  *
9424
- * Stores device and activity metadata under `sd:{hash}` with the same TTL
9425
- * as the refresh token. Calls `enforceSessionLimit` to evict the oldest
9426
- * session when the user has exceeded their limit. Fires the `onNewSession`
9427
- * hook (fire-and-forget) after the session is recorded.
9479
+ * The device and activity record under `sd:{hash}` is written with the session itself, by
9480
+ * `TokenManagerService.issueTokens`, so it cannot be missing for a session that exists. This
9481
+ * method calls `enforceSessionLimit` to evict the oldest session when the user has exceeded
9482
+ * their limit, and fires the `onNewSession` hook (fire-and-forget).
9428
9483
  *
9429
9484
  * @remarks
9430
9485
  * **Caller ordering contract:** This method must be called **after**
@@ -9777,6 +9832,15 @@ declare class TokenManagerService {
9777
9832
  mfaVerified?: boolean;
9778
9833
  credentialProved?: boolean;
9779
9834
  }): Promise<AuthResult>;
9835
+ /**
9836
+ * The records a new dashboard session is written with, beyond the session itself.
9837
+ *
9838
+ * The recent-authentication mark is there only when a credential was presented in this request;
9839
+ * a refresh proves possession of a token, so `reissueTokens` never writes it. It keeps its own
9840
+ * short lifetime and its key names the session, so another session of the same account cannot
9841
+ * use it. The session detail is there only when sessions are enabled.
9842
+ */
9843
+ private dashboardExtras;
9780
9844
  /**
9781
9845
  * Issues access + refresh tokens for a successfully authenticated platform admin.
9782
9846
  *
@@ -9795,9 +9859,7 @@ declare class TokenManagerService {
9795
9859
  /**
9796
9860
  * Writes the per-session detail record for a platform session under `psd:{hash}`.
9797
9861
  *
9798
- * The dashboard plane gets the equivalent `sd:{hash}` record from {@link SessionService},
9799
- * but platform sessions never had one, so a session listing had nothing to describe them
9800
- * with. The field set and the Unix-millisecond timestamps mirror the dashboard record
9862
+ * The field set and the Unix-millisecond timestamps mirror the dashboard record
9801
9863
  * exactly, so either backend sharing this Redis reads the same shape.
9802
9864
  *
9803
9865
  * @param tokenHash - SHA-256 of the raw refresh token; the key's `{hash}` segment.
@@ -9964,17 +10026,6 @@ declare class TokenManagerService {
9964
10026
  * @returns The record with `familyId`, `familyCreatedAt` and `mfaVerified` normalized.
9965
10027
  */
9966
10028
  private withOptionalFields;
9967
- /**
9968
- * Serializes a session record for storage, omitting an empty `familyId`.
9969
- *
9970
- * rust-auth skips the field when empty (`skip_serializing_if`), so emitting `"familyId":""`
9971
- * here would make the same session serialize to different bytes on each side and break the
9972
- * shared-Redis contract. A record with no family simply has no key.
9973
- *
9974
- * @param session - The record to store.
9975
- * @returns The JSON string written under an `rt:`/`prt:` key.
9976
- */
9977
- private serializeSession;
9978
10029
  /**
9979
10030
  * Constructs a session record from identity fields and request metadata.
9980
10031
  *
@@ -10968,6 +11019,18 @@ declare class MfaRecordService {
10968
11019
  * @throws {@link AuthException} `MFA_STATE_CONFLICT` when another transition holds the lock.
10969
11020
  */
10970
11021
  transition(context: 'dashboard' | 'platform', userId: string, tenantId: string | undefined, mutate: (current: AuthUser | AuthPlatformUser) => MfaRecordUpdate | null): Promise<boolean>;
11022
+ /**
11023
+ * Releases the transition lock this call took, whatever the store answers.
11024
+ *
11025
+ * A compare-and-delete: only a lock still holding this call's nonce is removed. A release that
11026
+ * fails is logged and swallowed, because the transition has already been decided by then: an
11027
+ * error here would replace the transition's own result, answering failure for a write that
11028
+ * committed or hiding the error that did occur. The lock's short TTL ends it on its own.
11029
+ *
11030
+ * @param lockKey - The account's lock key.
11031
+ * @param lockToken - The nonce this call wrote when it took the lock.
11032
+ */
11033
+ private releaseLock;
10971
11034
  /**
10972
11035
  * Claims a matched recovery code for exactly one challenge.
10973
11036
  *
@@ -11405,12 +11468,22 @@ declare class ReauthenticationService {
11405
11468
  * @param userId - The account being changed, part of the counter's key.
11406
11469
  * @param passwordHash - The account's stored hash, or `null` for an OAuth-only account.
11407
11470
  * @param password - The password the caller submitted, if any.
11471
+ * @param tenantId - The caller's tenant on the dashboard plane, part of the key.
11472
+ * @param sid - The caller's session, from its token; only an account with no password reads it.
11408
11473
  * @throws {@link AuthException} `ACCOUNT_LOCKED` once the failure budget for this flow is
11409
11474
  * spent, or `INVALID_CREDENTIALS` when the account has a password and the submitted one is
11410
11475
  * absent or wrong. The latter is deliberately the same code a failed login returns: an
11411
11476
  * attacker holding a stolen token learns nothing from it that a failed login does not tell them.
11412
11477
  */
11413
- assertReauthenticated(context: MfaFlowPlane, userId: string, passwordHash: string | null, password: string | undefined, tenantId: string | undefined): Promise<void>;
11478
+ assertReauthenticated(context: MfaFlowPlane, userId: string, passwordHash: string | null, password: string | undefined, tenantId: string | undefined, sid: string | undefined): Promise<void>;
11479
+ /**
11480
+ * The recent-authentication mark of the caller's own session, or `null` when there is none.
11481
+ *
11482
+ * The proof is the caller's own: the mark is keyed by the session that earned it, so another
11483
+ * session of the same account cannot borrow it. A token with no usable `sid`, one minted before
11484
+ * the claim existed, names no session and earns nothing, so no key is read for it.
11485
+ */
11486
+ private recentMark;
11414
11487
  }
11415
11488
 
11416
11489
  /**
@@ -11482,6 +11555,7 @@ declare class MfaService {
11482
11555
  *
11483
11556
  * @param userId - Internal ID of the user enabling MFA.
11484
11557
  * @param context - Which repository to use: `'dashboard'` (default) or `'platform'`.
11558
+ * @param sid - The caller's session (its token's `sid`), for an account with no local password.
11485
11559
  * @returns Setup result containing the secret, QR URI, and plain recovery codes.
11486
11560
  * @throws `MFA_ALREADY_ENABLED` if MFA is already active on the account.
11487
11561
  * @throws `MFA_NOT_ENABLED` if `context === 'platform'` and the platform user
@@ -11489,7 +11563,7 @@ declare class MfaService {
11489
11563
  * reused (rather than introducing a new one) because the consumer-facing
11490
11564
  * meaning is the same: "platform MFA cannot operate".
11491
11565
  */
11492
- setup(userId: string, context?: 'dashboard' | 'platform', password?: string, tenantId?: string): Promise<MfaSetupResult>;
11566
+ setup(userId: string, context?: 'dashboard' | 'platform', password?: string, tenantId?: string, sid?: string): Promise<MfaSetupResult>;
11493
11567
  /**
11494
11568
  * Verifies the first TOTP code from the user's authenticator app and permanently
11495
11569
  * enables MFA on the account.
@@ -14159,7 +14233,7 @@ declare class WorkspaceCallerService {
14159
14233
  * lockout ceiling, `auth.reauthentication_required` for a passwordless account with no recent
14160
14234
  * sign-in.
14161
14235
  */
14162
- reauthenticate(caller: Pick<DashboardJwtPayload, 'sub' | 'tenantId'>, password: string | undefined): Promise<void>;
14236
+ reauthenticate(caller: Pick<DashboardJwtPayload, 'sub' | 'tenantId' | 'sid'>, password: string | undefined): Promise<void>;
14163
14237
  private find;
14164
14238
  }
14165
14239
 
@@ -14308,7 +14382,7 @@ declare class WorkspaceService {
14308
14382
  */
14309
14383
 
14310
14384
  /** The verified token of the caller: who they are and the tenant they belong to. */
14311
- type Caller = Pick<DashboardJwtPayload, 'sub' | 'tenantId'>;
14385
+ type Caller = Pick<DashboardJwtPayload, 'sub' | 'tenantId' | 'sid'>;
14312
14386
  /** What a hand-over of ownership names: the receiver, the role the giver keeps, and the giver's proof. */
14313
14387
  interface HandOver {
14314
14388
  /** The member who becomes an owner. */
@@ -14548,5 +14622,5 @@ declare class WorkspaceInvitationService {
14548
14622
  private activeWorkspace;
14549
14623
  }
14550
14624
 
14551
- export { ALLOW_PENDING_WORKSPACE_KEY, ANY_WORKSPACE_MEMBER, API_KEY_MAX_LABEL_LENGTH, API_KEY_MAX_OVERLAP_SECONDS, AUTH_EMAIL_KINDS, AUTH_ERROR_CODES, AUTH_ERROR_MESSAGES, AUTH_ERROR_STATUS, AUTH_SECRET_MIN_LENGTH, AUTH_SECURITY_SCHEMES, AUTH_THROTTLE_CONFIGS, AcceptInvitationDto, AccountStatusService, AllowAllBreachChecker, AllowPendingWorkspace, ApiKeyGuard, ApiKeyScopes, ApiKeyService, AuthException, AuthExceptionFilter, AuthRateLimit, AuthRateLimitGuard, AuthRevocationService, AuthService, AuthTokenVerifierService, Authenticated, BYMAX_AUTH_API_KEY_CLOCK, BYMAX_AUTH_API_KEY_REPOSITORY, BYMAX_AUTH_BREACH_CHECKER, BYMAX_AUTH_EMAIL_PROVIDER, BYMAX_AUTH_HOOKS, BYMAX_AUTH_MEMBERSHIP_REPOSITORY, BYMAX_AUTH_OPTIONS, BYMAX_AUTH_PLATFORM_USER_REPOSITORY, BYMAX_AUTH_REDIS_CLIENT, BYMAX_AUTH_USER_REPOSITORY, BYMAX_AUTH_WORKSPACE_REPOSITORY, BruteForceService, BymaxAuthModule, ChangePasswordDto, CommonPasswordChecker, CreateInvitationDto, CurrentApiKey, CurrentUser, CurrentWorkspace, CurrentWsWorkspace, DefaultAuthEmailProvider, EmailChangeService, ForgotPasswordDto, HibpBreachChecker, IS_PUBLIC_KEY, InvitationService, JwtAuthGuard, JwtPlatformGuard, LoginDto, MembershipBumpFailedError, MembershipService, MfaChallengeDto, MfaDisableDto, MfaRegenerateRecoveryCodesDto, MfaRequiredGuard, MfaService, MfaVerifyDto, NoOpAuthHooks, NoOpEmailProvider, OAuthService, OptionalAuthGuard, OtpService, PLATFORM_ROLES_KEY, PasswordResetService, PlatformAuthService, PlatformLoginDto, PlatformRoles, PlatformRolesGuard, Public, ROLES_KEY, ReauthenticationService, RegisterDto, RequestEncoding, RequestEncodingGuard, ResendOtpDto, ResendVerificationDto, ResetPasswordDto, Roles, RolesGuard, SKIP_MFA_KEY, SelfOrAdminGuard, ServiceKey, SessionService, SkipMfa, TokenDeliveryService, TrustedOriginGuard, UserStatusGuard, VerifyEmailDto, VerifyOtpDto, WORKSPACE_CURSOR_MAX_LENGTH, WORKSPACE_CURSOR_PART_MAX_LENGTH, WORKSPACE_ID_MAX_LENGTH, WORKSPACE_OWNER_ROLE_MAX_LENGTH, WORKSPACE_PERMISSION_KEY, WORKSPACE_ROLES_KEY, WS_TICKET_TTL_SECONDS, WorkspaceAccessService, WorkspaceActionsService, WorkspaceCallerService, WorkspaceGuard, WorkspaceInvitationService, WorkspacePermission, WorkspaceRoles, WorkspaceService, WsAuthExceptionFilter, WsJwtGuard, WsTicketService, WsWorkspaceGuard, assertWorkspaceId, authDocumentSecurity, createAuthValidationPipe, decodeWorkspaceCursor, decodeWorkspaceScopedName, decrypt, describeChannelStatus, describeError, encodeWorkspaceCursor, encrypt, generateSecureToken, hasRole, hmacSha256, isWorkspaceOwnerRole, readWorkspacePosition, redactSecrets, reduceToBaseWord, sanitizeHeaders, sha256, sleep, stampJobContext, timingSafeCompare, workspacePositionOf, workspaceQueryKey, workspaceScopedName };
14625
+ export { ALLOW_PENDING_WORKSPACE_KEY, ANY_WORKSPACE_MEMBER, API_KEY_MAX_LABEL_LENGTH, API_KEY_MAX_OVERLAP_SECONDS, AUTH_EMAIL_KINDS, AUTH_ERROR_CODES, AUTH_ERROR_MESSAGES, AUTH_ERROR_STATUS, AUTH_SECRET_MIN_LENGTH, AUTH_SECURITY_SCHEMES, AUTH_THROTTLE_CONFIGS, AcceptInvitationDto, AccountStatusService, AllowAllBreachChecker, AllowPendingWorkspace, ApiKeyGuard, ApiKeyScopes, ApiKeyService, AuthException, AuthExceptionFilter, AuthRateLimit, AuthRateLimitGuard, AuthRevocationService, AuthService, AuthTokenVerifierService, Authenticated, BYMAX_AUTH_API_KEY_CLOCK, BYMAX_AUTH_API_KEY_REPOSITORY, BYMAX_AUTH_BREACH_CHECKER, BYMAX_AUTH_EMAIL_PROVIDER, BYMAX_AUTH_HOOKS, BYMAX_AUTH_MEMBERSHIP_REPOSITORY, BYMAX_AUTH_OPTIONS, BYMAX_AUTH_PLATFORM_USER_REPOSITORY, BYMAX_AUTH_REDIS_CLIENT, BYMAX_AUTH_USER_REPOSITORY, BYMAX_AUTH_WORKSPACE_REPOSITORY, BruteForceService, BymaxAuthModule, ChangePasswordDto, CommonPasswordChecker, CreateInvitationDto, CurrentApiKey, CurrentUser, CurrentWorkspace, CurrentWsWorkspace, DefaultAuthEmailProvider, EmailChangeService, ForgotPasswordDto, HibpBreachChecker, IS_PUBLIC_KEY, InvitationService, JwtAuthGuard, JwtPlatformGuard, LoginDto, MembershipBumpFailedError, MembershipService, MfaChallengeDto, MfaDisableDto, MfaRegenerateRecoveryCodesDto, MfaRequiredGuard, MfaService, MfaVerifyDto, NoOpAuthHooks, NoOpEmailProvider, OAuthService, OptionalAuthGuard, OtpService, PLATFORM_ROLES_KEY, PasswordResetService, PlatformAuthService, PlatformLoginDto, PlatformRoles, PlatformRolesGuard, Public, ROLES_KEY, ReauthenticationService, RegisterDto, RequestEncoding, RequestEncodingGuard, ResendOtpDto, ResendVerificationDto, ResetPasswordDto, Roles, RolesGuard, SKIP_MFA_KEY, SelfOrAdminGuard, ServiceKey, SessionService, SkipMfa, TokenDeliveryService, TrustedOriginGuard, UserStatusGuard, VerifyEmailDto, VerifyOtpDto, WORKSPACE_CURSOR_MAX_LENGTH, WORKSPACE_CURSOR_PART_MAX_LENGTH, WORKSPACE_ID_MAX_LENGTH, WORKSPACE_OWNER_ROLE_MAX_LENGTH, WORKSPACE_PERMISSION_KEY, WORKSPACE_ROLES_KEY, WS_TICKET_TTL_SECONDS, WorkspaceAccessService, WorkspaceActionsService, WorkspaceCallerService, WorkspaceGuard, WorkspaceInvitationService, WorkspacePermission, WorkspaceRoles, WorkspaceService, WsAuthExceptionFilter, WsJwtGuard, WsTicketService, WsWorkspaceGuard, assertWorkspaceId, authDocumentSecurity, createAuthValidationPipe, decodeWorkspaceCursor, decodeWorkspaceScopedName, decrypt, describeChannelStatus, describeError, encodeWorkspaceCursor, encrypt, generateSecureToken, hasRole, hmacSha256, isServiceUnavailable, isWorkspaceOwnerRole, readWorkspacePosition, redactSecrets, reduceToBaseWord, sanitizeHeaders, sha256, sleep, stampJobContext, timingSafeCompare, workspacePositionOf, workspaceQueryKey, workspaceScopedName };
14552
14626
  export type { AcceptedInvitation, AcceptedSignup, AccountRemovalAudit, ActingMember, ApiKeyAccessEvent, ApiKeyClock, ApiKeyDenyReason, ApiKeyPrincipal, AuthApiKey, AuthApiKeySummary, AuthDocumentSecurityParams, AuthEmailCatalogue, AuthEmailContext, AuthEmailKind, AuthEmailMessage, AuthEmailSink, AuthErrorCode, AuthFieldError, AuthGuardFamily, AuthMembership, AuthModuleAsyncOptions, AuthPlane, AuthPlatformUser, AuthRateLimitWindow, AuthResult, AuthUser, AuthWorkspace, AuthenticatedRequest, BearerAuthResponse, BeforeRegisterResult, BeforeWorkspaceCreateResult, BootstrapInvitationRecord, BothAuthResponse, BymaxAuthModuleOptions, BymaxAuthRateLimitOptions, ChangeMembershipRoleParams, ClientIpSource, CookieAuthResponse, CountOwnedParams, CreateMembershipParams, CreateMembershipResult, CreateSessionParams, CreateUserData, CreateWithOAuthData, CreateWorkspaceResult, CreateWorkspaceWithOwnerParams, CurrentWorkspaceContext, DashboardJwtPayload, DefaultAuthEmailProviderOptions, DeliveryErrorPolicy, DeliveryErrorPolicyMap, FinalizeResult, FindUserByEmailParams, FindUserByOAuthIdParams, GuardedWriteResult, HookContext, IApiKeyRepository, IAuthHooks, IEmailProvider, IMembershipRepository, IPasswordBreachChecker, IPlatformUserRepository, IUserRepository, IWorkspaceRepository, InviteData, IssueApiKeyInput, IssuedApiKey, LastActiveWorkspaceRef, LinkOAuthParams, ListMembershipsForUserParams, ListMembershipsForWorkspaceParams, ListSessionsParams, ListSoleOwnedParams, LiveSessionParams, MemberChangeResult, MemberInvitationRecord, MembershipPage, MembershipRef, MembershipStatus, MembershipWithWorkspace, MfaChallengeResult, MfaSetupResult, MfaTempPayload, MyWorkspaces, OAuthLoginResult, OAuthMfaChallengeResult, OAuthProfile, OAuthProviderPlugin, OpenApiSecurityRequirement, PlatformAuthResult, PlatformAuthenticatedRequest, PlatformBearerAuthResponse, PlatformJwtPayload, RegistrationMode, RemoveAllMembershipsParams, RemoveAllMembershipsResult, RemoveMembershipParams, RemovedMembership, RenameWorkspaceParams, RenameWorkspaceResult, RequestEncodingPolicy, ResolvedOptions, ResolvedWorkspaceMember, RevocableTokenPayload, RevokeAllExceptCurrentParams, RevokeAllSessionsParams, RevokeSessionParams, RotateApiKeyInput, RotatedTokenResult, SafeAuthPlatformUser, SafeAuthUser, ScheduledDeletion, SessionAlertInfo, SessionInfo, SetLastActiveWorkspaceParams, SignupRequest, StoredWorkspaceInvitation, TenantResolverRequest, TenantScopedUserRef, TransferOwnershipParams, TransferOwnershipResult, UpdateEmailParams, UpdateEmailVerifiedParams, UpdateMfaData, UpdateMfaParams, UpdatePasswordParams, UpdatePlatformMfaData, UpdateStatusParams, UpdateWorkspaceStatusParams, UpdateWorkspaceStatusResult, VerifiedAccessToken, VerifiedWorkspaceAccessToken, VerifyAccessTokenOptions, WorkspaceAccess, WorkspaceAccessView, WorkspaceAction, WorkspaceActor, WorkspaceAuditEvent, WorkspaceCheck, WorkspaceInvitationPreview, WorkspaceInvitationView, WorkspaceInviteData, WorkspaceJobContext, WorkspaceOptions, WorkspacePermissionOptions, WorkspaceRef, WorkspaceRequest, WorkspaceRoleList, WorkspaceStatus, WsTicketSnapshot };