@bounded-sh/server 0.0.56 → 0.0.57

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.
@@ -0,0 +1 @@
1
+ export declare function stripCallerAuthHeaders(headers?: Record<string, string>): Record<string, string> | undefined;
@@ -19,11 +19,12 @@ export declare class WalletClient {
19
19
  };
20
20
  constructor(provider: AuthProvider, sessionManager: ServerSessionManager, address: string, evmTransactionPolicy?: EvmTransactionPolicy);
21
21
  private buildOverrides;
22
- /** Strip Authorization from caller headers to prevent overriding wallet token */
22
+ /** #023: strip caller Authorization (any casing) so operations run as the isolated wallet. */
23
23
  private sanitizeHeaders;
24
24
  private mergeSetOverrides;
25
25
  private mergeReadOverrides;
26
26
  private mergeLiveIntentOptions;
27
+ private mergeLiveStatusOptions;
27
28
  set(path: string, document: any, options?: SetOptions): Promise<any>;
28
29
  setMany(many: {
29
30
  path: string;
@@ -58,8 +58,23 @@ export interface VerifyWebhookOptions {
58
58
  * Expected Bounded app id for this receiver. When set, a validly signed
59
59
  * webhook for another app is rejected instead of relying on every caller to
60
60
  * compare `payload.appId` manually.
61
+ *
62
+ * #072: when this is OMITTED, verifyWebhook now binds to the SDK's init()-time
63
+ * app id by DEFAULT (secure-by-default). Because Bounded signs every app's
64
+ * webhooks with one shared platform key, a valid signature only proves "from
65
+ * Bounded", not "from YOUR app" - so a bind is required to stop cross-app
66
+ * forgery. If no app id can be resolved (this option unset AND no init()-time
67
+ * app id), verifyWebhook FAILS CLOSED. Multi-app receivers must set
68
+ * {@link allowAnyAppId} to accept any app deliberately.
61
69
  */
62
70
  expectedAppId?: string;
71
+ /**
72
+ * Opt out of the app binding to accept a validly-signed webhook from ANY app
73
+ * (the rare multi-app receiver). #072: this MUST be set explicitly - the safe
74
+ * default binds to the SDK's app id. Ignored when {@link expectedAppId} is set
75
+ * (an explicit expected id always enforces a match).
76
+ */
77
+ allowAnyAppId?: boolean;
63
78
  /**
64
79
  * Replay store. By default, verifyWebhook uses a process-local in-memory
65
80
  * store and rejects exact signed-delivery replays within the skew window.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bounded-sh/server",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "description": "Node and server SDK for Bounded, the full-stack app builder and runtime for AI-built apps: keypair-authenticated data, files and search, functions, realtime, webhook verification, and atomic writes.",
5
5
  "homepage": "https://bounded.sh/docs/sdk",
6
6
  "main": "./dist/index.js",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "scripts": {
17
17
  "build": "rm -rf ./dist ./.rollup-tmp && tsc -p tsconfig.build.json --outDir .rollup-tmp --declarationDir .rollup-tmp --emitDeclarationOnly false && rollup -c && tsc -p tsconfig.build.json --emitDeclarationOnly --declarationDir dist && rm -rf ./.rollup-tmp",
18
- "test": "node src/auth/providers/run-solana-keypair-blockhash-test.mjs && node src/auth/providers/evm-keypair-provider.source.test.mjs && node src/run-server-global-provider-test.mjs",
18
+ "test": "node src/auth/providers/run-solana-keypair-blockhash-test.mjs && node src/auth/providers/evm-keypair-provider.source.test.mjs && node src/run-server-global-provider-test.mjs && node --test src/webhooks.test.mjs",
19
19
  "watch": "rollup -c -w",
20
20
  "prepare": "npm run build"
21
21
  },
@@ -44,13 +44,14 @@
44
44
  "@rollup/plugin-commonjs": "28.0.9",
45
45
  "@rollup/plugin-json": "6.1.0",
46
46
  "@rollup/plugin-node-resolve": "15.3.1",
47
+ "esbuild": "0.23.1",
47
48
  "rollup": "4.60.1",
48
49
  "rollup-plugin-peer-deps-external": "2.2.4",
49
50
  "rollup-plugin-typescript2": "0.36.0",
50
51
  "typescript": "5.9.3"
51
52
  },
52
53
  "dependencies": {
53
- "@bounded-sh/core": "0.0.56",
54
+ "@bounded-sh/core": "0.0.57",
54
55
  "@coral-xyz/anchor": "0.31.1",
55
56
  "@solana/web3.js": "1.98.4",
56
57
  "axios": "1.18.1",