@bymax-one/nest-auth 1.5.10 → 1.5.12
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.
- package/CHANGELOG.md +138 -1
- package/README.md +204 -30
- package/dist/observability/index.cjs +166 -0
- package/dist/observability/index.d.cts +83 -0
- package/dist/observability/index.d.ts +83 -0
- package/dist/observability/index.mjs +163 -0
- package/dist/server/index.cjs +3695 -1854
- package/dist/server/index.d.cts +120 -27
- package/dist/server/index.d.ts +120 -27
- package/dist/server/index.mjs +3694 -1857
- package/package.json +33 -2
package/dist/server/index.d.cts
CHANGED
|
@@ -1189,12 +1189,12 @@ interface BymaxAuthModuleOptions {
|
|
|
1189
1189
|
/**
|
|
1190
1190
|
* `Path` attribute for the short-lived `mfa_temp_token` cookie planted
|
|
1191
1191
|
* by the OAuth callback (lib v1.0.7+) and cleared by the MFA challenge
|
|
1192
|
-
* controller. Defaults to
|
|
1193
|
-
*
|
|
1192
|
+
* controller. Defaults to `/auth/mfa`, which does not follow `routePrefix`
|
|
1193
|
+
* — correct for the default prefix with no Nest global prefix.
|
|
1194
1194
|
*
|
|
1195
|
-
* Set this explicitly when the consumer
|
|
1196
|
-
*
|
|
1197
|
-
* construction time. For example, with `setGlobalPrefix('api')` and
|
|
1195
|
+
* Set this explicitly when the consumer changes `routePrefix` or calls
|
|
1196
|
+
* `app.setGlobalPrefix(...)`: the library cannot observe the global
|
|
1197
|
+
* prefix at module construction time. For example, with `setGlobalPrefix('api')` and
|
|
1198
1198
|
* default `routePrefix: 'auth'`, the real challenge URL is
|
|
1199
1199
|
* `/api/auth/mfa/challenge` — but `Path=/auth/mfa` will NOT be sent
|
|
1200
1200
|
* by the browser (RFC 6265 prefix-match). Set this to `'/api/auth/mfa'`
|
|
@@ -5236,21 +5236,21 @@ interface IMembershipRepository {
|
|
|
5236
5236
|
declare class NoOpEmailProvider implements IEmailProvider {
|
|
5237
5237
|
private readonly logger;
|
|
5238
5238
|
/** @inheritdoc */
|
|
5239
|
-
sendPasswordResetToken(_tenantId: string,
|
|
5239
|
+
sendPasswordResetToken(_tenantId: string, _email: string, _token: string, _locale?: string): Promise<void>;
|
|
5240
5240
|
/** @inheritdoc */
|
|
5241
|
-
sendPasswordResetOtp(_tenantId: string,
|
|
5241
|
+
sendPasswordResetOtp(_tenantId: string, _email: string, _otp: string, _locale?: string): Promise<void>;
|
|
5242
5242
|
/** @inheritdoc */
|
|
5243
|
-
sendEmailVerificationOtp(_tenantId: string,
|
|
5243
|
+
sendEmailVerificationOtp(_tenantId: string, _email: string, _otp: string, _locale?: string): Promise<void>;
|
|
5244
5244
|
/** @inheritdoc */
|
|
5245
|
-
sendMfaEnabledNotification(_tenantId: string,
|
|
5245
|
+
sendMfaEnabledNotification(_tenantId: string, _email: string, _locale?: string): Promise<void>;
|
|
5246
5246
|
/** @inheritdoc */
|
|
5247
|
-
sendMfaDisabledNotification(_tenantId: string,
|
|
5247
|
+
sendMfaDisabledNotification(_tenantId: string, _email: string, _locale?: string): Promise<void>;
|
|
5248
5248
|
/** @inheritdoc */
|
|
5249
|
-
sendNewSessionAlert(_tenantId: string,
|
|
5249
|
+
sendNewSessionAlert(_tenantId: string, _email: string, _sessionInfo: SessionAlertInfo, _locale?: string): Promise<void>;
|
|
5250
5250
|
/** @inheritdoc */
|
|
5251
|
-
sendInvitation(_tenantId: string,
|
|
5251
|
+
sendInvitation(_tenantId: string, _email: string, _inviteData: InviteData, _locale?: string): Promise<void>;
|
|
5252
5252
|
/** @inheritdoc */
|
|
5253
|
-
sendWorkspaceInvitation(_tenantId: string,
|
|
5253
|
+
sendWorkspaceInvitation(_tenantId: string, _email: string, _data: WorkspaceInviteData, _locale?: string): Promise<void>;
|
|
5254
5254
|
}
|
|
5255
5255
|
|
|
5256
5256
|
/**
|
|
@@ -9013,6 +9013,55 @@ declare class VerifyOtpDto {
|
|
|
9013
9013
|
tenantId?: string;
|
|
9014
9014
|
}
|
|
9015
9015
|
|
|
9016
|
+
/**
|
|
9017
|
+
* @fileoverview The counts the auth flows keep for whoever publishes metrics, with every label set closed.
|
|
9018
|
+
*
|
|
9019
|
+
* @layer Service
|
|
9020
|
+
*/
|
|
9021
|
+
|
|
9022
|
+
/** The two planes an authentication flow runs on. */
|
|
9023
|
+
declare const AUTH_PLANES: readonly ["dashboard", "platform"];
|
|
9024
|
+
/** What a login attempt ended as. */
|
|
9025
|
+
declare const LOGIN_OUTCOMES: readonly ["success", "invalid_credentials", "locked", "mfa_required", "blocked"];
|
|
9026
|
+
/** What a refresh attempt ended as. */
|
|
9027
|
+
declare const REFRESH_OUTCOMES: readonly ["rotated", "reuse_detected", "expired", "invalid"];
|
|
9028
|
+
/** What an MFA verification ended as. */
|
|
9029
|
+
declare const MFA_OUTCOMES: readonly ["success", "invalid", "locked"];
|
|
9030
|
+
/** What a login attempt ended as, one of {@link LOGIN_OUTCOMES}. */
|
|
9031
|
+
type LoginOutcome = (typeof LOGIN_OUTCOMES)[number];
|
|
9032
|
+
/** What a refresh attempt ended as, one of {@link REFRESH_OUTCOMES}. */
|
|
9033
|
+
type RefreshOutcome = (typeof REFRESH_OUTCOMES)[number];
|
|
9034
|
+
/** What an MFA verification ended as, one of {@link MFA_OUTCOMES}. */
|
|
9035
|
+
type MfaOutcome = (typeof MFA_OUTCOMES)[number];
|
|
9036
|
+
/** A count for each outcome on each plane. */
|
|
9037
|
+
type PlaneCounts<K extends string> = Readonly<Record<AuthPlane, Readonly<Record<K, number>>>>;
|
|
9038
|
+
/**
|
|
9039
|
+
* Counts what the authentication flows do, in plain numbers.
|
|
9040
|
+
*
|
|
9041
|
+
* It exists so that the code that does the work never imports a metrics library: an application that
|
|
9042
|
+
* publishes nothing pays for a few integer increments, and the optional `observability` subpath reads
|
|
9043
|
+
* these numbers when it is scraped. Each count is keyed by a closed set, so no label can grow with the
|
|
9044
|
+
* traffic, and nothing a caller or a host supplied is ever a key.
|
|
9045
|
+
*/
|
|
9046
|
+
declare class AuthMetricsTally {
|
|
9047
|
+
#private;
|
|
9048
|
+
/** A login attempt on `plane` ended as `outcome`. */
|
|
9049
|
+
login(plane: AuthPlane, outcome: LoginOutcome): void;
|
|
9050
|
+
/** A refresh attempt on `plane` ended as `outcome`. */
|
|
9051
|
+
refresh(plane: AuthPlane, outcome: RefreshOutcome): void;
|
|
9052
|
+
/** An MFA verification on `plane` ended as `outcome`. */
|
|
9053
|
+
mfa(plane: AuthPlane, outcome: MfaOutcome): void;
|
|
9054
|
+
/** A run of failures reached the threshold and locked an identifier out. */
|
|
9055
|
+
lockout(): void;
|
|
9056
|
+
/** The counts so far, as copies. */
|
|
9057
|
+
snapshot(): {
|
|
9058
|
+
readonly logins: PlaneCounts<LoginOutcome>;
|
|
9059
|
+
readonly refreshes: PlaneCounts<RefreshOutcome>;
|
|
9060
|
+
readonly mfa: PlaneCounts<MfaOutcome>;
|
|
9061
|
+
readonly lockouts: number;
|
|
9062
|
+
};
|
|
9063
|
+
}
|
|
9064
|
+
|
|
9016
9065
|
/**
|
|
9017
9066
|
* Guards authentication endpoints against brute-force attacks by tracking
|
|
9018
9067
|
* failed attempt counts in Redis.
|
|
@@ -9037,10 +9086,11 @@ declare class VerifyOtpDto {
|
|
|
9037
9086
|
*/
|
|
9038
9087
|
declare class BruteForceService {
|
|
9039
9088
|
private readonly redis;
|
|
9089
|
+
private readonly tally?;
|
|
9040
9090
|
private readonly logger;
|
|
9041
9091
|
private readonly maxAttempts;
|
|
9042
9092
|
private readonly windowSeconds;
|
|
9043
|
-
constructor(redis: AuthRedisService, options: ResolvedOptions);
|
|
9093
|
+
constructor(redis: AuthRedisService, options: ResolvedOptions, tally?: AuthMetricsTally | undefined);
|
|
9044
9094
|
/**
|
|
9045
9095
|
* Returns `true` when the identifier has reached or exceeded the failure threshold.
|
|
9046
9096
|
*
|
|
@@ -9734,10 +9784,9 @@ declare class SessionService {
|
|
|
9734
9784
|
/**
|
|
9735
9785
|
* Resolves the maximum number of concurrent sessions allowed for a user.
|
|
9736
9786
|
*
|
|
9737
|
-
* When `options.sessions.maxSessionsResolver` is configured, it is called with
|
|
9738
|
-
*
|
|
9739
|
-
* the
|
|
9740
|
-
* with something that is not a usable limit.
|
|
9787
|
+
* When `options.sessions.maxSessionsResolver` is configured, it is called with the entity the user
|
|
9788
|
+
* repository returned. Falls back to `options.sessions.defaultMaxSessions` if the resolver is absent,
|
|
9789
|
+
* the user cannot be found, the resolver throws, or it answers with an unusable limit.
|
|
9741
9790
|
*
|
|
9742
9791
|
* That last case is the one that mattered. The resolver is the host's code and its return
|
|
9743
9792
|
* value went straight into the eviction arithmetic, where `NaN` — the result of, say,
|
|
@@ -9911,8 +9960,7 @@ declare class TokenManagerService {
|
|
|
9911
9960
|
* consumer subscribes to this hook. `userId` says whose account the family belongs to; `ip` and
|
|
9912
9961
|
* `userAgent` are the only description of the party holding the token that should not exist, so
|
|
9913
9962
|
* a report carrying the first and not the second says a compromise happened and gives nothing
|
|
9914
|
-
* to act on.
|
|
9915
|
-
* `reissueTokens` had both values in scope as its own parameters.
|
|
9963
|
+
* to act on.
|
|
9916
9964
|
*
|
|
9917
9965
|
* `sanitizedHeaders` stays empty and that is honest — the rotation path receives the address
|
|
9918
9966
|
* and the agent, never the header map, so there is nothing to sanitize. Inventing one would be
|
|
@@ -10212,6 +10260,20 @@ declare class TokenManagerService {
|
|
|
10212
10260
|
jti: string;
|
|
10213
10261
|
tenantId?: string;
|
|
10214
10262
|
}>;
|
|
10263
|
+
/**
|
|
10264
|
+
* Refuses a temp token whose tenant claim does not fit its plane.
|
|
10265
|
+
*
|
|
10266
|
+
* @param payload - The claims of a token whose signature held.
|
|
10267
|
+
* @throws {@link AuthException} with `MFA_TEMP_TOKEN_INVALID`.
|
|
10268
|
+
*/
|
|
10269
|
+
private assertMfaTempTokenBinding;
|
|
10270
|
+
/**
|
|
10271
|
+
* Refuses a temp token whose Redis entry is gone, names another account, or predates a bulk revocation.
|
|
10272
|
+
*
|
|
10273
|
+
* @param payload - The claims of a token whose signature held.
|
|
10274
|
+
* @throws {@link AuthException} with `MFA_TEMP_TOKEN_INVALID`.
|
|
10275
|
+
*/
|
|
10276
|
+
private assertMfaTempTokenLive;
|
|
10215
10277
|
/**
|
|
10216
10278
|
* Atomically consumes a previously-verified MFA temp token.
|
|
10217
10279
|
*
|
|
@@ -10707,6 +10769,8 @@ declare class AuthService {
|
|
|
10707
10769
|
* refused login into a different refusal, nor a successful one into a failure.
|
|
10708
10770
|
*/
|
|
10709
10771
|
private fireAndForget;
|
|
10772
|
+
/** Writes the event of a password login that reached its end: tokens issued, or an MFA challenge. */
|
|
10773
|
+
private logLogin;
|
|
10710
10774
|
private assertUserNotBlocked;
|
|
10711
10775
|
private sendVerificationOtp;
|
|
10712
10776
|
}
|
|
@@ -11407,8 +11471,7 @@ declare class MfaManagementService {
|
|
|
11407
11471
|
/**
|
|
11408
11472
|
* Tells the account holder their second factor was turned off.
|
|
11409
11473
|
*
|
|
11410
|
-
* @param
|
|
11411
|
-
* @param scope - The plane, account and tenant that changed.
|
|
11474
|
+
* @param kind - The flow that turned the factor off, for the event.
|
|
11412
11475
|
* @param user - The account, read for its address.
|
|
11413
11476
|
*/
|
|
11414
11477
|
private notifyDisabled;
|
|
@@ -11675,6 +11738,39 @@ declare class MfaService {
|
|
|
11675
11738
|
}>;
|
|
11676
11739
|
}
|
|
11677
11740
|
|
|
11741
|
+
/**
|
|
11742
|
+
* Asks the Redis client the module was given whether it answers.
|
|
11743
|
+
*
|
|
11744
|
+
* A `PING` writes nothing and reads nothing a caller owns, so a readiness probe costs the store one round
|
|
11745
|
+
* trip and no data. It lives in the main entry because the client is private to the module; the optional
|
|
11746
|
+
* `observability` subpath wraps it as a health indicator.
|
|
11747
|
+
*
|
|
11748
|
+
* Each probe is bounded: it gives up after {@link PING_TIMEOUT_MS} or when the caller's signal aborts,
|
|
11749
|
+
* whichever is first, so a stalled socket cannot hold a readiness check open. Probes that arrive while a
|
|
11750
|
+
* `PING` is still pending share it, so a store that never answers is asked once, not once per probe. A
|
|
11751
|
+
* `PING` that has outlived the timeout is not shared any longer: the next probe sends a fresh one, so a
|
|
11752
|
+
* command the client never settles cannot keep the readiness check down after the store has recovered, and
|
|
11753
|
+
* at most one `PING` is sent per timeout window.
|
|
11754
|
+
*/
|
|
11755
|
+
declare class AuthHealthProbe {
|
|
11756
|
+
#private;
|
|
11757
|
+
private readonly redis;
|
|
11758
|
+
constructor(redis: {
|
|
11759
|
+
ping(): Promise<string>;
|
|
11760
|
+
});
|
|
11761
|
+
/**
|
|
11762
|
+
* Whether the store answers a `PING` in time.
|
|
11763
|
+
*
|
|
11764
|
+
* @param signal - Aborted when the caller stops waiting; the probe then rejects without waiting longer.
|
|
11765
|
+
* @returns `true` when it answers `PONG`, `false` for any other answer.
|
|
11766
|
+
* @throws When the store cannot be reached, does not answer in time, or the signal aborts; the health
|
|
11767
|
+
* aggregator turns the rejection into a `down` entry.
|
|
11768
|
+
*/
|
|
11769
|
+
ping(signal?: AbortSignal): Promise<boolean>;
|
|
11770
|
+
/** `answer`, or a rejection as soon as `signal` aborts. */
|
|
11771
|
+
private within;
|
|
11772
|
+
}
|
|
11773
|
+
|
|
11678
11774
|
/**
|
|
11679
11775
|
* Manages tenant invitation flows — creating and accepting invitations.
|
|
11680
11776
|
*
|
|
@@ -13101,8 +13197,6 @@ declare class OAuthService {
|
|
|
13101
13197
|
* Issues the MFA temp token for an account that has a second factor.
|
|
13102
13198
|
*
|
|
13103
13199
|
* @param authUser - The account the flow resolved to.
|
|
13104
|
-
* @param provider - The provider name, for the log line.
|
|
13105
|
-
* @param hookResult - The hook's decision, whose action goes in the log line.
|
|
13106
13200
|
* @returns The challenge the controller plants in a cookie or surfaces in the body.
|
|
13107
13201
|
*/
|
|
13108
13202
|
private issueMfaChallenge;
|
|
@@ -13136,7 +13230,6 @@ declare class OAuthService {
|
|
|
13136
13230
|
/**
|
|
13137
13231
|
* Reads and deletes the state record of a flow, in one step so it can be used once.
|
|
13138
13232
|
*
|
|
13139
|
-
* @param provider - The provider named by the callback path, for the log lines.
|
|
13140
13233
|
* @param state - The `state` query value.
|
|
13141
13234
|
* @returns The stored record.
|
|
13142
13235
|
* @throws `AuthException(OAUTH_FAILED)` for a state that is missing, unparseable or malformed.
|
|
@@ -14622,5 +14715,5 @@ declare class WorkspaceInvitationService {
|
|
|
14622
14715
|
private activeWorkspace;
|
|
14623
14716
|
}
|
|
14624
14717
|
|
|
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 };
|
|
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 };
|
|
14718
|
+
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_PLANES, AUTH_SECRET_MIN_LENGTH, AUTH_SECURITY_SCHEMES, AUTH_THROTTLE_CONFIGS, AcceptInvitationDto, AccountStatusService, AllowAllBreachChecker, AllowPendingWorkspace, ApiKeyGuard, ApiKeyScopes, ApiKeyService, AuthException, AuthExceptionFilter, AuthHealthProbe, AuthMetricsTally, 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, LOGIN_OUTCOMES, LoginDto, MFA_OUTCOMES, MembershipBumpFailedError, MembershipService, MfaChallengeDto, MfaDisableDto, MfaRegenerateRecoveryCodesDto, MfaRequiredGuard, MfaService, MfaVerifyDto, NoOpAuthHooks, NoOpEmailProvider, OAuthService, OptionalAuthGuard, OtpService, PLATFORM_ROLES_KEY, PasswordResetService, PlatformAuthService, PlatformLoginDto, PlatformRoles, PlatformRolesGuard, Public, REFRESH_OUTCOMES, 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 };
|
|
14719
|
+
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, LoginOutcome, MemberChangeResult, MemberInvitationRecord, MembershipPage, MembershipRef, MembershipStatus, MembershipWithWorkspace, MfaChallengeResult, MfaOutcome, MfaSetupResult, MfaTempPayload, MyWorkspaces, OAuthLoginResult, OAuthMfaChallengeResult, OAuthProfile, OAuthProviderPlugin, OpenApiSecurityRequirement, PlatformAuthResult, PlatformAuthenticatedRequest, PlatformBearerAuthResponse, PlatformJwtPayload, RefreshOutcome, 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 };
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1189,12 +1189,12 @@ interface BymaxAuthModuleOptions {
|
|
|
1189
1189
|
/**
|
|
1190
1190
|
* `Path` attribute for the short-lived `mfa_temp_token` cookie planted
|
|
1191
1191
|
* by the OAuth callback (lib v1.0.7+) and cleared by the MFA challenge
|
|
1192
|
-
* controller. Defaults to
|
|
1193
|
-
*
|
|
1192
|
+
* controller. Defaults to `/auth/mfa`, which does not follow `routePrefix`
|
|
1193
|
+
* — correct for the default prefix with no Nest global prefix.
|
|
1194
1194
|
*
|
|
1195
|
-
* Set this explicitly when the consumer
|
|
1196
|
-
*
|
|
1197
|
-
* construction time. For example, with `setGlobalPrefix('api')` and
|
|
1195
|
+
* Set this explicitly when the consumer changes `routePrefix` or calls
|
|
1196
|
+
* `app.setGlobalPrefix(...)`: the library cannot observe the global
|
|
1197
|
+
* prefix at module construction time. For example, with `setGlobalPrefix('api')` and
|
|
1198
1198
|
* default `routePrefix: 'auth'`, the real challenge URL is
|
|
1199
1199
|
* `/api/auth/mfa/challenge` — but `Path=/auth/mfa` will NOT be sent
|
|
1200
1200
|
* by the browser (RFC 6265 prefix-match). Set this to `'/api/auth/mfa'`
|
|
@@ -5236,21 +5236,21 @@ interface IMembershipRepository {
|
|
|
5236
5236
|
declare class NoOpEmailProvider implements IEmailProvider {
|
|
5237
5237
|
private readonly logger;
|
|
5238
5238
|
/** @inheritdoc */
|
|
5239
|
-
sendPasswordResetToken(_tenantId: string,
|
|
5239
|
+
sendPasswordResetToken(_tenantId: string, _email: string, _token: string, _locale?: string): Promise<void>;
|
|
5240
5240
|
/** @inheritdoc */
|
|
5241
|
-
sendPasswordResetOtp(_tenantId: string,
|
|
5241
|
+
sendPasswordResetOtp(_tenantId: string, _email: string, _otp: string, _locale?: string): Promise<void>;
|
|
5242
5242
|
/** @inheritdoc */
|
|
5243
|
-
sendEmailVerificationOtp(_tenantId: string,
|
|
5243
|
+
sendEmailVerificationOtp(_tenantId: string, _email: string, _otp: string, _locale?: string): Promise<void>;
|
|
5244
5244
|
/** @inheritdoc */
|
|
5245
|
-
sendMfaEnabledNotification(_tenantId: string,
|
|
5245
|
+
sendMfaEnabledNotification(_tenantId: string, _email: string, _locale?: string): Promise<void>;
|
|
5246
5246
|
/** @inheritdoc */
|
|
5247
|
-
sendMfaDisabledNotification(_tenantId: string,
|
|
5247
|
+
sendMfaDisabledNotification(_tenantId: string, _email: string, _locale?: string): Promise<void>;
|
|
5248
5248
|
/** @inheritdoc */
|
|
5249
|
-
sendNewSessionAlert(_tenantId: string,
|
|
5249
|
+
sendNewSessionAlert(_tenantId: string, _email: string, _sessionInfo: SessionAlertInfo, _locale?: string): Promise<void>;
|
|
5250
5250
|
/** @inheritdoc */
|
|
5251
|
-
sendInvitation(_tenantId: string,
|
|
5251
|
+
sendInvitation(_tenantId: string, _email: string, _inviteData: InviteData, _locale?: string): Promise<void>;
|
|
5252
5252
|
/** @inheritdoc */
|
|
5253
|
-
sendWorkspaceInvitation(_tenantId: string,
|
|
5253
|
+
sendWorkspaceInvitation(_tenantId: string, _email: string, _data: WorkspaceInviteData, _locale?: string): Promise<void>;
|
|
5254
5254
|
}
|
|
5255
5255
|
|
|
5256
5256
|
/**
|
|
@@ -9013,6 +9013,55 @@ declare class VerifyOtpDto {
|
|
|
9013
9013
|
tenantId?: string;
|
|
9014
9014
|
}
|
|
9015
9015
|
|
|
9016
|
+
/**
|
|
9017
|
+
* @fileoverview The counts the auth flows keep for whoever publishes metrics, with every label set closed.
|
|
9018
|
+
*
|
|
9019
|
+
* @layer Service
|
|
9020
|
+
*/
|
|
9021
|
+
|
|
9022
|
+
/** The two planes an authentication flow runs on. */
|
|
9023
|
+
declare const AUTH_PLANES: readonly ["dashboard", "platform"];
|
|
9024
|
+
/** What a login attempt ended as. */
|
|
9025
|
+
declare const LOGIN_OUTCOMES: readonly ["success", "invalid_credentials", "locked", "mfa_required", "blocked"];
|
|
9026
|
+
/** What a refresh attempt ended as. */
|
|
9027
|
+
declare const REFRESH_OUTCOMES: readonly ["rotated", "reuse_detected", "expired", "invalid"];
|
|
9028
|
+
/** What an MFA verification ended as. */
|
|
9029
|
+
declare const MFA_OUTCOMES: readonly ["success", "invalid", "locked"];
|
|
9030
|
+
/** What a login attempt ended as, one of {@link LOGIN_OUTCOMES}. */
|
|
9031
|
+
type LoginOutcome = (typeof LOGIN_OUTCOMES)[number];
|
|
9032
|
+
/** What a refresh attempt ended as, one of {@link REFRESH_OUTCOMES}. */
|
|
9033
|
+
type RefreshOutcome = (typeof REFRESH_OUTCOMES)[number];
|
|
9034
|
+
/** What an MFA verification ended as, one of {@link MFA_OUTCOMES}. */
|
|
9035
|
+
type MfaOutcome = (typeof MFA_OUTCOMES)[number];
|
|
9036
|
+
/** A count for each outcome on each plane. */
|
|
9037
|
+
type PlaneCounts<K extends string> = Readonly<Record<AuthPlane, Readonly<Record<K, number>>>>;
|
|
9038
|
+
/**
|
|
9039
|
+
* Counts what the authentication flows do, in plain numbers.
|
|
9040
|
+
*
|
|
9041
|
+
* It exists so that the code that does the work never imports a metrics library: an application that
|
|
9042
|
+
* publishes nothing pays for a few integer increments, and the optional `observability` subpath reads
|
|
9043
|
+
* these numbers when it is scraped. Each count is keyed by a closed set, so no label can grow with the
|
|
9044
|
+
* traffic, and nothing a caller or a host supplied is ever a key.
|
|
9045
|
+
*/
|
|
9046
|
+
declare class AuthMetricsTally {
|
|
9047
|
+
#private;
|
|
9048
|
+
/** A login attempt on `plane` ended as `outcome`. */
|
|
9049
|
+
login(plane: AuthPlane, outcome: LoginOutcome): void;
|
|
9050
|
+
/** A refresh attempt on `plane` ended as `outcome`. */
|
|
9051
|
+
refresh(plane: AuthPlane, outcome: RefreshOutcome): void;
|
|
9052
|
+
/** An MFA verification on `plane` ended as `outcome`. */
|
|
9053
|
+
mfa(plane: AuthPlane, outcome: MfaOutcome): void;
|
|
9054
|
+
/** A run of failures reached the threshold and locked an identifier out. */
|
|
9055
|
+
lockout(): void;
|
|
9056
|
+
/** The counts so far, as copies. */
|
|
9057
|
+
snapshot(): {
|
|
9058
|
+
readonly logins: PlaneCounts<LoginOutcome>;
|
|
9059
|
+
readonly refreshes: PlaneCounts<RefreshOutcome>;
|
|
9060
|
+
readonly mfa: PlaneCounts<MfaOutcome>;
|
|
9061
|
+
readonly lockouts: number;
|
|
9062
|
+
};
|
|
9063
|
+
}
|
|
9064
|
+
|
|
9016
9065
|
/**
|
|
9017
9066
|
* Guards authentication endpoints against brute-force attacks by tracking
|
|
9018
9067
|
* failed attempt counts in Redis.
|
|
@@ -9037,10 +9086,11 @@ declare class VerifyOtpDto {
|
|
|
9037
9086
|
*/
|
|
9038
9087
|
declare class BruteForceService {
|
|
9039
9088
|
private readonly redis;
|
|
9089
|
+
private readonly tally?;
|
|
9040
9090
|
private readonly logger;
|
|
9041
9091
|
private readonly maxAttempts;
|
|
9042
9092
|
private readonly windowSeconds;
|
|
9043
|
-
constructor(redis: AuthRedisService, options: ResolvedOptions);
|
|
9093
|
+
constructor(redis: AuthRedisService, options: ResolvedOptions, tally?: AuthMetricsTally | undefined);
|
|
9044
9094
|
/**
|
|
9045
9095
|
* Returns `true` when the identifier has reached or exceeded the failure threshold.
|
|
9046
9096
|
*
|
|
@@ -9734,10 +9784,9 @@ declare class SessionService {
|
|
|
9734
9784
|
/**
|
|
9735
9785
|
* Resolves the maximum number of concurrent sessions allowed for a user.
|
|
9736
9786
|
*
|
|
9737
|
-
* When `options.sessions.maxSessionsResolver` is configured, it is called with
|
|
9738
|
-
*
|
|
9739
|
-
* the
|
|
9740
|
-
* with something that is not a usable limit.
|
|
9787
|
+
* When `options.sessions.maxSessionsResolver` is configured, it is called with the entity the user
|
|
9788
|
+
* repository returned. Falls back to `options.sessions.defaultMaxSessions` if the resolver is absent,
|
|
9789
|
+
* the user cannot be found, the resolver throws, or it answers with an unusable limit.
|
|
9741
9790
|
*
|
|
9742
9791
|
* That last case is the one that mattered. The resolver is the host's code and its return
|
|
9743
9792
|
* value went straight into the eviction arithmetic, where `NaN` — the result of, say,
|
|
@@ -9911,8 +9960,7 @@ declare class TokenManagerService {
|
|
|
9911
9960
|
* consumer subscribes to this hook. `userId` says whose account the family belongs to; `ip` and
|
|
9912
9961
|
* `userAgent` are the only description of the party holding the token that should not exist, so
|
|
9913
9962
|
* a report carrying the first and not the second says a compromise happened and gives nothing
|
|
9914
|
-
* to act on.
|
|
9915
|
-
* `reissueTokens` had both values in scope as its own parameters.
|
|
9963
|
+
* to act on.
|
|
9916
9964
|
*
|
|
9917
9965
|
* `sanitizedHeaders` stays empty and that is honest — the rotation path receives the address
|
|
9918
9966
|
* and the agent, never the header map, so there is nothing to sanitize. Inventing one would be
|
|
@@ -10212,6 +10260,20 @@ declare class TokenManagerService {
|
|
|
10212
10260
|
jti: string;
|
|
10213
10261
|
tenantId?: string;
|
|
10214
10262
|
}>;
|
|
10263
|
+
/**
|
|
10264
|
+
* Refuses a temp token whose tenant claim does not fit its plane.
|
|
10265
|
+
*
|
|
10266
|
+
* @param payload - The claims of a token whose signature held.
|
|
10267
|
+
* @throws {@link AuthException} with `MFA_TEMP_TOKEN_INVALID`.
|
|
10268
|
+
*/
|
|
10269
|
+
private assertMfaTempTokenBinding;
|
|
10270
|
+
/**
|
|
10271
|
+
* Refuses a temp token whose Redis entry is gone, names another account, or predates a bulk revocation.
|
|
10272
|
+
*
|
|
10273
|
+
* @param payload - The claims of a token whose signature held.
|
|
10274
|
+
* @throws {@link AuthException} with `MFA_TEMP_TOKEN_INVALID`.
|
|
10275
|
+
*/
|
|
10276
|
+
private assertMfaTempTokenLive;
|
|
10215
10277
|
/**
|
|
10216
10278
|
* Atomically consumes a previously-verified MFA temp token.
|
|
10217
10279
|
*
|
|
@@ -10707,6 +10769,8 @@ declare class AuthService {
|
|
|
10707
10769
|
* refused login into a different refusal, nor a successful one into a failure.
|
|
10708
10770
|
*/
|
|
10709
10771
|
private fireAndForget;
|
|
10772
|
+
/** Writes the event of a password login that reached its end: tokens issued, or an MFA challenge. */
|
|
10773
|
+
private logLogin;
|
|
10710
10774
|
private assertUserNotBlocked;
|
|
10711
10775
|
private sendVerificationOtp;
|
|
10712
10776
|
}
|
|
@@ -11407,8 +11471,7 @@ declare class MfaManagementService {
|
|
|
11407
11471
|
/**
|
|
11408
11472
|
* Tells the account holder their second factor was turned off.
|
|
11409
11473
|
*
|
|
11410
|
-
* @param
|
|
11411
|
-
* @param scope - The plane, account and tenant that changed.
|
|
11474
|
+
* @param kind - The flow that turned the factor off, for the event.
|
|
11412
11475
|
* @param user - The account, read for its address.
|
|
11413
11476
|
*/
|
|
11414
11477
|
private notifyDisabled;
|
|
@@ -11675,6 +11738,39 @@ declare class MfaService {
|
|
|
11675
11738
|
}>;
|
|
11676
11739
|
}
|
|
11677
11740
|
|
|
11741
|
+
/**
|
|
11742
|
+
* Asks the Redis client the module was given whether it answers.
|
|
11743
|
+
*
|
|
11744
|
+
* A `PING` writes nothing and reads nothing a caller owns, so a readiness probe costs the store one round
|
|
11745
|
+
* trip and no data. It lives in the main entry because the client is private to the module; the optional
|
|
11746
|
+
* `observability` subpath wraps it as a health indicator.
|
|
11747
|
+
*
|
|
11748
|
+
* Each probe is bounded: it gives up after {@link PING_TIMEOUT_MS} or when the caller's signal aborts,
|
|
11749
|
+
* whichever is first, so a stalled socket cannot hold a readiness check open. Probes that arrive while a
|
|
11750
|
+
* `PING` is still pending share it, so a store that never answers is asked once, not once per probe. A
|
|
11751
|
+
* `PING` that has outlived the timeout is not shared any longer: the next probe sends a fresh one, so a
|
|
11752
|
+
* command the client never settles cannot keep the readiness check down after the store has recovered, and
|
|
11753
|
+
* at most one `PING` is sent per timeout window.
|
|
11754
|
+
*/
|
|
11755
|
+
declare class AuthHealthProbe {
|
|
11756
|
+
#private;
|
|
11757
|
+
private readonly redis;
|
|
11758
|
+
constructor(redis: {
|
|
11759
|
+
ping(): Promise<string>;
|
|
11760
|
+
});
|
|
11761
|
+
/**
|
|
11762
|
+
* Whether the store answers a `PING` in time.
|
|
11763
|
+
*
|
|
11764
|
+
* @param signal - Aborted when the caller stops waiting; the probe then rejects without waiting longer.
|
|
11765
|
+
* @returns `true` when it answers `PONG`, `false` for any other answer.
|
|
11766
|
+
* @throws When the store cannot be reached, does not answer in time, or the signal aborts; the health
|
|
11767
|
+
* aggregator turns the rejection into a `down` entry.
|
|
11768
|
+
*/
|
|
11769
|
+
ping(signal?: AbortSignal): Promise<boolean>;
|
|
11770
|
+
/** `answer`, or a rejection as soon as `signal` aborts. */
|
|
11771
|
+
private within;
|
|
11772
|
+
}
|
|
11773
|
+
|
|
11678
11774
|
/**
|
|
11679
11775
|
* Manages tenant invitation flows — creating and accepting invitations.
|
|
11680
11776
|
*
|
|
@@ -13101,8 +13197,6 @@ declare class OAuthService {
|
|
|
13101
13197
|
* Issues the MFA temp token for an account that has a second factor.
|
|
13102
13198
|
*
|
|
13103
13199
|
* @param authUser - The account the flow resolved to.
|
|
13104
|
-
* @param provider - The provider name, for the log line.
|
|
13105
|
-
* @param hookResult - The hook's decision, whose action goes in the log line.
|
|
13106
13200
|
* @returns The challenge the controller plants in a cookie or surfaces in the body.
|
|
13107
13201
|
*/
|
|
13108
13202
|
private issueMfaChallenge;
|
|
@@ -13136,7 +13230,6 @@ declare class OAuthService {
|
|
|
13136
13230
|
/**
|
|
13137
13231
|
* Reads and deletes the state record of a flow, in one step so it can be used once.
|
|
13138
13232
|
*
|
|
13139
|
-
* @param provider - The provider named by the callback path, for the log lines.
|
|
13140
13233
|
* @param state - The `state` query value.
|
|
13141
13234
|
* @returns The stored record.
|
|
13142
13235
|
* @throws `AuthException(OAUTH_FAILED)` for a state that is missing, unparseable or malformed.
|
|
@@ -14622,5 +14715,5 @@ declare class WorkspaceInvitationService {
|
|
|
14622
14715
|
private activeWorkspace;
|
|
14623
14716
|
}
|
|
14624
14717
|
|
|
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 };
|
|
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 };
|
|
14718
|
+
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_PLANES, AUTH_SECRET_MIN_LENGTH, AUTH_SECURITY_SCHEMES, AUTH_THROTTLE_CONFIGS, AcceptInvitationDto, AccountStatusService, AllowAllBreachChecker, AllowPendingWorkspace, ApiKeyGuard, ApiKeyScopes, ApiKeyService, AuthException, AuthExceptionFilter, AuthHealthProbe, AuthMetricsTally, 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, LOGIN_OUTCOMES, LoginDto, MFA_OUTCOMES, MembershipBumpFailedError, MembershipService, MfaChallengeDto, MfaDisableDto, MfaRegenerateRecoveryCodesDto, MfaRequiredGuard, MfaService, MfaVerifyDto, NoOpAuthHooks, NoOpEmailProvider, OAuthService, OptionalAuthGuard, OtpService, PLATFORM_ROLES_KEY, PasswordResetService, PlatformAuthService, PlatformLoginDto, PlatformRoles, PlatformRolesGuard, Public, REFRESH_OUTCOMES, 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 };
|
|
14719
|
+
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, LoginOutcome, MemberChangeResult, MemberInvitationRecord, MembershipPage, MembershipRef, MembershipStatus, MembershipWithWorkspace, MfaChallengeResult, MfaOutcome, MfaSetupResult, MfaTempPayload, MyWorkspaces, OAuthLoginResult, OAuthMfaChallengeResult, OAuthProfile, OAuthProviderPlugin, OpenApiSecurityRequirement, PlatformAuthResult, PlatformAuthenticatedRequest, PlatformBearerAuthResponse, PlatformJwtPayload, RefreshOutcome, 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 };
|