@passflow/core 0.48.0 → 0.49.0
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/README.md +42 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -14
- package/dist/index.d.ts +89 -14
- package/dist/index.mjs +994 -929
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -684,8 +684,8 @@ interface PlatformAdapter {
|
|
|
684
684
|
getDeviceType(): 'web' | 'ios' | 'android';
|
|
685
685
|
}
|
|
686
686
|
export declare class WebAdapter implements PlatformAdapter {
|
|
687
|
-
/**
|
|
688
|
-
private
|
|
687
|
+
/** Whether this browser supports FedCM, set on the first read of `identityCredentials`. */
|
|
688
|
+
private identitySupport?;
|
|
689
689
|
get storage(): PlatformStorage;
|
|
690
690
|
/**
|
|
691
691
|
* `storage` is the browser's localStorage, which every tab of the origin shares. False in
|
|
@@ -771,8 +771,8 @@ export declare class WebAdapter implements PlatformAdapter {
|
|
|
771
771
|
*/
|
|
772
772
|
readonly passkeys: PasskeySupport;
|
|
773
773
|
/**
|
|
774
|
-
* FedCM, when this browser has it with `mode` and `params
|
|
775
|
-
* once, on the first read, never at import.
|
|
774
|
+
* FedCM, when this browser has it with `mode` and `params` (Chromium 132 or later); undefined
|
|
775
|
+
* otherwise. The check runs once per instance, on the first read, never at import.
|
|
776
776
|
*/
|
|
777
777
|
get identityCredentials(): IdentityCredentialSupport | undefined;
|
|
778
778
|
/**
|
|
@@ -967,14 +967,15 @@ export declare const recoveryCodesFactor: UpgradeFactor;
|
|
|
967
967
|
* challenge id that binds it to this session.
|
|
968
968
|
*/
|
|
969
969
|
export declare const passkeyFactor: UpgradeFactor;
|
|
970
|
+
/** A code sent by email. */
|
|
971
|
+
export declare const emailOtpFactor: UpgradeFactor;
|
|
972
|
+
/** A code sent by text message. Texts cost money, so it sorts after email. */
|
|
973
|
+
export declare const smsOtpFactor: UpgradeFactor;
|
|
970
974
|
/**
|
|
971
|
-
* The factors this SDK can
|
|
972
|
-
*
|
|
973
|
-
*
|
|
974
|
-
*
|
|
975
|
-
* enrol them and `upgradeMethodRegistered` refuses the prepare round. Adding
|
|
976
|
-
* them later is one entry here plus a factor whose assert returns
|
|
977
|
-
* `{ challenge_id, code }` — no change to anything that consumes this registry.
|
|
975
|
+
* The factors this SDK can complete, in its default order: TOTP, passkey, an
|
|
976
|
+
* emailed code, a texted code, then recovery codes. The server sends emailed and
|
|
977
|
+
* texted codes at sign-in and at step-up. When the step-up answer lists
|
|
978
|
+
* `available_factors`, that list and its order decide what is offered.
|
|
978
979
|
*/
|
|
979
980
|
export declare const DEFAULT_UPGRADE_FACTORS: readonly UpgradeFactor[];
|
|
980
981
|
/** Indexes a factor list by type for lookup during a challenge. */
|
|
@@ -2207,7 +2208,10 @@ export type PassflowSessionDevice = {
|
|
|
2207
2208
|
user_agent?: string;
|
|
2208
2209
|
ip?: string;
|
|
2209
2210
|
location?: string;
|
|
2210
|
-
/**
|
|
2211
|
+
/**
|
|
2212
|
+
* RFC 3339 time of the last request from this device. The server reads it from the device, so
|
|
2213
|
+
* every session of the same device shows the same time.
|
|
2214
|
+
*/
|
|
2211
2215
|
last_seen?: string;
|
|
2212
2216
|
};
|
|
2213
2217
|
/** One signed-in session of the current user. */
|
|
@@ -3877,6 +3881,8 @@ export declare class TwoFactorApiClient {
|
|
|
3877
3881
|
export type UpgradeStartPayload = {
|
|
3878
3882
|
method: string;
|
|
3879
3883
|
relying_party_id?: string;
|
|
3884
|
+
/** Asks for a new code (or push request) in place of the live one. */
|
|
3885
|
+
resend?: boolean;
|
|
3880
3886
|
};
|
|
3881
3887
|
export declare class UpgradeAPI {
|
|
3882
3888
|
protected axiosClient: AxiosClient;
|
|
@@ -6179,6 +6185,42 @@ type UpgradePromptRequest = {
|
|
|
6179
6185
|
* no longer read. A prompt subscribes the same way as to `onRequirementRaised`.
|
|
6180
6186
|
*/
|
|
6181
6187
|
onClosed?: () => void;
|
|
6188
|
+
/**
|
|
6189
|
+
* Where the last code went, when the flight holds a sent code for an emailed
|
|
6190
|
+
* or texted factor. Set on a re-shown prompt, so it can keep saying "code sent
|
|
6191
|
+
* to j***@e***.com" after a wrong code.
|
|
6192
|
+
*/
|
|
6193
|
+
codeSent?: UpgradeCodeSent;
|
|
6194
|
+
/**
|
|
6195
|
+
* Called each time the server answers a code request: when the user picks an
|
|
6196
|
+
* emailed or texted factor, on `resend`, and when the server says the held
|
|
6197
|
+
* challenge is spent or expired. A prompt subscribes the same way as to
|
|
6198
|
+
* `onRequirementRaised`.
|
|
6199
|
+
*/
|
|
6200
|
+
onCodeSent?: (sent: UpgradeCodeSent) => void;
|
|
6201
|
+
/**
|
|
6202
|
+
* Asks the server for a new code for an emailed or texted factor, and resolves
|
|
6203
|
+
* with its answer, which the next submit uses. `resent` tells whether a new code
|
|
6204
|
+
* went out: a server that keeps the live code answers with it again and sends
|
|
6205
|
+
* nothing. Rejects for a factor that sends no code, once this prompt's step-up
|
|
6206
|
+
* has ended, and with the transport's error when the request fails; the code
|
|
6207
|
+
* held before then still works.
|
|
6208
|
+
*/
|
|
6209
|
+
resend: (factor: UpgradeFactorType) => Promise<UpgradeCodeSent>;
|
|
6210
|
+
};
|
|
6211
|
+
/** The server's answer to a code request for an emailed or texted factor. */
|
|
6212
|
+
type UpgradeCodeSent = {
|
|
6213
|
+
factor: UpgradeFactorType;
|
|
6214
|
+
/** Masked address the code went to, e.g. `j***@e***.com`. */
|
|
6215
|
+
codeSentTo?: string;
|
|
6216
|
+
/** RFC 3339 time the code stops working. */
|
|
6217
|
+
expiresAt: string;
|
|
6218
|
+
/**
|
|
6219
|
+
* True when this answer is a new code in place of one this step-up already
|
|
6220
|
+
* held. False on the first code, and when the server answered with the live
|
|
6221
|
+
* code again: the code already sent is still the one to type.
|
|
6222
|
+
*/
|
|
6223
|
+
resent: boolean;
|
|
6182
6224
|
};
|
|
6183
6225
|
/** The user's answer to an upgrade prompt. */
|
|
6184
6226
|
type UpgradePromptResult = {
|
|
@@ -6201,7 +6243,9 @@ type UpgradeTransport = {
|
|
|
6201
6243
|
* the factor differs from ours. Both are recoveries: the factor then asserts
|
|
6202
6244
|
* with no `prepared`, which is already the TOTP path.
|
|
6203
6245
|
*/
|
|
6204
|
-
prepare(method: UpgradeFactorType
|
|
6246
|
+
prepare(method: UpgradeFactorType, options?: {
|
|
6247
|
+
resend?: boolean;
|
|
6248
|
+
}): Promise<UpgradePrepared | undefined>;
|
|
6205
6249
|
/** `POST /auth/refresh` carrying `upgrade`. Resolves once elevated tokens are stored. */
|
|
6206
6250
|
commit(factor: UpgradeFactorType, assertion: UpgradeAssertion): Promise<void>;
|
|
6207
6251
|
};
|
|
@@ -6391,6 +6435,16 @@ export declare class UpgradeController {
|
|
|
6391
6435
|
private pruned;
|
|
6392
6436
|
/** The request handed to the open prompt. Its `onRequirementRaised` slot is branch 2's channel. */
|
|
6393
6437
|
private openPrompt;
|
|
6438
|
+
/**
|
|
6439
|
+
* The challenge of the code last sent for an emailed or texted factor. The next
|
|
6440
|
+
* submit for that factor uses it, so a wrong code is answered again on the same
|
|
6441
|
+
* challenge instead of sending a new code.
|
|
6442
|
+
*/
|
|
6443
|
+
private heldCode;
|
|
6444
|
+
/** Where the held code went, once its send has succeeded. */
|
|
6445
|
+
private codeSent;
|
|
6446
|
+
/** The challenge id of `codeSent`, to tell a new code from the live one answered again. */
|
|
6447
|
+
private codeSentChallenge;
|
|
6394
6448
|
/** Set while `awaitReports` is waiting; called by the reporting path. See H7. */
|
|
6395
6449
|
private reportsSettled?;
|
|
6396
6450
|
constructor(options: UpgradeControllerOptions);
|
|
@@ -6488,6 +6542,9 @@ export declare class UpgradeController {
|
|
|
6488
6542
|
* is single-use and the server consumes it atomically, so a failed attempt has
|
|
6489
6543
|
* already spent it. Reusing the id would fail with
|
|
6490
6544
|
* `ErrorUpgradeChallengeInvalid` and look like a bad code to the user.
|
|
6545
|
+
*
|
|
6546
|
+
* Emailed and texted codes are the exception: the server gives one code several
|
|
6547
|
+
* tries, so their challenge is held across attempts (see `proveSentCode`).
|
|
6491
6548
|
*/
|
|
6492
6549
|
private prove;
|
|
6493
6550
|
/** Opens (or re-opens) the prompt and wires the two prompt → controller edges. */
|
|
@@ -6496,6 +6553,24 @@ export declare class UpgradeController {
|
|
|
6496
6553
|
private classifyProofFailure;
|
|
6497
6554
|
/** Runs one full proof for a single factor. */
|
|
6498
6555
|
private proveAndCommit;
|
|
6556
|
+
/**
|
|
6557
|
+
* Proves an emailed or texted code against the held challenge.
|
|
6558
|
+
*
|
|
6559
|
+
* The server gives one code several tries, so a wrong code keeps the challenge
|
|
6560
|
+
* and the user answers again. A new code goes out only on `resend`, or here when
|
|
6561
|
+
* the server says the challenge is spent or expired. A prompt that never called
|
|
6562
|
+
* `onFactorSelected` reaches this with no code sent: the send happens now, the
|
|
6563
|
+
* empty answer fails, and the re-shown prompt takes the code.
|
|
6564
|
+
*/
|
|
6565
|
+
private proveSentCode;
|
|
6566
|
+
/**
|
|
6567
|
+
* Asks for a code for an emailed or texted factor and holds its challenge.
|
|
6568
|
+
*
|
|
6569
|
+
* A refused `resend` puts the previous hold back, so the code the user already
|
|
6570
|
+
* has still works. Any other failed send stays held as a rejection until the
|
|
6571
|
+
* submit reports it.
|
|
6572
|
+
*/
|
|
6573
|
+
private sendCode;
|
|
6499
6574
|
}
|
|
6500
6575
|
/** "You were challenged and you declined" — as opposed to "you were not authorised". */
|
|
6501
6576
|
export declare const isUpgradeCancelled: (response: object) => boolean;
|
|
@@ -8784,4 +8859,4 @@ export declare function isValidPhoneNumber(phone: string): boolean;
|
|
|
8784
8859
|
* @returns true if valid username format, false otherwise
|
|
8785
8860
|
*/
|
|
8786
8861
|
export declare function isValidUsername(username: string): boolean;
|
|
8787
|
-
export type { AntiBotAppSettings, AntiBotDeviceContext, AntiBotOperation, AntiBotTokenContext, AntiBotTokenProvider, AntiBotTokenRequest, AssuranceBar, AuthCallbackResult, BodyKind, ChallengeChannel, CreateClientConfig, CurrentUrlInfo, DeviceProofUse, DevicePushProofUse, ErrorPayload, EventOrigin, FetchLike, FetchMiddleware, GroupMembership, IdentityCredentialRequest, IdentityCredentialSupport, InvitationToken, M2MClientConfig, M2MErrorCode, M2MErrorResponse, M2MRateLimitInfo, M2MTokenCache, M2MTokenClaims, M2MTokenRequestInfo, M2MTokenRequestOptions, M2MTokenResponse, NativeSignInErrorReason, OidcErrorCode, OpenAuthUrlOptions, OperationErrorPayload, PassflowEmailVerificationOperation, PassflowEventPayload, PassflowOperation, PassflowRefreshErrorOptions, PassflowSubscriber, PasskeySupport, PlatformAdapter, PlatformStorage, RawUserMembership, RefreshChannel, RefreshClock, RefreshCoordination, RefreshCoordinator, RefreshErrorInfo, RefreshFailureKind, RefreshLockManager, RefreshLockOptions, RefreshTrigger, RegisterOptions, ReplayPolicy, RequestSnapshot, ResponseInterceptorHost, RetryStrategy, RiskIdContext, RiskIdOperation, RiskIdProvider, SessionExpiredReason, SnapshotHeader, Tenant, TenantMembership, Token, UpgradeAssertContext, UpgradeAssertion, UpgradeChallenge, UpgradeCommitInterruptedReason, UpgradeControllerOptions, UpgradeDiagnostic, UpgradeDiagnosticReason, UpgradeDiagnosticSink, UpgradeElevation, UpgradeEnableOptions, UpgradeEndpoint, UpgradeErrorKind, UpgradeFacade, UpgradeFactor, UpgradeFactorInput, UpgradeFactorType, UpgradeFlightState, UpgradeFlightSummary, UpgradeOptions, UpgradePrepared, UpgradePromptHandler, UpgradePromptRequest, UpgradePromptResult, UpgradeProof, UpgradeReplayInfo, UpgradeResult, UpgradeSessionPin, UpgradeTransport, UpgradeTransportErrorInit, UpgradeWaiterSummary, UserMembership, Waiter, WaiterEntry, WaiterOutcome, WaiterReport, WithAuthOptions };
|
|
8862
|
+
export type { AntiBotAppSettings, AntiBotDeviceContext, AntiBotOperation, AntiBotTokenContext, AntiBotTokenProvider, AntiBotTokenRequest, AssuranceBar, AuthCallbackResult, BodyKind, ChallengeChannel, CreateClientConfig, CurrentUrlInfo, DeviceProofUse, DevicePushProofUse, ErrorPayload, EventOrigin, FetchLike, FetchMiddleware, GroupMembership, IdentityCredentialRequest, IdentityCredentialSupport, InvitationToken, M2MClientConfig, M2MErrorCode, M2MErrorResponse, M2MRateLimitInfo, M2MTokenCache, M2MTokenClaims, M2MTokenRequestInfo, M2MTokenRequestOptions, M2MTokenResponse, NativeSignInErrorReason, OidcErrorCode, OpenAuthUrlOptions, OperationErrorPayload, PassflowEmailVerificationOperation, PassflowEventPayload, PassflowOperation, PassflowRefreshErrorOptions, PassflowSubscriber, PasskeySupport, PlatformAdapter, PlatformStorage, RawUserMembership, RefreshChannel, RefreshClock, RefreshCoordination, RefreshCoordinator, RefreshErrorInfo, RefreshFailureKind, RefreshLockManager, RefreshLockOptions, RefreshTrigger, RegisterOptions, ReplayPolicy, RequestSnapshot, ResponseInterceptorHost, RetryStrategy, RiskIdContext, RiskIdOperation, RiskIdProvider, SessionExpiredReason, SnapshotHeader, Tenant, TenantMembership, Token, UpgradeAssertContext, UpgradeAssertion, UpgradeChallenge, UpgradeCodeSent, UpgradeCommitInterruptedReason, UpgradeControllerOptions, UpgradeDiagnostic, UpgradeDiagnosticReason, UpgradeDiagnosticSink, UpgradeElevation, UpgradeEnableOptions, UpgradeEndpoint, UpgradeErrorKind, UpgradeFacade, UpgradeFactor, UpgradeFactorInput, UpgradeFactorType, UpgradeFlightState, UpgradeFlightSummary, UpgradeOptions, UpgradePrepared, UpgradePromptHandler, UpgradePromptRequest, UpgradePromptResult, UpgradeProof, UpgradeReplayInfo, UpgradeResult, UpgradeSessionPin, UpgradeTransport, UpgradeTransportErrorInit, UpgradeWaiterSummary, UserMembership, Waiter, WaiterEntry, WaiterOutcome, WaiterReport, WithAuthOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -684,8 +684,8 @@ interface PlatformAdapter {
|
|
|
684
684
|
getDeviceType(): 'web' | 'ios' | 'android';
|
|
685
685
|
}
|
|
686
686
|
export declare class WebAdapter implements PlatformAdapter {
|
|
687
|
-
/**
|
|
688
|
-
private
|
|
687
|
+
/** Whether this browser supports FedCM, set on the first read of `identityCredentials`. */
|
|
688
|
+
private identitySupport?;
|
|
689
689
|
get storage(): PlatformStorage;
|
|
690
690
|
/**
|
|
691
691
|
* `storage` is the browser's localStorage, which every tab of the origin shares. False in
|
|
@@ -771,8 +771,8 @@ export declare class WebAdapter implements PlatformAdapter {
|
|
|
771
771
|
*/
|
|
772
772
|
readonly passkeys: PasskeySupport;
|
|
773
773
|
/**
|
|
774
|
-
* FedCM, when this browser has it with `mode` and `params
|
|
775
|
-
* once, on the first read, never at import.
|
|
774
|
+
* FedCM, when this browser has it with `mode` and `params` (Chromium 132 or later); undefined
|
|
775
|
+
* otherwise. The check runs once per instance, on the first read, never at import.
|
|
776
776
|
*/
|
|
777
777
|
get identityCredentials(): IdentityCredentialSupport | undefined;
|
|
778
778
|
/**
|
|
@@ -967,14 +967,15 @@ export declare const recoveryCodesFactor: UpgradeFactor;
|
|
|
967
967
|
* challenge id that binds it to this session.
|
|
968
968
|
*/
|
|
969
969
|
export declare const passkeyFactor: UpgradeFactor;
|
|
970
|
+
/** A code sent by email. */
|
|
971
|
+
export declare const emailOtpFactor: UpgradeFactor;
|
|
972
|
+
/** A code sent by text message. Texts cost money, so it sorts after email. */
|
|
973
|
+
export declare const smsOtpFactor: UpgradeFactor;
|
|
970
974
|
/**
|
|
971
|
-
* The factors this SDK can
|
|
972
|
-
*
|
|
973
|
-
*
|
|
974
|
-
*
|
|
975
|
-
* enrol them and `upgradeMethodRegistered` refuses the prepare round. Adding
|
|
976
|
-
* them later is one entry here plus a factor whose assert returns
|
|
977
|
-
* `{ challenge_id, code }` — no change to anything that consumes this registry.
|
|
975
|
+
* The factors this SDK can complete, in its default order: TOTP, passkey, an
|
|
976
|
+
* emailed code, a texted code, then recovery codes. The server sends emailed and
|
|
977
|
+
* texted codes at sign-in and at step-up. When the step-up answer lists
|
|
978
|
+
* `available_factors`, that list and its order decide what is offered.
|
|
978
979
|
*/
|
|
979
980
|
export declare const DEFAULT_UPGRADE_FACTORS: readonly UpgradeFactor[];
|
|
980
981
|
/** Indexes a factor list by type for lookup during a challenge. */
|
|
@@ -2207,7 +2208,10 @@ export type PassflowSessionDevice = {
|
|
|
2207
2208
|
user_agent?: string;
|
|
2208
2209
|
ip?: string;
|
|
2209
2210
|
location?: string;
|
|
2210
|
-
/**
|
|
2211
|
+
/**
|
|
2212
|
+
* RFC 3339 time of the last request from this device. The server reads it from the device, so
|
|
2213
|
+
* every session of the same device shows the same time.
|
|
2214
|
+
*/
|
|
2211
2215
|
last_seen?: string;
|
|
2212
2216
|
};
|
|
2213
2217
|
/** One signed-in session of the current user. */
|
|
@@ -3877,6 +3881,8 @@ export declare class TwoFactorApiClient {
|
|
|
3877
3881
|
export type UpgradeStartPayload = {
|
|
3878
3882
|
method: string;
|
|
3879
3883
|
relying_party_id?: string;
|
|
3884
|
+
/** Asks for a new code (or push request) in place of the live one. */
|
|
3885
|
+
resend?: boolean;
|
|
3880
3886
|
};
|
|
3881
3887
|
export declare class UpgradeAPI {
|
|
3882
3888
|
protected axiosClient: AxiosClient;
|
|
@@ -6179,6 +6185,42 @@ type UpgradePromptRequest = {
|
|
|
6179
6185
|
* no longer read. A prompt subscribes the same way as to `onRequirementRaised`.
|
|
6180
6186
|
*/
|
|
6181
6187
|
onClosed?: () => void;
|
|
6188
|
+
/**
|
|
6189
|
+
* Where the last code went, when the flight holds a sent code for an emailed
|
|
6190
|
+
* or texted factor. Set on a re-shown prompt, so it can keep saying "code sent
|
|
6191
|
+
* to j***@e***.com" after a wrong code.
|
|
6192
|
+
*/
|
|
6193
|
+
codeSent?: UpgradeCodeSent;
|
|
6194
|
+
/**
|
|
6195
|
+
* Called each time the server answers a code request: when the user picks an
|
|
6196
|
+
* emailed or texted factor, on `resend`, and when the server says the held
|
|
6197
|
+
* challenge is spent or expired. A prompt subscribes the same way as to
|
|
6198
|
+
* `onRequirementRaised`.
|
|
6199
|
+
*/
|
|
6200
|
+
onCodeSent?: (sent: UpgradeCodeSent) => void;
|
|
6201
|
+
/**
|
|
6202
|
+
* Asks the server for a new code for an emailed or texted factor, and resolves
|
|
6203
|
+
* with its answer, which the next submit uses. `resent` tells whether a new code
|
|
6204
|
+
* went out: a server that keeps the live code answers with it again and sends
|
|
6205
|
+
* nothing. Rejects for a factor that sends no code, once this prompt's step-up
|
|
6206
|
+
* has ended, and with the transport's error when the request fails; the code
|
|
6207
|
+
* held before then still works.
|
|
6208
|
+
*/
|
|
6209
|
+
resend: (factor: UpgradeFactorType) => Promise<UpgradeCodeSent>;
|
|
6210
|
+
};
|
|
6211
|
+
/** The server's answer to a code request for an emailed or texted factor. */
|
|
6212
|
+
type UpgradeCodeSent = {
|
|
6213
|
+
factor: UpgradeFactorType;
|
|
6214
|
+
/** Masked address the code went to, e.g. `j***@e***.com`. */
|
|
6215
|
+
codeSentTo?: string;
|
|
6216
|
+
/** RFC 3339 time the code stops working. */
|
|
6217
|
+
expiresAt: string;
|
|
6218
|
+
/**
|
|
6219
|
+
* True when this answer is a new code in place of one this step-up already
|
|
6220
|
+
* held. False on the first code, and when the server answered with the live
|
|
6221
|
+
* code again: the code already sent is still the one to type.
|
|
6222
|
+
*/
|
|
6223
|
+
resent: boolean;
|
|
6182
6224
|
};
|
|
6183
6225
|
/** The user's answer to an upgrade prompt. */
|
|
6184
6226
|
type UpgradePromptResult = {
|
|
@@ -6201,7 +6243,9 @@ type UpgradeTransport = {
|
|
|
6201
6243
|
* the factor differs from ours. Both are recoveries: the factor then asserts
|
|
6202
6244
|
* with no `prepared`, which is already the TOTP path.
|
|
6203
6245
|
*/
|
|
6204
|
-
prepare(method: UpgradeFactorType
|
|
6246
|
+
prepare(method: UpgradeFactorType, options?: {
|
|
6247
|
+
resend?: boolean;
|
|
6248
|
+
}): Promise<UpgradePrepared | undefined>;
|
|
6205
6249
|
/** `POST /auth/refresh` carrying `upgrade`. Resolves once elevated tokens are stored. */
|
|
6206
6250
|
commit(factor: UpgradeFactorType, assertion: UpgradeAssertion): Promise<void>;
|
|
6207
6251
|
};
|
|
@@ -6391,6 +6435,16 @@ export declare class UpgradeController {
|
|
|
6391
6435
|
private pruned;
|
|
6392
6436
|
/** The request handed to the open prompt. Its `onRequirementRaised` slot is branch 2's channel. */
|
|
6393
6437
|
private openPrompt;
|
|
6438
|
+
/**
|
|
6439
|
+
* The challenge of the code last sent for an emailed or texted factor. The next
|
|
6440
|
+
* submit for that factor uses it, so a wrong code is answered again on the same
|
|
6441
|
+
* challenge instead of sending a new code.
|
|
6442
|
+
*/
|
|
6443
|
+
private heldCode;
|
|
6444
|
+
/** Where the held code went, once its send has succeeded. */
|
|
6445
|
+
private codeSent;
|
|
6446
|
+
/** The challenge id of `codeSent`, to tell a new code from the live one answered again. */
|
|
6447
|
+
private codeSentChallenge;
|
|
6394
6448
|
/** Set while `awaitReports` is waiting; called by the reporting path. See H7. */
|
|
6395
6449
|
private reportsSettled?;
|
|
6396
6450
|
constructor(options: UpgradeControllerOptions);
|
|
@@ -6488,6 +6542,9 @@ export declare class UpgradeController {
|
|
|
6488
6542
|
* is single-use and the server consumes it atomically, so a failed attempt has
|
|
6489
6543
|
* already spent it. Reusing the id would fail with
|
|
6490
6544
|
* `ErrorUpgradeChallengeInvalid` and look like a bad code to the user.
|
|
6545
|
+
*
|
|
6546
|
+
* Emailed and texted codes are the exception: the server gives one code several
|
|
6547
|
+
* tries, so their challenge is held across attempts (see `proveSentCode`).
|
|
6491
6548
|
*/
|
|
6492
6549
|
private prove;
|
|
6493
6550
|
/** Opens (or re-opens) the prompt and wires the two prompt → controller edges. */
|
|
@@ -6496,6 +6553,24 @@ export declare class UpgradeController {
|
|
|
6496
6553
|
private classifyProofFailure;
|
|
6497
6554
|
/** Runs one full proof for a single factor. */
|
|
6498
6555
|
private proveAndCommit;
|
|
6556
|
+
/**
|
|
6557
|
+
* Proves an emailed or texted code against the held challenge.
|
|
6558
|
+
*
|
|
6559
|
+
* The server gives one code several tries, so a wrong code keeps the challenge
|
|
6560
|
+
* and the user answers again. A new code goes out only on `resend`, or here when
|
|
6561
|
+
* the server says the challenge is spent or expired. A prompt that never called
|
|
6562
|
+
* `onFactorSelected` reaches this with no code sent: the send happens now, the
|
|
6563
|
+
* empty answer fails, and the re-shown prompt takes the code.
|
|
6564
|
+
*/
|
|
6565
|
+
private proveSentCode;
|
|
6566
|
+
/**
|
|
6567
|
+
* Asks for a code for an emailed or texted factor and holds its challenge.
|
|
6568
|
+
*
|
|
6569
|
+
* A refused `resend` puts the previous hold back, so the code the user already
|
|
6570
|
+
* has still works. Any other failed send stays held as a rejection until the
|
|
6571
|
+
* submit reports it.
|
|
6572
|
+
*/
|
|
6573
|
+
private sendCode;
|
|
6499
6574
|
}
|
|
6500
6575
|
/** "You were challenged and you declined" — as opposed to "you were not authorised". */
|
|
6501
6576
|
export declare const isUpgradeCancelled: (response: object) => boolean;
|
|
@@ -8784,4 +8859,4 @@ export declare function isValidPhoneNumber(phone: string): boolean;
|
|
|
8784
8859
|
* @returns true if valid username format, false otherwise
|
|
8785
8860
|
*/
|
|
8786
8861
|
export declare function isValidUsername(username: string): boolean;
|
|
8787
|
-
export type { AntiBotAppSettings, AntiBotDeviceContext, AntiBotOperation, AntiBotTokenContext, AntiBotTokenProvider, AntiBotTokenRequest, AssuranceBar, AuthCallbackResult, BodyKind, ChallengeChannel, CreateClientConfig, CurrentUrlInfo, DeviceProofUse, DevicePushProofUse, ErrorPayload, EventOrigin, FetchLike, FetchMiddleware, GroupMembership, IdentityCredentialRequest, IdentityCredentialSupport, InvitationToken, M2MClientConfig, M2MErrorCode, M2MErrorResponse, M2MRateLimitInfo, M2MTokenCache, M2MTokenClaims, M2MTokenRequestInfo, M2MTokenRequestOptions, M2MTokenResponse, NativeSignInErrorReason, OidcErrorCode, OpenAuthUrlOptions, OperationErrorPayload, PassflowEmailVerificationOperation, PassflowEventPayload, PassflowOperation, PassflowRefreshErrorOptions, PassflowSubscriber, PasskeySupport, PlatformAdapter, PlatformStorage, RawUserMembership, RefreshChannel, RefreshClock, RefreshCoordination, RefreshCoordinator, RefreshErrorInfo, RefreshFailureKind, RefreshLockManager, RefreshLockOptions, RefreshTrigger, RegisterOptions, ReplayPolicy, RequestSnapshot, ResponseInterceptorHost, RetryStrategy, RiskIdContext, RiskIdOperation, RiskIdProvider, SessionExpiredReason, SnapshotHeader, Tenant, TenantMembership, Token, UpgradeAssertContext, UpgradeAssertion, UpgradeChallenge, UpgradeCommitInterruptedReason, UpgradeControllerOptions, UpgradeDiagnostic, UpgradeDiagnosticReason, UpgradeDiagnosticSink, UpgradeElevation, UpgradeEnableOptions, UpgradeEndpoint, UpgradeErrorKind, UpgradeFacade, UpgradeFactor, UpgradeFactorInput, UpgradeFactorType, UpgradeFlightState, UpgradeFlightSummary, UpgradeOptions, UpgradePrepared, UpgradePromptHandler, UpgradePromptRequest, UpgradePromptResult, UpgradeProof, UpgradeReplayInfo, UpgradeResult, UpgradeSessionPin, UpgradeTransport, UpgradeTransportErrorInit, UpgradeWaiterSummary, UserMembership, Waiter, WaiterEntry, WaiterOutcome, WaiterReport, WithAuthOptions };
|
|
8862
|
+
export type { AntiBotAppSettings, AntiBotDeviceContext, AntiBotOperation, AntiBotTokenContext, AntiBotTokenProvider, AntiBotTokenRequest, AssuranceBar, AuthCallbackResult, BodyKind, ChallengeChannel, CreateClientConfig, CurrentUrlInfo, DeviceProofUse, DevicePushProofUse, ErrorPayload, EventOrigin, FetchLike, FetchMiddleware, GroupMembership, IdentityCredentialRequest, IdentityCredentialSupport, InvitationToken, M2MClientConfig, M2MErrorCode, M2MErrorResponse, M2MRateLimitInfo, M2MTokenCache, M2MTokenClaims, M2MTokenRequestInfo, M2MTokenRequestOptions, M2MTokenResponse, NativeSignInErrorReason, OidcErrorCode, OpenAuthUrlOptions, OperationErrorPayload, PassflowEmailVerificationOperation, PassflowEventPayload, PassflowOperation, PassflowRefreshErrorOptions, PassflowSubscriber, PasskeySupport, PlatformAdapter, PlatformStorage, RawUserMembership, RefreshChannel, RefreshClock, RefreshCoordination, RefreshCoordinator, RefreshErrorInfo, RefreshFailureKind, RefreshLockManager, RefreshLockOptions, RefreshTrigger, RegisterOptions, ReplayPolicy, RequestSnapshot, ResponseInterceptorHost, RetryStrategy, RiskIdContext, RiskIdOperation, RiskIdProvider, SessionExpiredReason, SnapshotHeader, Tenant, TenantMembership, Token, UpgradeAssertContext, UpgradeAssertion, UpgradeChallenge, UpgradeCodeSent, UpgradeCommitInterruptedReason, UpgradeControllerOptions, UpgradeDiagnostic, UpgradeDiagnosticReason, UpgradeDiagnosticSink, UpgradeElevation, UpgradeEnableOptions, UpgradeEndpoint, UpgradeErrorKind, UpgradeFacade, UpgradeFactor, UpgradeFactorInput, UpgradeFactorType, UpgradeFlightState, UpgradeFlightSummary, UpgradeOptions, UpgradePrepared, UpgradePromptHandler, UpgradePromptRequest, UpgradePromptResult, UpgradeProof, UpgradeReplayInfo, UpgradeResult, UpgradeSessionPin, UpgradeTransport, UpgradeTransportErrorInit, UpgradeWaiterSummary, UserMembership, Waiter, WaiterEntry, WaiterOutcome, WaiterReport, WithAuthOptions };
|