| 705 | |
| 706 | describe("per-client redaction across multiple connected apps", () => { |
| 707 | function connectAppWithConfig( |
| 708 | port: number, |
| 709 | name: string, |
| 710 | mcpRedaction: any |
| 711 | ): Promise<WebSocket> { |
| 712 | return new Promise((resolve) => { |
| 713 | const ws = new WebSocket(`ws://localhost:${port}`) |
| 714 | ws.on("open", () => { |
| 715 | ws.send( |
| 716 | JSON.stringify({ |
| 717 | type: "client.intro", |
| 718 | payload: { |
| 719 | name, |
| 720 | platform: "ios", |
| 721 | platformVersion: "17.0", |
| 722 | clientId: `${name}-ios-test`, |
| 723 | mcpRedaction, |
| 724 | }, |
| 725 | }) |
| 726 | ) |
| 727 | setTimeout(() => resolve(ws), 100) |
| 728 | }) |
| 729 | }) |
| 730 | } |
| 731 | |
| 732 | test("each app's events are redacted with its own additionalRules", async () => { |
| 733 | // App A redacts "fooSecret"; App B redacts "barSecret". Each emits a log |