@agent-native/dispatch 0.31.11 → 0.31.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/dispatch",
3
- "version": "0.31.11",
3
+ "version": "0.31.12",
4
4
  "description": "Dispatch — workspace control plane for agent-native apps. Vault, integrations, destinations, scheduled jobs, and cross-app delegation, shipped as a single drop-in package.",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -101,7 +101,7 @@
101
101
  "typescript-7": "npm:typescript@^7.0.2",
102
102
  "vite": "8.1.0",
103
103
  "vitest": "^4.1.5",
104
- "@agent-native/core": "0.168.9"
104
+ "@agent-native/core": "0.168.11"
105
105
  },
106
106
  "peerDependencies": {
107
107
  "@agent-native/core": ">=0.8.0",
@@ -76,6 +76,34 @@ describe("assertWorkspaceEmbedSessionCaller", () => {
76
76
  });
77
77
  });
78
78
 
79
+ it("allows a workspace gateway caller when requestOrigin matches forwarded host", async () => {
80
+ server.getRequestContext.mockReturnValue({
81
+ requestOrigin: "http://127.0.0.1:8080",
82
+ });
83
+ await expect(
84
+ assertWorkspaceEmbedSessionCaller(
85
+ new Headers({
86
+ Referer: "http://127.0.0.1:8080/dispatch/apps/calendar",
87
+ "Sec-Fetch-Site": "same-origin",
88
+ }),
89
+ ),
90
+ ).resolves.toBeUndefined();
91
+ });
92
+
93
+ it("rejects when the browser gateway origin does not match requestOrigin", async () => {
94
+ server.getRequestContext.mockReturnValue({
95
+ requestOrigin: "http://127.0.0.1:8092",
96
+ });
97
+ await expect(
98
+ assertWorkspaceEmbedSessionCaller(
99
+ new Headers({
100
+ Referer: "http://127.0.0.1:8080/dispatch/apps/calendar",
101
+ "Sec-Fetch-Site": "same-origin",
102
+ }),
103
+ ),
104
+ ).rejects.toThrow("requested by Dispatch");
105
+ });
106
+
79
107
  it("rejects cross-site and child-app browser callers", async () => {
80
108
  await expect(
81
109
  assertWorkspaceEmbedSessionCaller(