@cardonjs/access-tokens 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/README.md +10 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -344,6 +344,16 @@ The fragment keeps the token out of servers, not out of everything else:
344
344
  path from reaching any other site the page links to or loads from. Core's secure headers
345
345
  already set a strict policy for the API itself.
346
346
 
347
+ ## Live updates (WebSockets)
348
+
349
+ A browser cannot send the token on a WebSocket upgrade, and the token never goes in the socket's
350
+ URL. To let a token holder follow its resource live, exchange the token for a one-time ticket of
351
+ `@cardonjs/realtime-do`: a route with `requireAccessToken` calls `issueRoomTicket` (identity
352
+ `{ id: grant.id, kind: "guest" }`, `connectionExpiresAt: grant.expiresAt`), and the client offers
353
+ the ticket with the upgrade. See "Clients without a cookie: tickets" in the `@cardonjs/realtime-do`
354
+ README. Revoking a token does not close a socket that is already open: call that package's
355
+ `disconnect` too.
356
+
347
357
  ## Rate limiting
348
358
 
349
359
  A token cannot be guessed, but every request with one costs a store lookup. Put a rate limit per
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardonjs/access-tokens",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Access tokens for Cardón apps: unguessable, expiring, revocable tokens that grant scoped access to one resource without an account, a header-only Hono middleware, the store interface and an OpenAPI security scheme.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -43,9 +43,9 @@
43
43
  "vitest": "5.1.0",
44
44
  "zod": "4.6.7",
45
45
  "@cardonjs/auth": "0.2.6",
46
- "@cardonjs/config": "0.0.0",
46
+ "@cardonjs/core": "0.5.1",
47
47
  "@cardonjs/testing": "0.6.0",
48
- "@cardonjs/core": "0.5.1"
48
+ "@cardonjs/config": "0.0.0"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsc -p tsconfig.build.json",