@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/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
- /** The FedCM probe's result, set on the first read of `identityCredentials`. */
688
- private identityProbe?;
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`; undefined otherwise. The probe runs
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
- /** The public values of the browser risk providers the app has on; absent when none is on. */
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, and for an agent tool, whose start must carry its own header. A header cannot
5258
- * ride a navigation. An unknown bot mode keeps the navigation.
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`); `federatedAuthWithPopup` and `federatedAuthWithRedirect` POST
5266
- * the start there instead.
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): use `enterpriseStart`.
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, and every
7608
- * refusal lands on the server's error page, not on the app. A sign-in button and its picker use
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
- /** The FedCM probe's result, set on the first read of `identityCredentials`. */
688
- private identityProbe?;
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`; undefined otherwise. The probe runs
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
- /** The public values of the browser risk providers the app has on; absent when none is on. */
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, and for an agent tool, whose start must carry its own header. A header cannot
5258
- * ride a navigation. An unknown bot mode keeps the navigation.
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`); `federatedAuthWithPopup` and `federatedAuthWithRedirect` POST
5266
- * the start there instead.
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): use `enterpriseStart`.
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, and every
7608
- * refusal lands on the server's error page, not on the app. A sign-in button and its picker use
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
  *