@passflow/core 0.47.0 → 0.48.1
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 +28 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -12
- package/dist/index.d.ts +22 -12
- package/dist/index.mjs +898 -909
- 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
|
/**
|
|
@@ -1826,7 +1826,10 @@ export type AppSettings = {
|
|
|
1826
1826
|
* the browser's own Google sign-in (FedCM) may be used. Absent means it is not available.
|
|
1827
1827
|
*/
|
|
1828
1828
|
google?: AppSettingsGoogle;
|
|
1829
|
-
/**
|
|
1829
|
+
/**
|
|
1830
|
+
* Present when a browser risk provider is on (with its public values) or the app's attack
|
|
1831
|
+
* protection may ask for a challenge; absent otherwise.
|
|
1832
|
+
*/
|
|
1830
1833
|
attack_protection?: AttackProtectionSettings;
|
|
1831
1834
|
};
|
|
1832
1835
|
/** `AppSettings.google`: what the browser's own Google sign-in needs. Every value is public. */
|
|
@@ -1852,6 +1855,8 @@ export type AttackProtectionSettings = {
|
|
|
1852
1855
|
stytch?: {
|
|
1853
1856
|
public_token: string;
|
|
1854
1857
|
};
|
|
1858
|
+
/** true when the app's attack protection may ask for a challenge; federated starts then go out as a POST. */
|
|
1859
|
+
challenge?: boolean;
|
|
1855
1860
|
};
|
|
1856
1861
|
/** `human_only`: every sign-in start must carry an anti-bot value in `X-Passflow-Anti-Bot`. */
|
|
1857
1862
|
export type BotMode = 'bot_friendly' | 'human_only';
|
|
@@ -5254,23 +5259,27 @@ export declare class AuthService {
|
|
|
5254
5259
|
/**
|
|
5255
5260
|
* Whether a federated start goes out as a POST (`AuthAPI.federatedStart`) rather than as a
|
|
5256
5261
|
* navigation to `createFederatedAuthUrl`: on a `human_only` app, whose start must carry the
|
|
5257
|
-
* anti-bot header
|
|
5258
|
-
*
|
|
5262
|
+
* anti-bot header; when the settings carry `attack_protection.challenge: true`, so a forced
|
|
5263
|
+
* challenge can be answered and the start resent; and for an agent tool, whose start must carry
|
|
5264
|
+
* its own header. A header cannot ride a navigation. Unknown or unreadable settings keep the
|
|
5265
|
+
* navigation.
|
|
5259
5266
|
*/
|
|
5260
5267
|
private usesFederatedPost;
|
|
5261
5268
|
/** The body of a POST federated start: the same fields the GET start sends as query parameters. */
|
|
5262
5269
|
private federatedStartBody;
|
|
5263
5270
|
/**
|
|
5264
5271
|
* The GET start URL. A `human_only` app refuses a start by navigation (403
|
|
5265
|
-
* `error.api.anti_bot.required`)
|
|
5266
|
-
*
|
|
5272
|
+
* `error.api.anti_bot.required`), and a navigation cannot pass a forced challenge when the app's
|
|
5273
|
+
* attack protection may ask for one; `federatedAuthWithPopup` and `federatedAuthWithRedirect`
|
|
5274
|
+
* POST the start in both cases instead.
|
|
5267
5275
|
*/
|
|
5268
5276
|
createFederatedAuthUrl(payload: PassflowFederatedAuthExtendedPayload): string;
|
|
5269
5277
|
/** The query of a GET start: the same fields `federatedStartBody` sends in a POST, as strings. */
|
|
5270
5278
|
private federatedStartQuery;
|
|
5271
5279
|
/**
|
|
5272
5280
|
* The GET enterprise start, for a top-level navigation. Sends the device id and every field
|
|
5273
|
-
* `createFederatedAuthUrl` sends. A `human_only` app refuses it (403)
|
|
5281
|
+
* `createFederatedAuthUrl` sends. A `human_only` app refuses it (403), and it cannot pass a
|
|
5282
|
+
* forced challenge when the app's attack protection may ask for one: use `enterpriseStart`.
|
|
5274
5283
|
* Its refusals land on the server's error page, not on `redirect_url`. It creates no PKCE pair.
|
|
5275
5284
|
* @throws Error when no app id is set
|
|
5276
5285
|
*/
|
|
@@ -7604,8 +7613,9 @@ export declare class Passflow {
|
|
|
7604
7613
|
/**
|
|
7605
7614
|
* The address of a GET enterprise start, for a plain link or a server-rendered page.
|
|
7606
7615
|
*
|
|
7607
|
-
* Sends no request and emits no event. A `human_only` app refuses this form with 403,
|
|
7608
|
-
*
|
|
7616
|
+
* Sends no request and emits no event. A `human_only` app refuses this form with 403, it cannot
|
|
7617
|
+
* pass a forced challenge when the app's attack protection may ask for one, and every refusal
|
|
7618
|
+
* lands on the server's error page, not on the app. A sign-in button and its picker use
|
|
7609
7619
|
* `enterpriseStart()` or the federated flows with `conn_<connection_id>` instead. No PKCE pair is
|
|
7610
7620
|
* created: on a PKCE app, pass your own `code_challenge` and keep the verifier.
|
|
7611
7621
|
*
|
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
|
/**
|
|
@@ -1826,7 +1826,10 @@ export type AppSettings = {
|
|
|
1826
1826
|
* the browser's own Google sign-in (FedCM) may be used. Absent means it is not available.
|
|
1827
1827
|
*/
|
|
1828
1828
|
google?: AppSettingsGoogle;
|
|
1829
|
-
/**
|
|
1829
|
+
/**
|
|
1830
|
+
* Present when a browser risk provider is on (with its public values) or the app's attack
|
|
1831
|
+
* protection may ask for a challenge; absent otherwise.
|
|
1832
|
+
*/
|
|
1830
1833
|
attack_protection?: AttackProtectionSettings;
|
|
1831
1834
|
};
|
|
1832
1835
|
/** `AppSettings.google`: what the browser's own Google sign-in needs. Every value is public. */
|
|
@@ -1852,6 +1855,8 @@ export type AttackProtectionSettings = {
|
|
|
1852
1855
|
stytch?: {
|
|
1853
1856
|
public_token: string;
|
|
1854
1857
|
};
|
|
1858
|
+
/** true when the app's attack protection may ask for a challenge; federated starts then go out as a POST. */
|
|
1859
|
+
challenge?: boolean;
|
|
1855
1860
|
};
|
|
1856
1861
|
/** `human_only`: every sign-in start must carry an anti-bot value in `X-Passflow-Anti-Bot`. */
|
|
1857
1862
|
export type BotMode = 'bot_friendly' | 'human_only';
|
|
@@ -5254,23 +5259,27 @@ export declare class AuthService {
|
|
|
5254
5259
|
/**
|
|
5255
5260
|
* Whether a federated start goes out as a POST (`AuthAPI.federatedStart`) rather than as a
|
|
5256
5261
|
* navigation to `createFederatedAuthUrl`: on a `human_only` app, whose start must carry the
|
|
5257
|
-
* anti-bot header
|
|
5258
|
-
*
|
|
5262
|
+
* anti-bot header; when the settings carry `attack_protection.challenge: true`, so a forced
|
|
5263
|
+
* challenge can be answered and the start resent; and for an agent tool, whose start must carry
|
|
5264
|
+
* its own header. A header cannot ride a navigation. Unknown or unreadable settings keep the
|
|
5265
|
+
* navigation.
|
|
5259
5266
|
*/
|
|
5260
5267
|
private usesFederatedPost;
|
|
5261
5268
|
/** The body of a POST federated start: the same fields the GET start sends as query parameters. */
|
|
5262
5269
|
private federatedStartBody;
|
|
5263
5270
|
/**
|
|
5264
5271
|
* The GET start URL. A `human_only` app refuses a start by navigation (403
|
|
5265
|
-
* `error.api.anti_bot.required`)
|
|
5266
|
-
*
|
|
5272
|
+
* `error.api.anti_bot.required`), and a navigation cannot pass a forced challenge when the app's
|
|
5273
|
+
* attack protection may ask for one; `federatedAuthWithPopup` and `federatedAuthWithRedirect`
|
|
5274
|
+
* POST the start in both cases instead.
|
|
5267
5275
|
*/
|
|
5268
5276
|
createFederatedAuthUrl(payload: PassflowFederatedAuthExtendedPayload): string;
|
|
5269
5277
|
/** The query of a GET start: the same fields `federatedStartBody` sends in a POST, as strings. */
|
|
5270
5278
|
private federatedStartQuery;
|
|
5271
5279
|
/**
|
|
5272
5280
|
* The GET enterprise start, for a top-level navigation. Sends the device id and every field
|
|
5273
|
-
* `createFederatedAuthUrl` sends. A `human_only` app refuses it (403)
|
|
5281
|
+
* `createFederatedAuthUrl` sends. A `human_only` app refuses it (403), and it cannot pass a
|
|
5282
|
+
* forced challenge when the app's attack protection may ask for one: use `enterpriseStart`.
|
|
5274
5283
|
* Its refusals land on the server's error page, not on `redirect_url`. It creates no PKCE pair.
|
|
5275
5284
|
* @throws Error when no app id is set
|
|
5276
5285
|
*/
|
|
@@ -7604,8 +7613,9 @@ export declare class Passflow {
|
|
|
7604
7613
|
/**
|
|
7605
7614
|
* The address of a GET enterprise start, for a plain link or a server-rendered page.
|
|
7606
7615
|
*
|
|
7607
|
-
* Sends no request and emits no event. A `human_only` app refuses this form with 403,
|
|
7608
|
-
*
|
|
7616
|
+
* Sends no request and emits no event. A `human_only` app refuses this form with 403, it cannot
|
|
7617
|
+
* pass a forced challenge when the app's attack protection may ask for one, and every refusal
|
|
7618
|
+
* lands on the server's error page, not on the app. A sign-in button and its picker use
|
|
7609
7619
|
* `enterpriseStart()` or the federated flows with `conn_<connection_id>` instead. No PKCE pair is
|
|
7610
7620
|
* created: on a PKCE app, pass your own `code_challenge` and keep the verifier.
|
|
7611
7621
|
*
|