@mycadet/gateway 0.12.7 → 0.12.8
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 +3 -3
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/{platform-credential.ts → cloud-credential.ts} +9 -9
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/handles.ts +3 -3
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/index.ts +1 -1
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/ingress.ts +11 -5
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +1 -1
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/rpc.ts +14 -14
- package/node_modules/@mycadet/ces-client/node_modules/@mycadet/service-contracts/src/trust-rules.ts +5 -5
- package/node_modules/@mycadet/ces-client/src/rpc-client.ts +1 -1
- package/node_modules/@mycadet/environments/src/seeds.ts +6 -6
- package/node_modules/@mycadet/environments/src/shell.test.ts +1 -1
- package/node_modules/@mycadet/environments/src/types.ts +6 -6
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/{platform-credential.ts → cloud-credential.ts} +9 -9
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/handles.ts +3 -3
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/index.ts +1 -1
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/ingress.ts +11 -5
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +1 -1
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/rpc.ts +14 -14
- package/node_modules/@mycadet/gateway-client/node_modules/@mycadet/service-contracts/src/trust-rules.ts +5 -5
- package/node_modules/@mycadet/gateway-client/src/binding-strength-contract.ts +5 -5
- package/node_modules/@mycadet/gateway-client/src/gateway-ipc-contracts.ts +1 -1
- package/node_modules/@mycadet/gateway-client/src/inbound-contract.ts +2 -2
- package/node_modules/@mycadet/gateway-client/src/outbound-contract.ts +1 -1
- package/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/service-contracts/src/{platform-credential.ts → cloud-credential.ts} +9 -9
- package/node_modules/@mycadet/service-contracts/src/handles.ts +3 -3
- package/node_modules/@mycadet/service-contracts/src/index.ts +1 -1
- package/node_modules/@mycadet/service-contracts/src/ingress.ts +11 -5
- package/node_modules/@mycadet/service-contracts/src/remote-web-pairing.ts +1 -1
- package/node_modules/@mycadet/service-contracts/src/rpc.ts +14 -14
- package/node_modules/@mycadet/service-contracts/src/trust-rules.ts +5 -5
- package/package.json +1 -1
- package/src/__tests__/actor-token-revocation.test.ts +0 -1
- package/src/__tests__/{backup-worker-platform-mode.test.ts → backup-worker-cloud-mode.test.ts} +4 -4
- package/src/__tests__/channel-verification-session-proxy.test.ts +0 -1
- package/src/__tests__/{platform-identity.test.ts → cloud-identity.test.ts} +72 -86
- package/src/__tests__/config.test.ts +0 -24
- package/src/__tests__/contacts-control-plane-proxy.test.ts +0 -1
- package/src/__tests__/credential-requests.test.ts +6 -6
- package/src/__tests__/{credential-watcher-managed-bootstrap.test.ts → credential-watcher-cloud-bootstrap.test.ts} +1 -1
- package/src/__tests__/edge-auth.test.ts +18 -18
- package/src/__tests__/edge-guardian-auth.test.ts +10 -10
- package/src/__tests__/guardian-init-lockfile.test.ts +6 -8
- package/src/__tests__/guardian-pin.test.ts +8 -8
- package/src/__tests__/handle-inbound-admission.test.ts +0 -1
- package/src/__tests__/handle-inbound-app-context.test.ts +0 -1
- package/src/__tests__/handle-inbound-invite-intercept.test.ts +0 -1
- package/src/__tests__/handle-inbound-trust-verdict.test.ts +0 -1
- package/src/__tests__/inbound-contact-seed.test.ts +1 -1
- package/src/__tests__/live-voice-websocket.test.ts +12 -12
- package/src/__tests__/load-guards.test.ts +0 -1
- package/src/__tests__/migration-teleport-gcs-proxy.test.ts +0 -1
- package/src/__tests__/oauth-callback.test.ts +0 -1
- package/src/__tests__/remote-feature-flag-sync.test.ts +35 -45
- package/src/__tests__/resolve-assistant.test.ts +0 -1
- package/src/__tests__/route-schema-guard.test.ts +4 -1
- package/src/__tests__/runtime-client.test.ts +1 -2
- package/src/__tests__/runtime-health-proxy.test.ts +0 -1
- package/src/__tests__/runtime-proxy-auth.test.ts +3 -2
- package/src/__tests__/runtime-proxy-device-stamp.test.ts +0 -1
- package/src/__tests__/runtime-proxy-error-body.test.ts +0 -1
- package/src/__tests__/runtime-proxy.test.ts +0 -1
- package/src/__tests__/runtime-stream-test-utils.ts +0 -1
- package/src/__tests__/shared-invite-registration.test.ts +15 -32
- package/src/__tests__/slack-control-plane-proxy.test.ts +0 -1
- package/src/__tests__/slack-display-name.test.ts +0 -1
- package/src/__tests__/slack-normalize.test.ts +0 -1
- package/src/__tests__/slack-reaction-normalize.test.ts +0 -1
- package/src/__tests__/slack-socket-mode-catchup.test.ts +0 -1
- package/src/__tests__/slack-socket-mode-group-dm.test.ts +0 -1
- package/src/__tests__/slack-socket-mode-liveness.test.ts +0 -1
- package/src/__tests__/slack-socket-mode-outbound-root.test.ts +0 -1
- package/src/__tests__/slack-socket-mode-thread-tracking.test.ts +0 -1
- package/src/__tests__/speech-relay-websocket.test.ts +16 -14
- package/src/__tests__/stt-stream-websocket.test.ts +5 -5
- package/src/__tests__/telegram-control-plane-proxy.test.ts +0 -1
- package/src/__tests__/telegram-webhook-drop-visibility.test.ts +0 -1
- package/src/__tests__/telegram-webhook-handler.test.ts +0 -1
- package/src/__tests__/telegram-webhook-manager.test.ts +79 -80
- package/src/__tests__/twilio-media-websocket.test.ts +0 -1
- package/src/__tests__/twilio-webhooks.test.ts +6 -7
- package/src/__tests__/whatsapp-download.test.ts +0 -1
- package/src/__tests__/whatsapp-webhook.test.ts +0 -1
- package/src/attachments/ingest.test.ts +0 -1
- package/src/auth/guardian-bootstrap.ts +17 -15
- package/src/auth/scopes.ts +1 -1
- package/src/auth-fallback-reporter.ts +1 -1
- package/src/backup/backup-worker.ts +2 -2
- package/src/channels/inbound-event.ts +3 -3
- package/src/channels/ingress-inbound-vendors.test.ts +2 -2
- package/src/channels/ingress-inbound.ts +1 -1
- package/src/channels/ingress-verification.test.ts +2 -2
- package/src/channels/ingress-verification.ts +4 -4
- package/src/channels/plugin-ingress-approvals.test.ts +1 -1
- package/src/channels/plugin-ingress-approvals.ts +1 -1
- package/src/channels/plugin-ingress.test.ts +3 -3
- package/src/channels/plugin-ingress.ts +3 -3
- package/src/channels/room-admission.ts +2 -2
- package/src/{platform-identity.ts → cloud-identity.ts} +60 -68
- package/src/cloud-url.ts +14 -0
- package/src/{platform-user-id.ts → cloud-user-id.ts} +4 -4
- package/src/config.ts +2 -4
- package/src/credential-reader.ts +2 -2
- package/src/db/assistant-db-proxy.ts +1 -1
- package/src/discord/forward.ts +1 -1
- package/src/email/normalize.ts +4 -4
- package/src/email/register-callback.test.ts +27 -34
- package/src/email/register-callback.ts +21 -26
- package/src/feature-flag-registry.json +5 -5
- package/src/feature-flag-remote-store.ts +2 -2
- package/src/feature-flag-resolver.ts +5 -5
- package/src/http/cadet-signature.ts +1 -1
- package/src/http/edge-forwarded-header.ts +1 -1
- package/src/http/loopback-guard.ts +1 -1
- package/src/http/middleware/auth.ts +22 -22
- package/src/http/router.ts +1 -1
- package/src/http/routes/cadet-identity.ts +2 -2
- package/src/http/routes/channel-ingress-routes.ts +1 -1
- package/src/http/routes/channel-ingress.test.ts +13 -2
- package/src/http/routes/channel-verification-session-proxy.ts +9 -9
- package/src/http/routes/{platform-push-proxy.test.ts → cloud-push-proxy.test.ts} +21 -22
- package/src/http/routes/{platform-push-proxy.ts → cloud-push-proxy.ts} +13 -14
- package/src/http/routes/contacts-control-plane-proxy.ts +2 -2
- package/src/http/routes/email-webhook.test.ts +2 -3
- package/src/http/routes/email-webhook.ts +4 -4
- package/src/http/routes/guardian-channel-create.ts +3 -3
- package/src/http/routes/guardian-pin.ts +9 -9
- package/src/http/routes/inbound-register.ts +2 -2
- package/src/http/routes/ingress-domains.test.ts +129 -0
- package/src/http/routes/ingress-domains.ts +73 -0
- package/src/http/routes/live-voice-websocket.ts +2 -2
- package/src/http/routes/log-export.test.ts +0 -1
- package/src/http/routes/log-tail.test.ts +0 -1
- package/src/http/routes/migration-proxy.ts +1 -1
- package/src/http/routes/plugin-webhook-websocket.test.ts +3 -3
- package/src/http/routes/plugin-webhook.test.ts +9 -8
- package/src/http/routes/plugin-webhook.ts +1 -1
- package/src/http/routes/speech-relay-websocket.ts +8 -11
- package/src/http/routes/stt-stream-websocket.ts +1 -1
- package/src/http/routes/telegram-webhook.test.ts +0 -1
- package/src/http/routes/twilio-voice-verify-callback.ts +3 -3
- package/src/http/routes/twilio-voice-webhook.test.ts +3 -4
- package/src/http/routes/twilio-voice-webhook.ts +3 -3
- package/src/http/routes/whatsapp-webhook.test.ts +0 -1
- package/src/index.ts +57 -56
- package/src/ipc/credential-request-handlers.ts +4 -4
- package/src/ipc/debug-export-handlers.test.ts +0 -1
- package/src/ipc/log-tail-handlers.test.ts +0 -1
- package/src/ipc/risk-classification-handlers.test.ts +4 -4
- package/src/ipc/risk-classification-handlers.ts +2 -2
- package/src/remote-feature-flag-sync.ts +16 -18
- package/src/risk/command-registry/commands/assistant.ts +2 -2
- package/src/risk/skill-risk-classifier.test.ts +24 -24
- package/src/risk/skill-risk-classifier.ts +10 -10
- package/src/runtime/client.ts +17 -17
- package/src/schema.ts +5 -5
- package/src/telegram/send.test.ts +0 -1
- package/src/telegram/webhook-manager.ts +33 -38
- package/src/tunnel/allowed-paths.test.ts +3 -3
- package/src/tunnel/allowed-paths.ts +1 -1
- package/src/tunnel/client.test.ts +20 -21
- package/src/tunnel/client.ts +17 -17
- package/src/verification/shared-invite-registration.ts +22 -17
- package/src/version.ts +1 -1
- package/src/platform-url.ts +0 -24
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tests for registering `cadet-shared` invites with the
|
|
2
|
+
* Tests for registering `cadet-shared` invites with the cloud during
|
|
3
3
|
* invite creation (`createInviteNative`). The gateway DB is real; the
|
|
4
4
|
* platform, credential store, feature flags and daemon IPC are stubbed.
|
|
5
5
|
*/
|
|
@@ -64,15 +64,14 @@ const { createInviteNative, createContactsControlPlaneProxyHandler } =
|
|
|
64
64
|
await import("../http/routes/contacts-control-plane-proxy.js");
|
|
65
65
|
const { seedContact } = await import("./helpers/contact-fixtures.js");
|
|
66
66
|
|
|
67
|
-
const BASE_URL_KEY = credentialKey("cadet", "platform_base_url");
|
|
68
67
|
const API_KEY_KEY = credentialKey("cadet", "assistant_api_key");
|
|
69
|
-
const
|
|
68
|
+
const CLOUD_URL = "https://test-cloud.mycadet.ai";
|
|
70
69
|
const API_KEY = "vak_test_key";
|
|
71
70
|
const CONTACT_ID = "contact-alice";
|
|
72
71
|
|
|
73
|
-
function
|
|
72
|
+
function withCloudCredentials(): void {
|
|
73
|
+
process.env.CADET_CLOUD_URL = CLOUD_URL;
|
|
74
74
|
storedCredentials = {
|
|
75
|
-
[BASE_URL_KEY]: { value: `${PLATFORM_URL}/`, unreachable: false },
|
|
76
75
|
[API_KEY_KEY]: { value: API_KEY, unreachable: false },
|
|
77
76
|
};
|
|
78
77
|
}
|
|
@@ -101,10 +100,9 @@ beforeEach(() => {
|
|
|
101
100
|
fetchMock = mock(async () => new Response(null, { status: 204 }));
|
|
102
101
|
ipcCalls = [];
|
|
103
102
|
trustedContactsEnabled = true;
|
|
104
|
-
|
|
105
|
-
delete process.env.
|
|
106
|
-
delete process.env.
|
|
107
|
-
delete process.env.CADET_PLATFORM_URL;
|
|
103
|
+
withCloudCredentials();
|
|
104
|
+
delete process.env.CADET_DISABLE_CLOUD;
|
|
105
|
+
delete process.env.IS_CLOUD;
|
|
108
106
|
delete process.env.ASSISTANT_API_KEY;
|
|
109
107
|
});
|
|
110
108
|
|
|
@@ -119,7 +117,7 @@ describe("cadet-shared invite registration", () => {
|
|
|
119
117
|
|
|
120
118
|
expect(fetchMock).toHaveBeenCalledTimes(1);
|
|
121
119
|
const [url, init] = fetchMock.mock.calls[0]!;
|
|
122
|
-
expect(url).toBe(`${
|
|
120
|
+
expect(url).toBe(`${CLOUD_URL}/v1/internal/shared-invites/`);
|
|
123
121
|
expect(init?.method).toBe("POST");
|
|
124
122
|
const headers = init?.headers as Record<string, string>;
|
|
125
123
|
expect(headers.Authorization).toBe(`Api-Key ${API_KEY}`);
|
|
@@ -152,7 +150,7 @@ describe("cadet-shared invite registration", () => {
|
|
|
152
150
|
|
|
153
151
|
test("falls back to the environment for platform credentials", async () => {
|
|
154
152
|
storedCredentials = {};
|
|
155
|
-
process.env.
|
|
153
|
+
process.env.CADET_CLOUD_URL = CLOUD_URL;
|
|
156
154
|
process.env.ASSISTANT_API_KEY = "vak_env_key";
|
|
157
155
|
|
|
158
156
|
await createInviteNative({
|
|
@@ -161,7 +159,7 @@ describe("cadet-shared invite registration", () => {
|
|
|
161
159
|
});
|
|
162
160
|
|
|
163
161
|
const [url, init] = fetchMock.mock.calls[0]!;
|
|
164
|
-
expect(url).toBe(`${
|
|
162
|
+
expect(url).toBe(`${CLOUD_URL}/v1/internal/shared-invites/`);
|
|
165
163
|
expect((init?.headers as Record<string, string>).Authorization).toBe(
|
|
166
164
|
"Api-Key vak_env_key",
|
|
167
165
|
);
|
|
@@ -200,7 +198,7 @@ describe("registration is skipped", () => {
|
|
|
200
198
|
});
|
|
201
199
|
|
|
202
200
|
test("when platform features are disabled", async () => {
|
|
203
|
-
process.env.
|
|
201
|
+
process.env.CADET_DISABLE_CLOUD = "true";
|
|
204
202
|
|
|
205
203
|
await createInviteNative({
|
|
206
204
|
contactId: CONTACT_ID,
|
|
@@ -223,20 +221,6 @@ describe("registration is skipped", () => {
|
|
|
223
221
|
expect(activeInviteRows()).toHaveLength(1);
|
|
224
222
|
});
|
|
225
223
|
|
|
226
|
-
test("when only the base URL is configured", async () => {
|
|
227
|
-
storedCredentials = {
|
|
228
|
-
[BASE_URL_KEY]: { value: PLATFORM_URL, unreachable: false },
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
await createInviteNative({
|
|
232
|
-
contactId: CONTACT_ID,
|
|
233
|
-
sourceChannel: "cadet-shared",
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
expect(fetchMock).not.toHaveBeenCalled();
|
|
237
|
-
expect(activeInviteRows()).toHaveLength(1);
|
|
238
|
-
});
|
|
239
|
-
|
|
240
224
|
test("when the trusted-contacts flag is off", async () => {
|
|
241
225
|
trustedContactsEnabled = false;
|
|
242
226
|
|
|
@@ -279,12 +263,12 @@ describe("a failed registration leaves no invite", () => {
|
|
|
279
263
|
await expectCreateRejected(429, "TOO_MANY_OUTSTANDING_INVITES");
|
|
280
264
|
});
|
|
281
265
|
|
|
282
|
-
test("a
|
|
266
|
+
test("a cloud error surfaces as 502", async () => {
|
|
283
267
|
fetchMock = mock(async () => new Response(null, { status: 503 }));
|
|
284
268
|
await expectCreateRejected(502, "INVITE_REGISTRATION_FAILED");
|
|
285
269
|
});
|
|
286
270
|
|
|
287
|
-
test("a
|
|
271
|
+
test("a cloud refusal surfaces as 502", async () => {
|
|
288
272
|
fetchMock = mock(async () => new Response(null, { status: 404 }));
|
|
289
273
|
await expectCreateRejected(502, "INVITE_REGISTRATION_FAILED");
|
|
290
274
|
});
|
|
@@ -296,10 +280,9 @@ describe("a failed registration leaves no invite", () => {
|
|
|
296
280
|
await expectCreateRejected(502, "INVITE_REGISTRATION_FAILED");
|
|
297
281
|
});
|
|
298
282
|
|
|
299
|
-
test("an unreachable credential store surfaces as 503 without calling the
|
|
283
|
+
test("an unreachable credential store surfaces as 503 without calling the cloud", async () => {
|
|
300
284
|
storedCredentials = {
|
|
301
|
-
[
|
|
302
|
-
[API_KEY_KEY]: { value: API_KEY, unreachable: false },
|
|
285
|
+
[API_KEY_KEY]: { value: undefined, unreachable: true },
|
|
303
286
|
};
|
|
304
287
|
await expectCreateRejected(503, "INVITE_REGISTRATION_UNAVAILABLE");
|
|
305
288
|
expect(fetchMock).not.toHaveBeenCalled();
|
|
@@ -74,15 +74,15 @@ function makeKeyedCredentials(
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
describe("tunnel origin derivation", () => {
|
|
77
|
-
//
|
|
77
|
+
// getCloudBaseUrl falls back to this env var; pin it absent so the
|
|
78
78
|
// missing-credential cases below are deterministic on dev machines.
|
|
79
|
-
const
|
|
79
|
+
const savedCloudUrl = process.env.CADET_CLOUD_URL;
|
|
80
80
|
beforeAll(() => {
|
|
81
|
-
delete process.env.
|
|
81
|
+
delete process.env.CADET_CLOUD_URL;
|
|
82
82
|
});
|
|
83
83
|
afterAll(() => {
|
|
84
|
-
if (
|
|
85
|
-
process.env.
|
|
84
|
+
if (savedCloudUrl !== undefined) {
|
|
85
|
+
process.env.CADET_CLOUD_URL = savedCloudUrl;
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
|
|
@@ -104,16 +104,15 @@ describe("tunnel origin derivation", () => {
|
|
|
104
104
|
).toBeNull();
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
test("derives the tunnel origin from
|
|
107
|
+
test("derives the tunnel origin from CADET_CLOUD_URL when TUNNEL_BASE_URL is unset", async () => {
|
|
108
108
|
const server = makeFakeServer();
|
|
109
|
+
process.env.CADET_CLOUD_URL = "https://staging-cloud.mycadet.ai";
|
|
109
110
|
const handler = createSpeechRelayUpgradeHandler(
|
|
110
111
|
makeConfig({ tunnelBaseUrl: undefined }),
|
|
111
112
|
"stt",
|
|
112
113
|
{
|
|
113
114
|
credentials: makeKeyedCredentials({
|
|
114
115
|
"credential/cadet/assistant_api_key": "vk-1",
|
|
115
|
-
"credential/cadet/platform_base_url":
|
|
116
|
-
"https://staging-cloud.mycadet.ai",
|
|
117
116
|
}),
|
|
118
117
|
},
|
|
119
118
|
);
|
|
@@ -133,19 +132,23 @@ describe("tunnel origin derivation", () => {
|
|
|
133
132
|
});
|
|
134
133
|
|
|
135
134
|
test("falls back to prod tunnel for an off-convention or missing platform base URL", async () => {
|
|
136
|
-
for (const
|
|
135
|
+
for (const cloudBaseUrl of [
|
|
137
136
|
"http://localhost:8000",
|
|
138
137
|
"not a url",
|
|
139
138
|
undefined,
|
|
140
139
|
]) {
|
|
141
140
|
const server = makeFakeServer();
|
|
141
|
+
if (cloudBaseUrl === undefined) {
|
|
142
|
+
delete process.env.CADET_CLOUD_URL;
|
|
143
|
+
} else {
|
|
144
|
+
process.env.CADET_CLOUD_URL = cloudBaseUrl;
|
|
145
|
+
}
|
|
142
146
|
const handler = createSpeechRelayUpgradeHandler(
|
|
143
147
|
makeConfig({ tunnelBaseUrl: undefined }),
|
|
144
148
|
"stt",
|
|
145
149
|
{
|
|
146
150
|
credentials: makeKeyedCredentials({
|
|
147
151
|
"credential/cadet/assistant_api_key": "vk-1",
|
|
148
|
-
"credential/cadet/platform_base_url": platformBaseUrl,
|
|
149
152
|
}),
|
|
150
153
|
},
|
|
151
154
|
);
|
|
@@ -162,13 +165,12 @@ describe("tunnel origin derivation", () => {
|
|
|
162
165
|
}
|
|
163
166
|
});
|
|
164
167
|
|
|
165
|
-
test("an explicit TUNNEL_BASE_URL wins over
|
|
168
|
+
test("an explicit TUNNEL_BASE_URL wins over CADET_CLOUD_URL", async () => {
|
|
166
169
|
const server = makeFakeServer();
|
|
170
|
+
process.env.CADET_CLOUD_URL = "https://staging-cloud.mycadet.ai";
|
|
167
171
|
const handler = createSpeechRelayUpgradeHandler(makeConfig(), "stt", {
|
|
168
172
|
credentials: makeKeyedCredentials({
|
|
169
173
|
"credential/cadet/assistant_api_key": "vk-1",
|
|
170
|
-
"credential/cadet/platform_base_url":
|
|
171
|
-
"https://staging-cloud.mycadet.ai",
|
|
172
174
|
}),
|
|
173
175
|
});
|
|
174
176
|
const req = new Request(
|
|
@@ -265,7 +267,7 @@ describe("createSpeechRelayUpgradeHandler — gate", () => {
|
|
|
265
267
|
});
|
|
266
268
|
|
|
267
269
|
test("forwards the tts voice model to tunnel", async () => {
|
|
268
|
-
// Regression: the daemon sends the selected
|
|
270
|
+
// Regression: the daemon sends the selected cloud voice as `model`;
|
|
269
271
|
// a gateway that rejects it silently breaks voice selection (the
|
|
270
272
|
// daemon's synthesis fails before tunnel ever sees the session).
|
|
271
273
|
const server = makeFakeServer();
|
|
@@ -435,7 +435,7 @@ describe("dictation is not a guardian-only surface", () => {
|
|
|
435
435
|
});
|
|
436
436
|
|
|
437
437
|
/**
|
|
438
|
-
* The
|
|
438
|
+
* The cloud path, where tunnel validated the browser's own token and
|
|
439
439
|
* attested the caller to the bridge. There is no edge JWT on it, so requiring
|
|
440
440
|
* one rejected every managed caller: the socket opened at tunnel and closed at
|
|
441
441
|
* the loopback with an open failure, which the browser saw as a 1014.
|
|
@@ -449,7 +449,7 @@ describe("createSttStreamWebsocketHandler: tunnel-attested managed auth", () =>
|
|
|
449
449
|
const TUNNEL_ORG_ID = "22222222-2222-2222-2222-222222222222";
|
|
450
450
|
|
|
451
451
|
afterEach(() => {
|
|
452
|
-
delete process.env.
|
|
452
|
+
delete process.env.IS_CLOUD;
|
|
453
453
|
});
|
|
454
454
|
|
|
455
455
|
const managedUpgrade = ({
|
|
@@ -466,9 +466,9 @@ describe("createSttStreamWebsocketHandler: tunnel-attested managed auth", () =>
|
|
|
466
466
|
tunnelBaseUrl?: string;
|
|
467
467
|
}) => {
|
|
468
468
|
if (managed) {
|
|
469
|
-
process.env.
|
|
469
|
+
process.env.IS_CLOUD = "true";
|
|
470
470
|
} else {
|
|
471
|
-
delete process.env.
|
|
471
|
+
delete process.env.IS_CLOUD;
|
|
472
472
|
}
|
|
473
473
|
const headers = new Headers({
|
|
474
474
|
upgrade: "websocket",
|
|
@@ -530,7 +530,7 @@ describe("createSttStreamWebsocketHandler: tunnel-attested managed auth", () =>
|
|
|
530
530
|
expect(server.upgrade).not.toHaveBeenCalled();
|
|
531
531
|
});
|
|
532
532
|
|
|
533
|
-
/** A locally hosted gateway with a tunnel takes the tunnel path like a
|
|
533
|
+
/** A locally hosted gateway with a tunnel takes the tunnel path like a cloud pod. */
|
|
534
534
|
test("admits an attested caller on a locally hosted gateway with a tunnel", () => {
|
|
535
535
|
const { res, server } = managedUpgrade({
|
|
536
536
|
managed: false,
|