@atol-sh/js 0.4.0 → 0.4.2
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 +30 -0
- package/README.md +28 -2
- package/RESPONSE_VAULT_PROTOCOL.md +23 -3
- package/dist/index.cjs +300 -173
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -53
- package/dist/index.d.ts +63 -53
- package/dist/index.js +299 -174
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.4.2] - 2026-11-23
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `selectOrganization(null)` requests and verifies an unscoped credential
|
|
14
|
+
pair for the current subject on the existing browser auth client.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Ordinary browser authorization reports a typed intent conflict when a
|
|
19
|
+
different sign-in is still pending in the tab. The error distinguishes a
|
|
20
|
+
silent request from an interactive one without exposing authorization data.
|
|
21
|
+
- `cancelLogin()` can abandon an ordinary sign-in after exact authenticated
|
|
22
|
+
settlement. A lost initial PAR challenge is recovered and bound before the
|
|
23
|
+
SDK sends cancellation. Changing sign-in options never cancels implicitly.
|
|
24
|
+
- Response-vault login and renewal can release expired interactive sign-in
|
|
25
|
+
custody left by another tab of the same active browser session. Recovery
|
|
26
|
+
uses authenticated terminal proof for the exact bootstrap, a possibly
|
|
27
|
+
committed PAR, or the bound transaction.
|
|
28
|
+
|
|
29
|
+
## [0.4.1] - 2026-11-22
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- RP-initiated logout no longer sends the authorization-only `audience` query
|
|
34
|
+
parameter. Audience-configured clients can sign out through Atol's strict
|
|
35
|
+
OIDC logout endpoint.
|
|
36
|
+
|
|
37
|
+
## [0.4.0] - 2026-10-26
|
|
38
|
+
|
|
9
39
|
### Added
|
|
10
40
|
|
|
11
41
|
- `AtolBrowserAuth.canRestartLogin()` exposes a read-only capability for UI
|
package/README.md
CHANGED
|
@@ -124,7 +124,10 @@ freshness check and renews immediately; `stepUp()` forces re-authentication
|
|
|
124
124
|
(`prompt=login`, `max_age=0`, `acr_values=mfa` by default) for a sensitive
|
|
125
125
|
operation that requires a fresh auth; `selectOrganization(id)` starts a
|
|
126
126
|
distinct silent organization grant and exposes the selected ID on
|
|
127
|
-
`AtolSession.organizationId
|
|
127
|
+
`AtolSession.organizationId`. Pass `null` to request an unscoped grant for
|
|
128
|
+
the same authenticated subject on the existing client. Both tokens must
|
|
129
|
+
verify with the requested scope before the SDK replaces the previous pair.
|
|
130
|
+
`restartLogin()` explicitly settles the exact
|
|
128
131
|
response-vault authorization that made signed-out initialization fail, then
|
|
129
132
|
starts one fresh login; `canRestartLogin()` reports whether this runtime holds
|
|
130
133
|
the hidden exact authority required for that operation;
|
|
@@ -198,6 +201,17 @@ This is a security library first. Key properties:
|
|
|
198
201
|
not use hidden CORS response headers as authority. Missing, unexposed,
|
|
199
202
|
repeated, or unequal signals retain or settle custody and never authorize
|
|
200
203
|
navigation or cleanup.
|
|
204
|
+
- **Pending ordinary sign-in.** A failed request can leave resumable
|
|
205
|
+
authorization in that browser tab. `OrdinaryAuthorizationPendingError`
|
|
206
|
+
indicates that the outcome is uncertain. For an interrupted login start,
|
|
207
|
+
retry with the same `beginLogin()` options. If a different sign-in is still
|
|
208
|
+
pending, the SDK throws `OrdinaryAuthorizationIntentConflictError` with
|
|
209
|
+
`pendingMode` set to `silent` or `interactive`. Let the user explicitly
|
|
210
|
+
start over by calling `cancelLogin()` on an uninitialized client in the
|
|
211
|
+
same tab, then call `beginLogin()` with the new options after cancellation
|
|
212
|
+
succeeds. Keep any pending callback URL available for SDK recovery until
|
|
213
|
+
the authorization settles. To start a separate sign-in, open the app in
|
|
214
|
+
a new browser tab without copying the previous tab's session state.
|
|
201
215
|
- **Response vault.** A response-vault client stores a bounded authorization
|
|
202
216
|
transaction and non-extractable key handle in IndexedDB, with
|
|
203
217
|
only an opaque same-tab reference in `sessionStorage`. One durable
|
|
@@ -279,7 +293,12 @@ This is a security library first. Key properties:
|
|
|
279
293
|
therefore awaits an earlier queued cancellation; later cancellation
|
|
280
294
|
requests are unavailable until logout finishes. Destroy cleanup is re-armed
|
|
281
295
|
only after a later explicit login successfully establishes new interactive
|
|
282
|
-
custody.
|
|
296
|
+
custody. An initialized client with an active session rejects cancellation.
|
|
297
|
+
For ordinary browser authorization, `cancelLogin()` requires an
|
|
298
|
+
uninitialized client and the exact current tab generation. If a request
|
|
299
|
+
was submitted, the SDK requires the issuer's authenticated cancellation
|
|
300
|
+
before permitting a different sign-in. A lost initial challenge is
|
|
301
|
+
recovered with the original capability-free request before cancellation.
|
|
283
302
|
- **Explicit closed-tab restart.** If `init()` rejects while a signed-out
|
|
284
303
|
replacement tab finds response-vault custody abandoned by a closed tab,
|
|
285
304
|
ordinary `cancelLogin()` remains same-tab scoped and returns a busy error
|
|
@@ -295,6 +314,13 @@ This is a security library first. Key properties:
|
|
|
295
314
|
`canRestartLogin()` is the read-only UI capability check; generic startup,
|
|
296
315
|
callback, logout, successful initialization, and destroyed states return
|
|
297
316
|
`false` and are never promoted into restart authority.
|
|
317
|
+
- **Expired verification left by another tab.** Response-vault login and
|
|
318
|
+
renewal can release an expired interactive sign-in from another tab within
|
|
319
|
+
the same client binding and active logout generation. The SDK holds the
|
|
320
|
+
authorization Web Lock and releases the exact local slot only after the
|
|
321
|
+
issuer authenticates terminal state for its bootstrap or transaction. Lost
|
|
322
|
+
PAR responses require the server to check for the linked transaction. Live
|
|
323
|
+
or uncertain results keep the pending authorization in custody.
|
|
298
324
|
|
|
299
325
|
Found a vulnerability? See [SECURITY.md](./SECURITY.md) for how to report
|
|
300
326
|
it privately.
|
|
@@ -211,9 +211,9 @@ client-origin endpoint accepts:
|
|
|
211
211
|
}
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
`mode` is
|
|
215
|
-
persisted capabilities
|
|
216
|
-
cookie from an earlier exact attempt.
|
|
214
|
+
`mode` is `create`, `terminal_only`, or `par_terminal_only`. Each reuses the
|
|
215
|
+
same persisted capabilities and sends no CSRF header. `create` and
|
|
216
|
+
`terminal_only` may carry the HttpOnly cookie from an earlier exact attempt.
|
|
217
217
|
|
|
218
218
|
`create` success is `201`:
|
|
219
219
|
|
|
@@ -243,6 +243,14 @@ resurrect that attempt. Only an authenticated exact 410 permits local
|
|
|
243
243
|
deletion. An exact 409, a generic error, a malformed response, or an
|
|
244
244
|
unauthenticated 410 preserves prepared custody.
|
|
245
245
|
|
|
246
|
+
`par_terminal_only` also proves the status of a possibly committed PAR after
|
|
247
|
+
its response was lost. It authenticates the signed attempt capability and
|
|
248
|
+
exact bootstrap binding without needing the expired browser cookie. It
|
|
249
|
+
returns 409 while a linked transaction remains live and 410 only after the
|
|
250
|
+
bootstrap and any linked transaction are terminal. An old server can reject
|
|
251
|
+
this mode without releasing custody. The SDK does not fall back to the
|
|
252
|
+
bootstrap-only proof for `par_pending`.
|
|
253
|
+
|
|
246
254
|
The issuer bootstrap endpoint remains separate and accepts only:
|
|
247
255
|
|
|
248
256
|
```json
|
|
@@ -624,6 +632,18 @@ Long-running external login or MFA therefore does not depend on renewing a
|
|
|
624
632
|
short execution lease, and another live SDK instance reports busy rather than
|
|
625
633
|
rejecting peer authority.
|
|
626
634
|
|
|
635
|
+
An expired interactive authorization can be recovered by a different tab
|
|
636
|
+
under the same exact binding and live logout generation. The SDK holds the
|
|
637
|
+
authorization Web Lock and validates the active slot and durable revision
|
|
638
|
+
before the terminal probe and again before deletion. `prepared` uses the
|
|
639
|
+
exact bootstrap's `terminal_only` probe. Without a persisted attempt
|
|
640
|
+
capability, `prepared` can only have sent the capability-free bootstrap
|
|
641
|
+
challenge. Recovery first obtains that challenge, then uses its signed
|
|
642
|
+
capability for `terminal_only`. `par_pending` uses `par_terminal_only` to
|
|
643
|
+
check for a linked transaction. Once PAR is durably bound, the issuer
|
|
644
|
+
transaction is probed with its own signed terminal authority. The SDK clears
|
|
645
|
+
neither live nor uncertain state and never acquires a peer grant.
|
|
646
|
+
|
|
627
647
|
Two independent, random 32-byte generations fence asynchronous work:
|
|
628
648
|
|
|
629
649
|
- the credential-authority generation is origin-wide for an exact issuer,
|