@idp.global/interfaces 30.5.0 → 30.6.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/changelog.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-11-13 - 30.6.0
4
+
5
+ ### Features
6
+
7
+ - an upstream flow's finish is bound to the browser that returned from the provider (request; AGL-1801)
8
+ - `IReq_FinishUpstreamSignIn` requires `returnProof`: the one-time value that only the provider callback's
9
+ redirect carries, in the URL fragment (`<login>/login?upstream=<id>#returnProof=<proof>`). The verifier binds
10
+ finish to the browser that started the flow, the return proof to the browser that returned from the provider.
11
+ A finish that lacks the right verifier or the right return proof is refused without a code and leaves the
12
+ flow unchanged.
13
+ - A caller written against 30.5.0 does not compile until it sends `returnProof`. No released server ever
14
+ answered this request.
15
+ - `IReq_ConfirmUpstreamIdentityLink` is unchanged: a flow answers `linkRequired` only to a finish that held
16
+ both values.
17
+
3
18
  ## 2026-11-13 - 30.5.0
4
19
 
5
20
  ### Features
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@idp.global/interfaces',
6
- version: '30.5.0',
6
+ version: '30.6.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHVGQUF1RjtDQUNyRyxDQUFBIn0=
@@ -18,8 +18,8 @@ export type TUpstreamSignInPurpose = (typeof upstreamSignInPurposes)[number];
18
18
  * Why an upstream sign-in, link or unlink was refused. A refused request throws a
19
19
  * `TypedResponseError` whose `errorData` is `IUpstreamIdentityRefusal`. The authentication-change
20
20
  * gate refuses with its own `IAuthenticationChangeRefusal`, whose codes differ from these; any
21
- * other failure (an expired or spent flow, a wrong verifier, an unavailable provider) carries
22
- * no code.
21
+ * other failure (an expired or spent flow, a wrong verifier or return proof, an unavailable
22
+ * provider) carries no code.
23
23
  * - `sso_domain_required`: the email of the account concerned is under a verified SSO domain;
24
24
  * sign in through its organization's single sign-on. At finish on a sign-in flow that is the
25
25
  * vouched email of an identity not linked yet, or the account's email for a linked identity;
@@ -28,6 +28,8 @@ export type TStartUpstreamSignInRequest = {
28
28
  * minutes; the purpose never changes. `id` names that record and is the OAuth `state` inside
29
29
  * `authorizationUrl`. The provider returns to the issuer's callback, which always redirects the
30
30
  * browser to `<login>/login?upstream=<id>` (plus `&tx=<oidcTransactionId>` when one was given).
31
+ * When the callback accepted the provider's answer, that redirect also carries a one-time return
32
+ * proof in its fragment: `<login>/login?upstream=<id>#returnProof=<proof>`.
31
33
  *
32
34
  * A sign-in flow starts on the login page, optionally with an OIDC authorization transaction.
33
35
  * A link flow starts when the account UI's "Link" navigates to `<login>/login?link=<provider>`;
@@ -61,14 +63,18 @@ export interface IUpstreamSignInLinkRequired {
61
63
  }
62
64
  /**
63
65
  * Public: finishes an upstream flow after the provider returned. The page at
64
- * `<login>/login?upstream=<id>` calls it when it holds a verifier for that `id`, and calls
65
- * nothing otherwise; it never needs to know the flow's purpose. It answers once per flow.
66
+ * `<login>/login?upstream=<id>` calls it when it holds both a verifier for that `id` and the
67
+ * return proof from its URL fragment, and calls nothing otherwise; it never needs to know the
68
+ * flow's purpose. The verifier binds finish to the browser that started the flow, the return
69
+ * proof to the browser that returned from the provider. It answers once per flow. A finish that
70
+ * lacks the right verifier or the right return proof is refused without a code and leaves the
71
+ * flow unchanged.
66
72
  *
67
73
  * On a sign-in flow it answers like password sign-in: a refresh token, or an MFA challenge to
68
74
  * answer through `verifyMfaChallenge` or the passkey MFA requests. Either answer ends the flow.
69
75
  * `linkRequired` is the third outcome. Refusal codes (`data.IUpstreamIdentityRefusal`), in
70
76
  * this order: `provider_email_unverified`, then `sso_domain_required`. A refusal with a code
71
- * ends the flow; only a wrong verifier leaves the flow usable.
77
+ * ends the flow.
72
78
  *
73
79
  * On a link flow it never mints a session, never creates an account and looks up no account
74
80
  * and no link: it answers `linkRequired` when the provider vouched for the email, whatever
@@ -81,6 +87,12 @@ export interface IReq_FinishUpstreamSignIn extends plugins.typedRequestInterface
81
87
  id: string;
82
88
  /** The verifier whose hash `startUpstreamSignIn` received. */
83
89
  verifier: string;
90
+ /**
91
+ * The one-time return proof that only the provider callback's redirect carries, in the URL
92
+ * fragment (`#returnProof=<proof>`). It binds finish to the browser that returned from the
93
+ * provider, as the verifier binds it to the browser that started the flow.
94
+ */
95
+ returnProof: string;
84
96
  };
85
97
  response: IReq_LoginWithEmailOrUsernameAndPassword['response'] & {
86
98
  linkRequired?: IUpstreamSignInLinkRequired;
@@ -90,10 +102,12 @@ export interface IReq_FinishUpstreamSignIn extends plugins.typedRequestInterface
90
102
  * Links the provider identity of a flow whose `finishUpstreamSignIn` answered `linkRequired`;
91
103
  * any other flow fails without a code. The link stores the provider's vouched email and
92
104
  * private-relay flag as the flow recorded them. It links to the signed-in account and carries
93
- * the flow's `id` and `verifier`. One confirmation screen on the login origin serves sign-in
94
- * and link flows alike. It always asks for a new sign-in to the account, whatever session the
95
- * browser holds, then names the provider, the provider's email and the signed-in account; only
96
- * the person's explicit confirmation sends this request, never a URL on its own.
105
+ * the flow's `id` and `verifier`; no return proof is needed, because a flow answers
106
+ * `linkRequired` only to a finish that held both the verifier and the return proof. One
107
+ * confirmation screen on the login origin serves sign-in and link flows alike. It always asks
108
+ * for a new sign-in to the account, whatever session the browser holds, then names the
109
+ * provider, the provider's email and the signed-in account; only the person's explicit
110
+ * confirmation sends this request, never a URL on its own.
97
111
  *
98
112
  * An authentication change: it needs the account's strongest enrolled proof, fresh (a fresh
99
113
  * passkey sign-in while the account has an active passkey, otherwise a fresh primary sign-in);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idp.global/interfaces",
3
- "version": "30.5.0",
3
+ "version": "30.6.0",
4
4
  "private": false,
5
5
  "description": "Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.",
6
6
  "exports": {
package/readme.md CHANGED
@@ -213,7 +213,8 @@ itself. The hint never skips a step of the sign-in, and a value that names no
213
213
  offered provider is ignored.
214
214
 
215
215
  Upstream sign-in (Apple, Google) binds the redirect flow to the browser that
216
- started it, and everything runs on the login origin. `IReq_StartUpstreamSignIn`
216
+ started it and to the browser that returned from the provider, and everything
217
+ runs on the login origin. `IReq_StartUpstreamSignIn`
217
218
  takes the provider, the S256 hash of a verifier the login page keeps in its
218
219
  sessionStorage, and a `purpose` (`data.upstreamSignInPurposes`: `sign-in`, the
219
220
  default, or `link`); only a sign-in flow may carry the opaque OIDC transaction,
@@ -224,10 +225,15 @@ records the purpose on the flow and never changes it, so a sign-in flow that
224
225
  answered `linkRequired` stays a sign-in flow. The account UI's "Link"
225
226
  navigates to `<login>/login?link=<provider>`, which starts a link flow. The
226
227
  provider's callback always returns to `<login>/login?upstream=<id>` (plus `tx`
227
- when one was given); that page sends `IReq_FinishUpstreamSignIn` with
228
- `{ id, verifier }` once when it holds a verifier for the id, and nothing
229
- otherwise. On a sign-in flow finish answers like password sign-in (a refresh
230
- token or an MFA challenge, which end the flow), or with `linkRequired`
228
+ when one was given); when it accepted the provider's answer, that redirect also
229
+ carries a one-time return proof in its fragment
230
+ (`<login>/login?upstream=<id>#returnProof=<proof>`). That page sends
231
+ `IReq_FinishUpstreamSignIn` with `{ id, verifier, returnProof }` once when it
232
+ holds both a verifier for the id and the return proof, and nothing otherwise.
233
+ The verifier binds finish to the browser that started the flow, the return
234
+ proof to the browser that returned from the provider. On a sign-in flow finish
235
+ answers like password sign-in (a refresh token or an MFA challenge, which end
236
+ the flow), or with `linkRequired`
231
237
  (provider and vouched email) when the email the provider vouched for names an
232
238
  existing account that is not linked yet. On a link flow it never mints a
233
239
  session, never creates an account and looks up no account and no link: it
@@ -238,11 +244,14 @@ signed token carries one and says it is verified; otherwise finish refuses with
238
244
  linked yet, before any account lookup, and on a link flow for every identity,
239
245
  before any lookup. On a sign-in flow `sso_domain_required` follows; it judges
240
246
  the vouched email of an identity not linked yet, or the account's email for a
241
- linked identity. A finish refused with a code ends the flow; only a wrong
242
- verifier leaves it usable. `linkRequired` mints nothing and leaves the flow
247
+ linked identity. A finish refused with a code ends the flow; a finish that
248
+ lacks the right verifier or the right return proof is refused without a code
249
+ and leaves the flow unchanged. `linkRequired` mints nothing and leaves the flow
243
250
  open until its ten-minute expiry for `IReq_ConfirmUpstreamIdentityLink` with
244
251
  the same `id` and verifier, which the person sends after a new sign-in to the
245
- account on the login origin and an explicit confirmation. Confirm accepts only
252
+ account on the login origin and an explicit confirmation; confirm needs no
253
+ return proof, because a flow answers `linkRequired` only to a finish that held
254
+ both the verifier and the return proof. Confirm accepts only
246
255
  a flow whose finish answered `linkRequired` (any other flow fails without a
247
256
  code) and stores the provider's vouched email and private-relay flag as the
248
257
  flow recorded them. It refuses with `sso_domain_required` (judging the
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@idp.global/interfaces',
6
- version: '30.5.0',
6
+ version: '30.6.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.'
8
8
  }
@@ -22,8 +22,8 @@ export type TUpstreamSignInPurpose = (typeof upstreamSignInPurposes)[number];
22
22
  * Why an upstream sign-in, link or unlink was refused. A refused request throws a
23
23
  * `TypedResponseError` whose `errorData` is `IUpstreamIdentityRefusal`. The authentication-change
24
24
  * gate refuses with its own `IAuthenticationChangeRefusal`, whose codes differ from these; any
25
- * other failure (an expired or spent flow, a wrong verifier, an unavailable provider) carries
26
- * no code.
25
+ * other failure (an expired or spent flow, a wrong verifier or return proof, an unavailable
26
+ * provider) carries no code.
27
27
  * - `sso_domain_required`: the email of the account concerned is under a verified SSO domain;
28
28
  * sign in through its organization's single sign-on. At finish on a sign-in flow that is the
29
29
  * vouched email of an identity not linked yet, or the account's email for a linked identity;
@@ -33,6 +33,8 @@ export type TStartUpstreamSignInRequest = {
33
33
  * minutes; the purpose never changes. `id` names that record and is the OAuth `state` inside
34
34
  * `authorizationUrl`. The provider returns to the issuer's callback, which always redirects the
35
35
  * browser to `<login>/login?upstream=<id>` (plus `&tx=<oidcTransactionId>` when one was given).
36
+ * When the callback accepted the provider's answer, that redirect also carries a one-time return
37
+ * proof in its fragment: `<login>/login?upstream=<id>#returnProof=<proof>`.
36
38
  *
37
39
  * A sign-in flow starts on the login page, optionally with an OIDC authorization transaction.
38
40
  * A link flow starts when the account UI's "Link" navigates to `<login>/login?link=<provider>`;
@@ -72,14 +74,18 @@ export interface IUpstreamSignInLinkRequired {
72
74
 
73
75
  /**
74
76
  * Public: finishes an upstream flow after the provider returned. The page at
75
- * `<login>/login?upstream=<id>` calls it when it holds a verifier for that `id`, and calls
76
- * nothing otherwise; it never needs to know the flow's purpose. It answers once per flow.
77
+ * `<login>/login?upstream=<id>` calls it when it holds both a verifier for that `id` and the
78
+ * return proof from its URL fragment, and calls nothing otherwise; it never needs to know the
79
+ * flow's purpose. The verifier binds finish to the browser that started the flow, the return
80
+ * proof to the browser that returned from the provider. It answers once per flow. A finish that
81
+ * lacks the right verifier or the right return proof is refused without a code and leaves the
82
+ * flow unchanged.
77
83
  *
78
84
  * On a sign-in flow it answers like password sign-in: a refresh token, or an MFA challenge to
79
85
  * answer through `verifyMfaChallenge` or the passkey MFA requests. Either answer ends the flow.
80
86
  * `linkRequired` is the third outcome. Refusal codes (`data.IUpstreamIdentityRefusal`), in
81
87
  * this order: `provider_email_unverified`, then `sso_domain_required`. A refusal with a code
82
- * ends the flow; only a wrong verifier leaves the flow usable.
88
+ * ends the flow.
83
89
  *
84
90
  * On a link flow it never mints a session, never creates an account and looks up no account
85
91
  * and no link: it answers `linkRequired` when the provider vouched for the email, whatever
@@ -96,6 +102,12 @@ export interface IReq_FinishUpstreamSignIn
96
102
  id: string;
97
103
  /** The verifier whose hash `startUpstreamSignIn` received. */
98
104
  verifier: string;
105
+ /**
106
+ * The one-time return proof that only the provider callback's redirect carries, in the URL
107
+ * fragment (`#returnProof=<proof>`). It binds finish to the browser that returned from the
108
+ * provider, as the verifier binds it to the browser that started the flow.
109
+ */
110
+ returnProof: string;
99
111
  };
100
112
  response: IReq_LoginWithEmailOrUsernameAndPassword['response'] & {
101
113
  linkRequired?: IUpstreamSignInLinkRequired;
@@ -106,10 +118,12 @@ export interface IReq_FinishUpstreamSignIn
106
118
  * Links the provider identity of a flow whose `finishUpstreamSignIn` answered `linkRequired`;
107
119
  * any other flow fails without a code. The link stores the provider's vouched email and
108
120
  * private-relay flag as the flow recorded them. It links to the signed-in account and carries
109
- * the flow's `id` and `verifier`. One confirmation screen on the login origin serves sign-in
110
- * and link flows alike. It always asks for a new sign-in to the account, whatever session the
111
- * browser holds, then names the provider, the provider's email and the signed-in account; only
112
- * the person's explicit confirmation sends this request, never a URL on its own.
121
+ * the flow's `id` and `verifier`; no return proof is needed, because a flow answers
122
+ * `linkRequired` only to a finish that held both the verifier and the return proof. One
123
+ * confirmation screen on the login origin serves sign-in and link flows alike. It always asks
124
+ * for a new sign-in to the account, whatever session the browser holds, then names the
125
+ * provider, the provider's email and the signed-in account; only the person's explicit
126
+ * confirmation sends this request, never a URL on its own.
113
127
  *
114
128
  * An authentication change: it needs the account's strongest enrolled proof, fresh (a fresh
115
129
  * passkey sign-in while the account has an active passkey, otherwise a fresh primary sign-in);