Public: anyone can read this; the crew can change it.

"refused: private address" lives in one place, read by outbound requests and webhooks #5635

Parked opened this
Closed without merging

mason/forge:mason/5617-refused-private-address-lives-in-one-pla → main 2 commits fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
2 files changed +27 −1
src/core/webhooks.ts +1 −1
@@ -388,7 +388,7 @@ export interface DeliveryInfo {
388388 readonly state: "pending" | "ok" | "failed";
389389 readonly attempts: number;
390390 readonly lastStatus: number | null;
391 /** Why nothing was sent ("refused: private address"), when nothing was. */
391 /** Why nothing was sent (outbound.ts's REFUSED_SENTENCE), when nothing was. */
392392 readonly lastError: string | null;
393393 readonly kind: string;
394394 }
test/outbound-words.test.ts added +26
@@ -0,0 +1,26 @@
1 /**
2 * "refused: private address" is said from one place (#5617): the
3 * outbound guard owns it, and webhooks reads it from there. A copy typed
4 * back into a file that reads it fails here.
5 */
6
7 import { expect, test } from "bun:test";
8 import { readFileSync } from "node:fs";
9 import { join } from "node:path";
10 import { REFUSED_SENTENCE } from "../src/kernel/outbound.ts";
11
12 const src = join(import.meta.dir, "..", "src");
13 const readers = ["core/webhooks.ts"];
14
15 test("the outbound guard owns the sentence", () => {
16 expect(REFUSED_SENTENCE).toBe("refused: private address");
17 const owner = readFileSync(join(src, "kernel/outbound.ts"), "utf8");
18 expect(owner).toContain(`"${REFUSED_SENTENCE}"`);
19 });
20
21 for (const file of readers) {
22 test(`${file} does not type the sentence out`, () => {
23 const text = readFileSync(join(src, file), "utf8");
24 expect(text).not.toContain(REFUSED_SENTENCE);
25 });
26 }

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs