@bymax-one/nest-auth 1.5.15 → 1.5.16
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 +37 -1
- package/README.md +14 -0
- package/dist/client/index.cjs +3 -5
- package/dist/client/index.mjs +3 -5
- package/dist/nextjs/index.cjs +5 -1
- package/dist/nextjs/index.mjs +5 -1
- package/dist/server/index.cjs +5362 -4193
- package/dist/server/index.d.cts +58 -25
- package/dist/server/index.d.ts +58 -25
- package/dist/server/index.mjs +5338 -4174
- package/package.json +3 -3
package/dist/server/index.d.cts
CHANGED
|
@@ -7398,11 +7398,13 @@ declare class WorkspaceAccessService {
|
|
|
7398
7398
|
/**
|
|
7399
7399
|
* Reads the workspace and the membership together, whatever the first one says.
|
|
7400
7400
|
*
|
|
7401
|
-
* A missing workspace, an inactive one and a non-member then cost the same repository
|
|
7402
|
-
*
|
|
7403
|
-
*
|
|
7401
|
+
* A missing workspace, an inactive one and a non-member then cost the same repository reads, and
|
|
7402
|
+
* a repository that finds nothing is copied for the same work per field as one that finds a row.
|
|
7403
|
+
* That is the same work, not the same time: how long a host's database takes for each row is
|
|
7404
|
+
* outside this library. The pending-deletion answer for an owner is decided from these same two rows.
|
|
7404
7405
|
*/
|
|
7405
7406
|
private readRepositories;
|
|
7407
|
+
private accessFrom;
|
|
7406
7408
|
}
|
|
7407
7409
|
|
|
7408
7410
|
/**
|
|
@@ -9696,6 +9698,11 @@ declare class SessionService {
|
|
|
9696
9698
|
* caller told only that "a hash" was malformed cannot act on it.
|
|
9697
9699
|
*/
|
|
9698
9700
|
rotateSession(oldHash: string, newHash: string, ip: string, userAgent: string): Promise<void>;
|
|
9701
|
+
/**
|
|
9702
|
+
* Reads the creation time of the session being rotated, so that its age is stable across token
|
|
9703
|
+
* rotations; the current time when its detail is missing or unparseable.
|
|
9704
|
+
*/
|
|
9705
|
+
private readRotatedCreatedAt;
|
|
9699
9706
|
/**
|
|
9700
9707
|
* Asserts that a session hash string is a valid 64-character lowercase hex string.
|
|
9701
9708
|
*
|
|
@@ -9736,6 +9743,10 @@ declare class SessionService {
|
|
|
9736
9743
|
* rotation script writes it.
|
|
9737
9744
|
*/
|
|
9738
9745
|
private graceSuccessor;
|
|
9746
|
+
/** Drops the grace pointers that have expired from the index, without making the listing wait for it. */
|
|
9747
|
+
private pruneGracePointers;
|
|
9748
|
+
/** Drops the members of the index that name nothing, without making the listing wait for it. */
|
|
9749
|
+
private pruneDeadPointers;
|
|
9739
9750
|
/**
|
|
9740
9751
|
* The Redis key of this user's session index.
|
|
9741
9752
|
*
|
|
@@ -9801,6 +9812,8 @@ declare class SessionService {
|
|
|
9801
9812
|
* @returns Maximum allowed concurrent sessions for the given user.
|
|
9802
9813
|
*/
|
|
9803
9814
|
private resolveSessionLimit;
|
|
9815
|
+
/** Reads the creation time of every member together; a failed read throws, after the reads before it settled. */
|
|
9816
|
+
private readAges;
|
|
9804
9817
|
}
|
|
9805
9818
|
|
|
9806
9819
|
/**
|
|
@@ -10415,6 +10428,8 @@ declare class AuthService {
|
|
|
10415
10428
|
password: string;
|
|
10416
10429
|
tenantId?: string;
|
|
10417
10430
|
}, req: Request): Promise<AuthResult | MfaChallengeResult>;
|
|
10431
|
+
/** Issues the tokens of a signed-in user and, when sessions are enabled, records the session that holds them. */
|
|
10432
|
+
private openSession;
|
|
10418
10433
|
/**
|
|
10419
10434
|
* Logs out a dashboard user by revoking the access token and deleting the refresh session.
|
|
10420
10435
|
*
|
|
@@ -10760,6 +10775,10 @@ declare class AuthService {
|
|
|
10760
10775
|
* refused login into a different refusal, nor a successful one into a failure.
|
|
10761
10776
|
*/
|
|
10762
10777
|
private fireAndForget;
|
|
10778
|
+
/** Records the time of a login without making the login wait for it; a failure is logged, never raised. */
|
|
10779
|
+
private touchLastLogin;
|
|
10780
|
+
/** Moves the detail of a session to its rotated token without making the refresh wait for it. */
|
|
10781
|
+
private rotateSessionDetail;
|
|
10763
10782
|
/** Writes the event of a password login that reached its end: tokens issued, or an MFA challenge. */
|
|
10764
10783
|
private logLogin;
|
|
10765
10784
|
private assertUserNotBlocked;
|
|
@@ -11074,6 +11093,15 @@ declare class MfaRecordService {
|
|
|
11074
11093
|
* @throws {@link AuthException} `MFA_STATE_CONFLICT` when another transition holds the lock.
|
|
11075
11094
|
*/
|
|
11076
11095
|
transition(context: 'dashboard' | 'platform', userId: string, tenantId: string | undefined, mutate: (current: AuthUser | AuthPlatformUser) => MfaRecordUpdate | null): Promise<boolean>;
|
|
11096
|
+
/**
|
|
11097
|
+
* Writes an update inside the lock, to the repository of the plane the account belongs to.
|
|
11098
|
+
*
|
|
11099
|
+
* @param context - Which identity plane the account belongs to.
|
|
11100
|
+
* @param userId - The account being written.
|
|
11101
|
+
* @param tenantId - The account's tenant, required on the dashboard plane.
|
|
11102
|
+
* @param update - What `mutate` asked to be stored.
|
|
11103
|
+
*/
|
|
11104
|
+
private persist;
|
|
11077
11105
|
/**
|
|
11078
11106
|
* Releases the transition lock this call took, whatever the store answers.
|
|
11079
11107
|
*
|
|
@@ -11200,6 +11228,13 @@ declare class MfaChallengeService {
|
|
|
11200
11228
|
* @throws `MFA_INVALID_CODE` if the submitted code is incorrect.
|
|
11201
11229
|
*/
|
|
11202
11230
|
challenge(mfaTempToken: string, code: string, ip: string, userAgent: string, mfa: MfaConfig): Promise<AuthResult | PlatformAuthResult>;
|
|
11231
|
+
/** The checks and the session of one challenge, run on the plane the temp token names. */
|
|
11232
|
+
private admitChallenge;
|
|
11233
|
+
/**
|
|
11234
|
+
* Consumes the temp token, and the consume must WIN: two concurrent submissions both see the marker, and on the recovery-code
|
|
11235
|
+
* path one code and one token would mint two sessions. The loser is reported as an invalid temp token.
|
|
11236
|
+
*/
|
|
11237
|
+
private consumeOrRefuse;
|
|
11203
11238
|
/**
|
|
11204
11239
|
* Refuses a challenge for an account at its failure ceiling.
|
|
11205
11240
|
*
|
|
@@ -11557,21 +11592,6 @@ interface MfaSetupResult {
|
|
|
11557
11592
|
/** Plain-text recovery codes. Display once and never persist in this form. */
|
|
11558
11593
|
recoveryCodes: string[];
|
|
11559
11594
|
}
|
|
11560
|
-
/**
|
|
11561
|
-
* Manages TOTP-based multi-factor authentication lifecycle.
|
|
11562
|
-
*
|
|
11563
|
-
* Handles the complete MFA flow for both dashboard users and platform admins:
|
|
11564
|
-
* - **Setup**: generate TOTP secret + recovery codes, store temporarily in Redis
|
|
11565
|
-
* - **Verify & Enable**: confirm first TOTP code, persist encrypted secret to DB
|
|
11566
|
-
* - **Challenge**: exchange a valid MFA temp token + code for full access tokens
|
|
11567
|
-
* - **Disable**: require a current TOTP code to disable MFA
|
|
11568
|
-
*
|
|
11569
|
-
* @remarks
|
|
11570
|
-
* This service is only registered when `options.mfa` is configured in
|
|
11571
|
-
* `BymaxAuthModule.registerAsync()`. All crypto operations use `node:crypto` only.
|
|
11572
|
-
*
|
|
11573
|
-
* @layer Service
|
|
11574
|
-
*/
|
|
11575
11595
|
declare class MfaService {
|
|
11576
11596
|
private readonly options;
|
|
11577
11597
|
private readonly userRepo;
|
|
@@ -11596,6 +11616,8 @@ declare class MfaService {
|
|
|
11596
11616
|
* here eliminates repetitive `!` assertions throughout the class.
|
|
11597
11617
|
*/
|
|
11598
11618
|
private get mfaOptions();
|
|
11619
|
+
/** The setup a first request stored, read back for the account's address. */
|
|
11620
|
+
private storedSetup;
|
|
11599
11621
|
/**
|
|
11600
11622
|
* Initiates the MFA setup flow for a dashboard user or platform administrator.
|
|
11601
11623
|
*
|
|
@@ -12204,6 +12226,10 @@ declare class PasswordResetService {
|
|
|
12204
12226
|
* the configured breach checker.
|
|
12205
12227
|
*/
|
|
12206
12228
|
changePassword(userId: string, tenantId: string, dto: ChangePasswordDto, currentRefreshToken?: string): Promise<void>;
|
|
12229
|
+
/**
|
|
12230
|
+
* Counts a failed proof of the current password and refuses a locked account, a wrong password included.
|
|
12231
|
+
*/
|
|
12232
|
+
private assertCurrentPassword;
|
|
12207
12233
|
/**
|
|
12208
12234
|
* The hash of the live session a presented refresh token stands for, or `undefined` when the
|
|
12209
12235
|
* request carried none. Refuses a token that names no live session of the account; a token that
|
|
@@ -12263,6 +12289,8 @@ declare class PasswordResetService {
|
|
|
12263
12289
|
* Errors are caught and logged — they must not propagate to `initiateReset`.
|
|
12264
12290
|
*/
|
|
12265
12291
|
private sendToken;
|
|
12292
|
+
/** Deletes the token of a reset whose delivery failed, so nothing keeps a working reset nobody was sent. */
|
|
12293
|
+
private dropUnsentToken;
|
|
12266
12294
|
/**
|
|
12267
12295
|
* Generates and stores a password-reset OTP, then sends it to the user's email.
|
|
12268
12296
|
* Errors are caught and logged — they must not propagate to `initiateReset`.
|
|
@@ -12338,6 +12366,8 @@ declare class PlatformAuthService {
|
|
|
12338
12366
|
* account status is configured as blocked.
|
|
12339
12367
|
*/
|
|
12340
12368
|
login(dto: PlatformLoginDto, ip: string, userAgent: string): Promise<PlatformAuthResult | MfaChallengeResult>;
|
|
12369
|
+
/** Records the time of a login without making the login wait for it; a failure is logged, never raised. */
|
|
12370
|
+
private touchLastLogin;
|
|
12341
12371
|
/**
|
|
12342
12372
|
* Logs out a platform administrator by revoking the access token JTI and
|
|
12343
12373
|
* deleting the associated platform refresh session from Redis.
|
|
@@ -13204,6 +13234,8 @@ declare class OAuthService {
|
|
|
13204
13234
|
* @returns The auth result.
|
|
13205
13235
|
*/
|
|
13206
13236
|
private openSession;
|
|
13237
|
+
/** Starts the non-blocking side effects of a login; nothing waits for them. */
|
|
13238
|
+
private runLoginSideEffects;
|
|
13207
13239
|
/**
|
|
13208
13240
|
* Validates and spends the `state` of a callback.
|
|
13209
13241
|
*
|
|
@@ -13464,7 +13496,12 @@ declare function sanitizeHeaders(headers: Record<string, string | string[] | und
|
|
|
13464
13496
|
* ```typescript
|
|
13465
13497
|
* const MIN_RESPONSE_MS = 300
|
|
13466
13498
|
* const start = Date.now()
|
|
13467
|
-
*
|
|
13499
|
+
* let user = null
|
|
13500
|
+
* try {
|
|
13501
|
+
* user = await userRepo.findByEmail(dto.email)
|
|
13502
|
+
* } catch {
|
|
13503
|
+
* // an unknown account and a failed lookup take the same time
|
|
13504
|
+
* }
|
|
13468
13505
|
* const elapsed = Date.now() - start
|
|
13469
13506
|
* await sleep(Math.max(0, MIN_RESPONSE_MS - elapsed)) // always >= 300 ms total
|
|
13470
13507
|
* ```
|
|
@@ -13817,6 +13854,8 @@ declare class ApiKeyGuard implements CanActivate {
|
|
|
13817
13854
|
* @returns The scopes, or `null` when the route declares none.
|
|
13818
13855
|
*/
|
|
13819
13856
|
private declaredScopes;
|
|
13857
|
+
/** Audits a denial and refuses with the code of its reason; never returns. */
|
|
13858
|
+
private refuse;
|
|
13820
13859
|
/**
|
|
13821
13860
|
* Emits the audit event.
|
|
13822
13861
|
*
|
|
@@ -14069,12 +14108,6 @@ declare const AllowPendingWorkspace: () => MethodDecorator & ClassDecorator;
|
|
|
14069
14108
|
*/
|
|
14070
14109
|
declare const CurrentWsWorkspace: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
14071
14110
|
|
|
14072
|
-
/**
|
|
14073
|
-
* @fileoverview Names scoped to a workspace: the keys, rooms and prefixes a host builds for
|
|
14074
|
-
* storage, cache, sockets and queues, encoded so two workspaces can never share one.
|
|
14075
|
-
*
|
|
14076
|
-
* @layer Utility
|
|
14077
|
-
*/
|
|
14078
14111
|
/**
|
|
14079
14112
|
* Builds the name of something that belongs to one workspace.
|
|
14080
14113
|
*
|
package/dist/server/index.d.ts
CHANGED
|
@@ -7398,11 +7398,13 @@ declare class WorkspaceAccessService {
|
|
|
7398
7398
|
/**
|
|
7399
7399
|
* Reads the workspace and the membership together, whatever the first one says.
|
|
7400
7400
|
*
|
|
7401
|
-
* A missing workspace, an inactive one and a non-member then cost the same repository
|
|
7402
|
-
*
|
|
7403
|
-
*
|
|
7401
|
+
* A missing workspace, an inactive one and a non-member then cost the same repository reads, and
|
|
7402
|
+
* a repository that finds nothing is copied for the same work per field as one that finds a row.
|
|
7403
|
+
* That is the same work, not the same time: how long a host's database takes for each row is
|
|
7404
|
+
* outside this library. The pending-deletion answer for an owner is decided from these same two rows.
|
|
7404
7405
|
*/
|
|
7405
7406
|
private readRepositories;
|
|
7407
|
+
private accessFrom;
|
|
7406
7408
|
}
|
|
7407
7409
|
|
|
7408
7410
|
/**
|
|
@@ -9696,6 +9698,11 @@ declare class SessionService {
|
|
|
9696
9698
|
* caller told only that "a hash" was malformed cannot act on it.
|
|
9697
9699
|
*/
|
|
9698
9700
|
rotateSession(oldHash: string, newHash: string, ip: string, userAgent: string): Promise<void>;
|
|
9701
|
+
/**
|
|
9702
|
+
* Reads the creation time of the session being rotated, so that its age is stable across token
|
|
9703
|
+
* rotations; the current time when its detail is missing or unparseable.
|
|
9704
|
+
*/
|
|
9705
|
+
private readRotatedCreatedAt;
|
|
9699
9706
|
/**
|
|
9700
9707
|
* Asserts that a session hash string is a valid 64-character lowercase hex string.
|
|
9701
9708
|
*
|
|
@@ -9736,6 +9743,10 @@ declare class SessionService {
|
|
|
9736
9743
|
* rotation script writes it.
|
|
9737
9744
|
*/
|
|
9738
9745
|
private graceSuccessor;
|
|
9746
|
+
/** Drops the grace pointers that have expired from the index, without making the listing wait for it. */
|
|
9747
|
+
private pruneGracePointers;
|
|
9748
|
+
/** Drops the members of the index that name nothing, without making the listing wait for it. */
|
|
9749
|
+
private pruneDeadPointers;
|
|
9739
9750
|
/**
|
|
9740
9751
|
* The Redis key of this user's session index.
|
|
9741
9752
|
*
|
|
@@ -9801,6 +9812,8 @@ declare class SessionService {
|
|
|
9801
9812
|
* @returns Maximum allowed concurrent sessions for the given user.
|
|
9802
9813
|
*/
|
|
9803
9814
|
private resolveSessionLimit;
|
|
9815
|
+
/** Reads the creation time of every member together; a failed read throws, after the reads before it settled. */
|
|
9816
|
+
private readAges;
|
|
9804
9817
|
}
|
|
9805
9818
|
|
|
9806
9819
|
/**
|
|
@@ -10415,6 +10428,8 @@ declare class AuthService {
|
|
|
10415
10428
|
password: string;
|
|
10416
10429
|
tenantId?: string;
|
|
10417
10430
|
}, req: Request): Promise<AuthResult | MfaChallengeResult>;
|
|
10431
|
+
/** Issues the tokens of a signed-in user and, when sessions are enabled, records the session that holds them. */
|
|
10432
|
+
private openSession;
|
|
10418
10433
|
/**
|
|
10419
10434
|
* Logs out a dashboard user by revoking the access token and deleting the refresh session.
|
|
10420
10435
|
*
|
|
@@ -10760,6 +10775,10 @@ declare class AuthService {
|
|
|
10760
10775
|
* refused login into a different refusal, nor a successful one into a failure.
|
|
10761
10776
|
*/
|
|
10762
10777
|
private fireAndForget;
|
|
10778
|
+
/** Records the time of a login without making the login wait for it; a failure is logged, never raised. */
|
|
10779
|
+
private touchLastLogin;
|
|
10780
|
+
/** Moves the detail of a session to its rotated token without making the refresh wait for it. */
|
|
10781
|
+
private rotateSessionDetail;
|
|
10763
10782
|
/** Writes the event of a password login that reached its end: tokens issued, or an MFA challenge. */
|
|
10764
10783
|
private logLogin;
|
|
10765
10784
|
private assertUserNotBlocked;
|
|
@@ -11074,6 +11093,15 @@ declare class MfaRecordService {
|
|
|
11074
11093
|
* @throws {@link AuthException} `MFA_STATE_CONFLICT` when another transition holds the lock.
|
|
11075
11094
|
*/
|
|
11076
11095
|
transition(context: 'dashboard' | 'platform', userId: string, tenantId: string | undefined, mutate: (current: AuthUser | AuthPlatformUser) => MfaRecordUpdate | null): Promise<boolean>;
|
|
11096
|
+
/**
|
|
11097
|
+
* Writes an update inside the lock, to the repository of the plane the account belongs to.
|
|
11098
|
+
*
|
|
11099
|
+
* @param context - Which identity plane the account belongs to.
|
|
11100
|
+
* @param userId - The account being written.
|
|
11101
|
+
* @param tenantId - The account's tenant, required on the dashboard plane.
|
|
11102
|
+
* @param update - What `mutate` asked to be stored.
|
|
11103
|
+
*/
|
|
11104
|
+
private persist;
|
|
11077
11105
|
/**
|
|
11078
11106
|
* Releases the transition lock this call took, whatever the store answers.
|
|
11079
11107
|
*
|
|
@@ -11200,6 +11228,13 @@ declare class MfaChallengeService {
|
|
|
11200
11228
|
* @throws `MFA_INVALID_CODE` if the submitted code is incorrect.
|
|
11201
11229
|
*/
|
|
11202
11230
|
challenge(mfaTempToken: string, code: string, ip: string, userAgent: string, mfa: MfaConfig): Promise<AuthResult | PlatformAuthResult>;
|
|
11231
|
+
/** The checks and the session of one challenge, run on the plane the temp token names. */
|
|
11232
|
+
private admitChallenge;
|
|
11233
|
+
/**
|
|
11234
|
+
* Consumes the temp token, and the consume must WIN: two concurrent submissions both see the marker, and on the recovery-code
|
|
11235
|
+
* path one code and one token would mint two sessions. The loser is reported as an invalid temp token.
|
|
11236
|
+
*/
|
|
11237
|
+
private consumeOrRefuse;
|
|
11203
11238
|
/**
|
|
11204
11239
|
* Refuses a challenge for an account at its failure ceiling.
|
|
11205
11240
|
*
|
|
@@ -11557,21 +11592,6 @@ interface MfaSetupResult {
|
|
|
11557
11592
|
/** Plain-text recovery codes. Display once and never persist in this form. */
|
|
11558
11593
|
recoveryCodes: string[];
|
|
11559
11594
|
}
|
|
11560
|
-
/**
|
|
11561
|
-
* Manages TOTP-based multi-factor authentication lifecycle.
|
|
11562
|
-
*
|
|
11563
|
-
* Handles the complete MFA flow for both dashboard users and platform admins:
|
|
11564
|
-
* - **Setup**: generate TOTP secret + recovery codes, store temporarily in Redis
|
|
11565
|
-
* - **Verify & Enable**: confirm first TOTP code, persist encrypted secret to DB
|
|
11566
|
-
* - **Challenge**: exchange a valid MFA temp token + code for full access tokens
|
|
11567
|
-
* - **Disable**: require a current TOTP code to disable MFA
|
|
11568
|
-
*
|
|
11569
|
-
* @remarks
|
|
11570
|
-
* This service is only registered when `options.mfa` is configured in
|
|
11571
|
-
* `BymaxAuthModule.registerAsync()`. All crypto operations use `node:crypto` only.
|
|
11572
|
-
*
|
|
11573
|
-
* @layer Service
|
|
11574
|
-
*/
|
|
11575
11595
|
declare class MfaService {
|
|
11576
11596
|
private readonly options;
|
|
11577
11597
|
private readonly userRepo;
|
|
@@ -11596,6 +11616,8 @@ declare class MfaService {
|
|
|
11596
11616
|
* here eliminates repetitive `!` assertions throughout the class.
|
|
11597
11617
|
*/
|
|
11598
11618
|
private get mfaOptions();
|
|
11619
|
+
/** The setup a first request stored, read back for the account's address. */
|
|
11620
|
+
private storedSetup;
|
|
11599
11621
|
/**
|
|
11600
11622
|
* Initiates the MFA setup flow for a dashboard user or platform administrator.
|
|
11601
11623
|
*
|
|
@@ -12204,6 +12226,10 @@ declare class PasswordResetService {
|
|
|
12204
12226
|
* the configured breach checker.
|
|
12205
12227
|
*/
|
|
12206
12228
|
changePassword(userId: string, tenantId: string, dto: ChangePasswordDto, currentRefreshToken?: string): Promise<void>;
|
|
12229
|
+
/**
|
|
12230
|
+
* Counts a failed proof of the current password and refuses a locked account, a wrong password included.
|
|
12231
|
+
*/
|
|
12232
|
+
private assertCurrentPassword;
|
|
12207
12233
|
/**
|
|
12208
12234
|
* The hash of the live session a presented refresh token stands for, or `undefined` when the
|
|
12209
12235
|
* request carried none. Refuses a token that names no live session of the account; a token that
|
|
@@ -12263,6 +12289,8 @@ declare class PasswordResetService {
|
|
|
12263
12289
|
* Errors are caught and logged — they must not propagate to `initiateReset`.
|
|
12264
12290
|
*/
|
|
12265
12291
|
private sendToken;
|
|
12292
|
+
/** Deletes the token of a reset whose delivery failed, so nothing keeps a working reset nobody was sent. */
|
|
12293
|
+
private dropUnsentToken;
|
|
12266
12294
|
/**
|
|
12267
12295
|
* Generates and stores a password-reset OTP, then sends it to the user's email.
|
|
12268
12296
|
* Errors are caught and logged — they must not propagate to `initiateReset`.
|
|
@@ -12338,6 +12366,8 @@ declare class PlatformAuthService {
|
|
|
12338
12366
|
* account status is configured as blocked.
|
|
12339
12367
|
*/
|
|
12340
12368
|
login(dto: PlatformLoginDto, ip: string, userAgent: string): Promise<PlatformAuthResult | MfaChallengeResult>;
|
|
12369
|
+
/** Records the time of a login without making the login wait for it; a failure is logged, never raised. */
|
|
12370
|
+
private touchLastLogin;
|
|
12341
12371
|
/**
|
|
12342
12372
|
* Logs out a platform administrator by revoking the access token JTI and
|
|
12343
12373
|
* deleting the associated platform refresh session from Redis.
|
|
@@ -13204,6 +13234,8 @@ declare class OAuthService {
|
|
|
13204
13234
|
* @returns The auth result.
|
|
13205
13235
|
*/
|
|
13206
13236
|
private openSession;
|
|
13237
|
+
/** Starts the non-blocking side effects of a login; nothing waits for them. */
|
|
13238
|
+
private runLoginSideEffects;
|
|
13207
13239
|
/**
|
|
13208
13240
|
* Validates and spends the `state` of a callback.
|
|
13209
13241
|
*
|
|
@@ -13464,7 +13496,12 @@ declare function sanitizeHeaders(headers: Record<string, string | string[] | und
|
|
|
13464
13496
|
* ```typescript
|
|
13465
13497
|
* const MIN_RESPONSE_MS = 300
|
|
13466
13498
|
* const start = Date.now()
|
|
13467
|
-
*
|
|
13499
|
+
* let user = null
|
|
13500
|
+
* try {
|
|
13501
|
+
* user = await userRepo.findByEmail(dto.email)
|
|
13502
|
+
* } catch {
|
|
13503
|
+
* // an unknown account and a failed lookup take the same time
|
|
13504
|
+
* }
|
|
13468
13505
|
* const elapsed = Date.now() - start
|
|
13469
13506
|
* await sleep(Math.max(0, MIN_RESPONSE_MS - elapsed)) // always >= 300 ms total
|
|
13470
13507
|
* ```
|
|
@@ -13817,6 +13854,8 @@ declare class ApiKeyGuard implements CanActivate {
|
|
|
13817
13854
|
* @returns The scopes, or `null` when the route declares none.
|
|
13818
13855
|
*/
|
|
13819
13856
|
private declaredScopes;
|
|
13857
|
+
/** Audits a denial and refuses with the code of its reason; never returns. */
|
|
13858
|
+
private refuse;
|
|
13820
13859
|
/**
|
|
13821
13860
|
* Emits the audit event.
|
|
13822
13861
|
*
|
|
@@ -14069,12 +14108,6 @@ declare const AllowPendingWorkspace: () => MethodDecorator & ClassDecorator;
|
|
|
14069
14108
|
*/
|
|
14070
14109
|
declare const CurrentWsWorkspace: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
14071
14110
|
|
|
14072
|
-
/**
|
|
14073
|
-
* @fileoverview Names scoped to a workspace: the keys, rooms and prefixes a host builds for
|
|
14074
|
-
* storage, cache, sockets and queues, encoded so two workspaces can never share one.
|
|
14075
|
-
*
|
|
14076
|
-
* @layer Utility
|
|
14077
|
-
*/
|
|
14078
14111
|
/**
|
|
14079
14112
|
* Builds the name of something that belongs to one workspace.
|
|
14080
14113
|
*
|