@auth-craft/backend-sdk 0.19.0 → 0.20.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 CHANGED
@@ -244,7 +244,17 @@ who they are (sign-in or step-up) under `maxAgeSec` ago (default 30 days, 60 sec
244
244
  days). Only for an origin the platform controls, with no third-party script: a kept session
245
245
  issues that client a code whenever it is used. A session the client got this way ends when
246
246
  the kept one does (logout, expiry). A malformed `session` refuses the answer; a server older
247
- than it drops `session` and spends the sign-in session as before. Anything but a well-formed 200 within 3 seconds (a
247
+ than it drops `session` and spends the sign-in session as before.
248
+
249
+ Add `silent: true` to `session` (only with `keep`) to let pages on the client's origin get
250
+ that code without the user clicking (`POST /auth/oauth2/silent-authorize` on the account
251
+ origin, same site only, through `silentSignIn()` of `@auth-craft/client`): a customer signed
252
+ in on the account page is signed in on the shop as soon as it loads. Any script on the
253
+ client's origin, including a merchant's, can then hold the client's narrow session (`profile`)
254
+ for every customer signed in on the account page. Send it only when everything the client
255
+ reads with that session is scoped to the client (a shop reads its own address book, not the
256
+ customer's addresses at every shop). A server older than `silent` refuses the whole answer:
257
+ upgrade the server first. Anything but a well-formed 200 within 3 seconds (a
248
258
  redirect, over 16 KB, another shape) refuses: new sign-ins through a provider or another
249
259
  origin stop, existing sessions keep refreshing. Answers are reused for 60 seconds, a `null`
250
260
  for 10. Neither questions nor answers are logged.
@@ -357,6 +367,12 @@ await client.updateTenantMemberPermission({
357
367
 
358
368
  ## Changelog
359
369
 
370
+ ### 0.20.0
371
+
372
+ Additive; requires `@auth-craft/api-contract` 0.12.0 (installed with it).
373
+
374
+ - `auth-client` answers may carry `session.silent: true` (with `keep`): pages on the client's origin get a code from the kept session without a click. Needs server-postgres 3.6.0, aws-cf-stack 2.7.0 or worker-d1-stack 0.7.0; an older server refuses the whole answer, so upgrade the server before the hook sends it.
375
+
360
376
  ### 0.19.0
361
377
 
362
378
  Additive; requires `@auth-craft/api-contract` 0.11.0 (installed with it). Needs
@@ -16,7 +16,7 @@
16
16
  * server that does not list it would drop `trust` and trust that client like its own:
17
17
  * answer `null` (provider off) instead.
18
18
  *
19
- * An auth-client answer may carry `session: { keep: true, maxAgeSec? }` for a sign-in origin
19
+ * An auth-client answer may carry `session: { keep: true, maxAgeSec?, silent? }` for a sign-in origin
20
20
  * the platform controls: the sign-in session outlives the code (README, "Answering the auth
21
21
  * server's questions").
22
22
  */
@@ -16,7 +16,7 @@
16
16
  * server that does not list it would drop `trust` and trust that client like its own:
17
17
  * answer `null` (provider off) instead.
18
18
  *
19
- * An auth-client answer may carry `session: { keep: true, maxAgeSec? }` for a sign-in origin
19
+ * An auth-client answer may carry `session: { keep: true, maxAgeSec?, silent? }` for a sign-in origin
20
20
  * the platform controls: the sign-in session outlives the code (README, "Answering the auth
21
21
  * server's questions").
22
22
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auth-craft/backend-sdk",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "Type-safe internal service SDK for Auth-Craft service-to-service calls",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "ts-micro-result": "^3.3.0",
15
15
  "valibot": "^1.5.0",
16
- "@auth-craft/api-contract": "^0.11.0"
16
+ "@auth-craft/api-contract": "^0.12.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "typescript": "^7.0.2",