@tinycloud/web-sdk 3.9.0-beta.8 → 3.9.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.
@@ -212,6 +212,8 @@ export declare class TinyCloudWeb {
212
212
  private signOutCount;
213
213
  /** The signer set with `setRuntimePermissionSigner`, with the session it was set for. */
214
214
  private runtimeSigner?;
215
+ /** Set when this instance's session was established through the configured OpenKey client; bound to that session like `runtimeSigner`. */
216
+ private openkeySession?;
215
217
  private signOutInFlight;
216
218
  private persistedRestoreBlocked;
217
219
  private signOutCleanupFailed;
@@ -488,6 +490,19 @@ export declare class TinyCloudWeb {
488
490
  * `requestPermissions` calls this; sign-in and session setup never do.
489
491
  */
490
492
  private runtimeMessageSigner;
493
+ /**
494
+ * Whether the OpenKey client may sign a runtime grant: always, unless there is POSITIVE evidence that it is not connected. It may sign when
495
+ * this instance's session was established through it (and is still the live session), or when its in-memory `lastAuth` is set (`connect()` ran
496
+ * on this client, for example because the app connected it after a restore), or when it exposes no `lastAuth` at all (a client shape this SDK
497
+ * does not know: today's behaviour, fail open). `lastAuth` is read here because nothing public says it: `@openkey/sdk` 0.12.2 declares
498
+ * `lastAuth = null`, sets it in `connect()` and clears it in `signOut()`; 0.9.0 declares it and sets it in `connect()` but has no `signOut`.
499
+ * `getSessionToken()` always answers null in 0.12.2 and `isConnected()` reads the OpenKey cookie, which can be true when `connect()` never ran
500
+ * on this page. web-sdk documents `@openkey/sdk` >= 0.12.2, so 0.12.2 is the lowest version this was checked against. The clean fix is
501
+ * `signMessage()` rejecting when not connected, in `@openkey/sdk`. Trade-off: an app that connects through a DIFFERENT OpenKey instance than
502
+ * `config.openkey.client`, or restores after an authorize-only sign-in, must call `openkey.connect()` on the configured client or
503
+ * `setRuntimePermissionSigner`.
504
+ */
505
+ private openkeyClientMaySign;
491
506
  /**
492
507
  * Sets the signer for runtime permission grants (`requestPermissions`, and the panel's "allow" buttons), or clears
493
508
  * it with no argument. For apps whose sign-in is not the SDK's OpenKey flow, for example a restored session whose
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinycloud/web-sdk",
3
- "version": "3.9.0-beta.8",
3
+ "version": "3.9.0",
4
4
  "description": "A set of tools and utilities to help you build your app with TinyCloud.",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -66,11 +66,11 @@
66
66
  "@multiformats/multiaddr": "^13.0.1",
67
67
  "@multiformats/multiaddr-to-uri": "^12.0.0",
68
68
  "@noble/curves": "^1.9.7",
69
- "@tinycloud/node-sdk": "3.9.0-beta.8",
70
- "@tinycloud/replica": "0.4.1-beta.0",
71
- "@tinycloud/sdk-core": "3.9.0-beta.8",
72
- "@tinycloud/share-envelope": "1.4.1-beta.1",
73
- "@tinycloud/share-sdk": "1.4.2-beta.2",
69
+ "@tinycloud/node-sdk": "3.9.0",
70
+ "@tinycloud/replica": "0.4.1",
71
+ "@tinycloud/sdk-core": "3.9.0",
72
+ "@tinycloud/share-envelope": "1.4.1",
73
+ "@tinycloud/share-sdk": "1.4.2",
74
74
  "@tinycloud/web-sdk-wasm": "1.7.7",
75
75
  "axios": "^1.7.9",
76
76
  "viem": "^2.45.0",