@noodleseed/one 0.17.0 → 0.18.1
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/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/alerts-ops.d.ts +2 -0
- package/dist/commands/alerts-ops.d.ts.map +1 -0
- package/dist/commands/alerts-ops.js +249 -0
- package/dist/commands/alerts-ops.js.map +1 -0
- package/dist/commands/analytics-ops.d.ts +13 -0
- package/dist/commands/analytics-ops.d.ts.map +1 -1
- package/dist/commands/analytics-ops.js +5 -2
- package/dist/commands/analytics-ops.js.map +1 -1
- package/dist/commands/catalog-data-resources.d.ts.map +1 -1
- package/dist/commands/catalog-data-resources.js +45 -0
- package/dist/commands/catalog-data-resources.js.map +1 -1
- package/dist/commands/github-ops.d.ts.map +1 -1
- package/dist/commands/github-ops.js +24 -4
- package/dist/commands/github-ops.js.map +1 -1
- package/dist/commands/github-runs-ops.d.ts +32 -0
- package/dist/commands/github-runs-ops.d.ts.map +1 -0
- package/dist/commands/github-runs-ops.js +132 -0
- package/dist/commands/github-runs-ops.js.map +1 -0
- package/dist/commands/mcp-apps.js +27 -0
- package/dist/commands/mcp-apps.js.map +1 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +1 -3
- package/dist/prompts.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +5 -0
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +3 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/authoring/dist/recording.js +18 -23
- package/node_modules/@noodle-borg/authoring/dist/recording.js.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/server.d.ts +4 -1
- package/node_modules/@noodle-borg/authoring/dist/server.d.ts.map +1 -1
- package/node_modules/@noodle-borg/authoring/dist/server.js +3 -1
- package/node_modules/@noodle-borg/authoring/dist/server.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts +2 -0
- package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/compile.js +1 -1
- package/node_modules/@noodle-borg/compiler/dist/compile.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +1 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +6 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/widget-compile-helpers.d.ts +3 -1
- package/node_modules/@noodle-borg/compiler/dist/widget-compile-helpers.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/widget-compile-helpers.js +7 -1
- package/node_modules/@noodle-borg/compiler/dist/widget-compile-helpers.js.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/widget-emit.d.ts.map +1 -1
- package/node_modules/@noodle-borg/compiler/dist/widget-emit.js +3 -1
- package/node_modules/@noodle-borg/compiler/dist/widget-emit.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts +3 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/mapping.js +9 -3
- package/node_modules/@noodle-borg/protocol/dist/mapping.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.js +1 -1
- package/node_modules/@noodle-borg/protocol/dist/sdk-server.js.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/widget/react-bridge-bootstrap.d.ts +1 -1
- package/node_modules/@noodle-borg/protocol/dist/widget/react-bridge-bootstrap.d.ts.map +1 -1
- package/node_modules/@noodle-borg/protocol/dist/widget/react-bridge-bootstrap.js +1 -1
- package/node_modules/@noodle-borg/service/dist/alert-evaluator.d.ts +57 -0
- package/node_modules/@noodle-borg/service/dist/alert-evaluator.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/alert-evaluator.js +158 -0
- package/node_modules/@noodle-borg/service/dist/alert-evaluator.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/alert-webhook.d.ts +72 -0
- package/node_modules/@noodle-borg/service/dist/alert-webhook.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/alert-webhook.js +138 -0
- package/node_modules/@noodle-borg/service/dist/alert-webhook.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.d.ts +15 -8
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.js +16 -9
- package/node_modules/@noodle-borg/service/dist/github/pending-installations.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.d.ts +10 -2
- package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.js +9 -1
- package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts +20 -1
- package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.d.ts +28 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.js +50 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts.d.ts +39 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts.js +204 -0
- package/node_modules/@noodle-borg/service/dist/routes/alerts.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/contracts.d.ts +149 -0
- package/node_modules/@noodle-borg/service/dist/routes/contracts.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/contracts.js +81 -0
- package/node_modules/@noodle-borg/service/dist/routes/contracts.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-connection.js +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-connection.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts +2 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js +37 -2
- package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-runs.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-runs.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-runs.js +33 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-runs.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.d.ts +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.js +3 -3
- package/node_modules/@noodle-borg/service/dist/routes/github-setup.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts +29 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js +355 -0
- package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.d.ts +27 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.js +61 -0
- package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts +20 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/paths.js +54 -0
- package/node_modules/@noodle-borg/service/dist/routes/paths.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.js +42 -1
- package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.js +37 -53
- package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.d.ts +21 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.js +115 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules.d.ts +108 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules.js +181 -0
- package/node_modules/@noodle-borg/service/dist/store/alert-rules.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js +4 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-connections.js +4 -0
- package/node_modules/@noodle-borg/service/dist/store/github-connections.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts +22 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js +116 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts +51 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs.js +158 -0
- package/node_modules/@noodle-borg/service/dist/store/github-runs.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.d.ts +19 -0
- package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.js +46 -0
- package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.d.ts +26 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.js +142 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts +9 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js +113 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.js +7 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres-github.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js +49 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts +9 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.js +17 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store.d.ts +104 -0
- package/node_modules/@noodle-borg/service/dist/store.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store.js +2 -0
- package/node_modules/@noodle-borg/service/dist/store.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-dispatch.js","sourceRoot":"","sources":["../../src/routes/github-dispatch.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,+BAA+B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"github-dispatch.js","sourceRoot":"","sources":["../../src/routes/github-dispatch.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,+BAA+B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,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OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
import type { DeployAuthGate } from '../auth/deploy-gate.js';
|
|
3
|
+
import type { ControlPlaneStore, GithubDeployRunStore } from '../store.js';
|
|
4
|
+
export declare function handleGithubRunsList(req: IncomingMessage, res: ServerResponse, gate: DeployAuthGate, controlPlane: ControlPlaneStore, runStore: GithubDeployRunStore, ref: {
|
|
5
|
+
readonly org: string;
|
|
6
|
+
readonly app: string;
|
|
7
|
+
}, url: URL): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=github-runs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-runs.d.ts","sourceRoot":"","sources":["../../src/routes/github-runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAc3E,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,iBAAiB,EAC/B,QAAQ,EAAE,oBAAoB,EAC9B,GAAG,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACnD,GAAG,EAAE,GAAG,GACP,OAAO,CAAC,IAAI,CAAC,CAyBf"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { sendJson } from '../http-util.js';
|
|
2
|
+
import { sendContract } from './apps.js';
|
|
3
|
+
import { GithubRunsListResponseSchema } from './contracts.js';
|
|
4
|
+
import { authorizeTenantControl } from './control-plane.js';
|
|
5
|
+
/**
|
|
6
|
+
* `GET /v1/orgs/{org}/apps/{app}/github/runs` (GHD-2): the deploy-runs read surface behind
|
|
7
|
+
* `noodle github runs` and the console feed. Org MEMBER read (mirrors the connection GET — runs are
|
|
8
|
+
* operational visibility, not an owner-only control). Newest-first with the store's explicit cap +
|
|
9
|
+
* `truncated` flag; `?limit=` tightens it (1..200).
|
|
10
|
+
*/
|
|
11
|
+
const MAX_LIST_LIMIT = 200;
|
|
12
|
+
export async function handleGithubRunsList(req, res, gate, controlPlane, runStore, ref, url) {
|
|
13
|
+
const identity = await authorizeTenantControl(req, res, gate, controlPlane, ref.org);
|
|
14
|
+
if (identity === false)
|
|
15
|
+
return;
|
|
16
|
+
const limitParam = url.searchParams.get('limit');
|
|
17
|
+
let limit;
|
|
18
|
+
if (limitParam !== null) {
|
|
19
|
+
const parsed = Number(limitParam);
|
|
20
|
+
if (!Number.isInteger(parsed) || parsed < 1 || parsed > MAX_LIST_LIMIT) {
|
|
21
|
+
return sendJson(res, 400, {
|
|
22
|
+
error: `"limit" must be an integer between 1 and ${MAX_LIST_LIMIT}`,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
limit = parsed;
|
|
26
|
+
}
|
|
27
|
+
const result = await runStore.listDeployRuns(ref.org, ref.app, limit !== undefined ? { limit } : {});
|
|
28
|
+
return sendContract(res, () => GithubRunsListResponseSchema.parse({
|
|
29
|
+
ok: true,
|
|
30
|
+
data: { runs: result.runs, truncated: result.truncated },
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=github-runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-runs.js","sourceRoot":"","sources":["../../src/routes/github-runs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;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,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE;KACzD,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -17,7 +17,7 @@ import type { ControlPlaneStore } from '../store.js';
|
|
|
17
17
|
* the only protection. A tampered/expired/malformed state or a missing/non-numeric `installation_id` is
|
|
18
18
|
* rejected before anything is stored — no partial/garbage pending entry is ever written.
|
|
19
19
|
*/
|
|
20
|
-
export declare function handleGithubSetup(_req: IncomingMessage, res: ServerResponse, pendingStore: PendingGithubInstallationStore, githubApp: GithubAppConfig | undefined, url: URL): void
|
|
20
|
+
export declare function handleGithubSetup(_req: IncomingMessage, res: ServerResponse, pendingStore: PendingGithubInstallationStore, githubApp: GithubAppConfig | undefined, url: URL): Promise<void>;
|
|
21
21
|
/**
|
|
22
22
|
* `GET /v1/github/installations/pending?state=...` — the CLI's poll target. Requires the same signed-in
|
|
23
23
|
* subject who requested `install-url` (nonce subject match, mirroring `installations/claim`) and org
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-setup.d.ts","sourceRoot":"","sources":["../../src/routes/github-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAEzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAuBrD;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"github-setup.d.ts","sourceRoot":"","sources":["../../src/routes/github-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAEzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAuBrD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,eAAe,EACrB,GAAG,EAAE,cAAc,EACnB,YAAY,EAAE,8BAA8B,EAC5C,SAAS,EAAE,eAAe,GAAG,SAAS,EACtC,GAAG,EAAE,GAAG,GACP,OAAO,CAAC,IAAI,CAAC,CAef;AAED;;;;;GAKG;AACH,wBAAsB,+BAA+B,CACnD,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,iBAAiB,EAC/B,YAAY,EAAE,8BAA8B,EAC5C,SAAS,EAAE,eAAe,GAAG,SAAS,EACtC,GAAG,EAAE,GAAG,GACP,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|
|
@@ -23,7 +23,7 @@ function parsePositiveInt(value) {
|
|
|
23
23
|
* the only protection. A tampered/expired/malformed state or a missing/non-numeric `installation_id` is
|
|
24
24
|
* rejected before anything is stored — no partial/garbage pending entry is ever written.
|
|
25
25
|
*/
|
|
26
|
-
export function handleGithubSetup(_req, res, pendingStore, githubApp, url) {
|
|
26
|
+
export async function handleGithubSetup(_req, res, pendingStore, githubApp, url) {
|
|
27
27
|
const state = url.searchParams.get('state');
|
|
28
28
|
const installationId = parsePositiveInt(url.searchParams.get('installation_id'));
|
|
29
29
|
if (state === null || installationId === undefined) {
|
|
@@ -36,7 +36,7 @@ export function handleGithubSetup(_req, res, pendingStore, githubApp, url) {
|
|
|
36
36
|
sendHtml(res, 400, SETUP_ERROR_HTML);
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
-
pendingStore.put(state, installationId);
|
|
39
|
+
await pendingStore.put(state, installationId);
|
|
40
40
|
sendHtml(res, 200, SETUP_OK_HTML);
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
@@ -70,7 +70,7 @@ export async function handleGithubInstallationPending(req, res, gate, controlPla
|
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
const installationId = pendingStore.get(state);
|
|
73
|
+
const installationId = await pendingStore.get(state);
|
|
74
74
|
if (installationId === undefined) {
|
|
75
75
|
sendJson(res, 404, { error: 'installation not landed yet' });
|
|
76
76
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-setup.js","sourceRoot":"","sources":["../../src/routes/github-setup.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,aAAa,GACjB,oFAAoF;IACpF,+FAA+F;IAC/F,oDAAoD,CAAC;AACvD,MAAM,gBAAgB,GACpB,oFAAoF;IACpF,sGAAsG;IACtG,0GAA0G,CAAC;AAE7G,SAAS,QAAQ,CAAC,GAAmB,EAAE,MAAc,EAAE,IAAY;IACjE,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,0BAA0B,EAAE,CAAC,CAAC;IACtE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAoB;IAC5C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC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AkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvD,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,YAAY,CAAC,OAAO,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO,EAAE,CAAC;QAC1E,aAAa,CAAC,GAAG,EAAE,0BAA0B,CAAC,CAAC;QAC/C,OAAO;IACT,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,WAAW,CAAC;YAC5C,GAAG,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG;YAC7B,OAAO,EAAE,QAAQ,CAAC,OAAO;SAC1B,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,aAAa,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;YAChC,OAAO;QACT,CAAC;IACH,CAAC;IACD,MAAM,cAAc,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACrD,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACjC,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,6BAA6B,EAAE,CAAC,CAAC;QAC7D,OAAO;IACT,CAAC;IACD,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
import type { AuditSink } from '../store/audit.js';
|
|
3
|
+
import type { GithubConnectionStore, GithubDeployRunStore } from '../store.js';
|
|
4
|
+
/**
|
|
5
|
+
* `POST /v1/github/webhook` (GHD-2, ADR 0111 §6) — the GitHub App's webhook receiver. Unauthenticated
|
|
6
|
+
* by necessity (GitHub is the caller), so the defense layers run strictly in order: the HMAC-SHA256
|
|
7
|
+
* signature is verified over the RAW body bytes before any header semantics or JSON parsing; then
|
|
8
|
+
* headers, then payload shape, then the connection binding (repository AND installation must match),
|
|
9
|
+
* and only then the idempotent run mutation (the store's delivery-id/target dedupe is the replay
|
|
10
|
+
* defense — see `GithubDeployRunStore`). Every response to GitHub is intentionally terse: no payload
|
|
11
|
+
* echo, no secret material, no verification oracle beyond the HTTP status.
|
|
12
|
+
*
|
|
13
|
+
* PR-B scope: runs are RECORDED (queued / queued+blocked), superseded, and canceled — never built.
|
|
14
|
+
* The build worker that walks queued runs forward is GHD-3, and it must skip runs carrying a
|
|
15
|
+
* `blockedReason`.
|
|
16
|
+
*/
|
|
17
|
+
export interface GithubWebhookDeps {
|
|
18
|
+
readonly connectionStore: GithubConnectionStore;
|
|
19
|
+
readonly runStore: GithubDeployRunStore;
|
|
20
|
+
readonly webhookSecret: string | undefined;
|
|
21
|
+
readonly audit: AuditSink;
|
|
22
|
+
readonly maxBody: number;
|
|
23
|
+
/** Injectable run-id mint for deterministic tests. Default: `run-` + 12 hex chars. */
|
|
24
|
+
readonly newRunId?: () => string;
|
|
25
|
+
}
|
|
26
|
+
/** Timing-safe check of GitHub's `X-Hub-Signature-256: sha256=<hex>` over the raw body bytes. */
|
|
27
|
+
export declare function verifyWebhookSignature(rawBody: Buffer, signatureHeader: string | undefined, secret: string): boolean;
|
|
28
|
+
export declare function handleGithubWebhook(req: IncomingMessage, res: ServerResponse, deps: GithubWebhookDeps): Promise<void>;
|
|
29
|
+
//# sourceMappingURL=github-webhook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-webhook.d.ts","sourceRoot":"","sources":["../../src/routes/github-webhook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAEV,qBAAqB,EACrB,oBAAoB,EAErB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,eAAe,EAAE,qBAAqB,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;CAClC;AAID,iGAAiG;AACjG,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,MAAM,EAAE,MAAM,GACb,OAAO,CAST;AAgVD,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,IAAI,CAAC,CAoDf"}
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
import { sendJson } from '../http-util.js';
|
|
3
|
+
const SIGNATURE_HEADER = 'x-hub-signature-256';
|
|
4
|
+
/** Timing-safe check of GitHub's `X-Hub-Signature-256: sha256=<hex>` over the raw body bytes. */
|
|
5
|
+
export function verifyWebhookSignature(rawBody, signatureHeader, secret) {
|
|
6
|
+
if (signatureHeader === undefined || !signatureHeader.startsWith('sha256='))
|
|
7
|
+
return false;
|
|
8
|
+
const received = signatureHeader.slice('sha256='.length);
|
|
9
|
+
// Exactly 64 hex chars: Buffer.from(..., 'hex') silently drops a trailing odd nibble, so a lax
|
|
10
|
+
// length check would accept multiple encodings of the same digest.
|
|
11
|
+
if (!/^[0-9a-f]{64}$/i.test(received))
|
|
12
|
+
return false;
|
|
13
|
+
const expected = createHmac('sha256', secret).update(rawBody).digest();
|
|
14
|
+
const receivedBuf = Buffer.from(received, 'hex');
|
|
15
|
+
return receivedBuf.length === expected.length && timingSafeEqual(receivedBuf, expected);
|
|
16
|
+
}
|
|
17
|
+
async function readRawBody(req, max) {
|
|
18
|
+
const chunks = [];
|
|
19
|
+
let size = 0;
|
|
20
|
+
for await (const chunk of req) {
|
|
21
|
+
const buf = chunk;
|
|
22
|
+
size += buf.length;
|
|
23
|
+
if (size > max)
|
|
24
|
+
return { ok: false };
|
|
25
|
+
chunks.push(buf);
|
|
26
|
+
}
|
|
27
|
+
return { ok: true, raw: Buffer.concat(chunks) };
|
|
28
|
+
}
|
|
29
|
+
function defaultRunId() {
|
|
30
|
+
return `run-${randomBytes(6).toString('hex')}`;
|
|
31
|
+
}
|
|
32
|
+
function positiveInt(value) {
|
|
33
|
+
return typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : undefined;
|
|
34
|
+
}
|
|
35
|
+
function asRecord(value) {
|
|
36
|
+
return typeof value === 'object' && value !== null
|
|
37
|
+
? value
|
|
38
|
+
: undefined;
|
|
39
|
+
}
|
|
40
|
+
/** GitHub's `sender.login`, or `'unknown'` when the payload omits it. */
|
|
41
|
+
function senderLogin(payload) {
|
|
42
|
+
const login = asRecord(payload.sender)?.login;
|
|
43
|
+
return typeof login === 'string' ? login : 'unknown';
|
|
44
|
+
}
|
|
45
|
+
function outcome(res, data) {
|
|
46
|
+
sendJson(res, 200, { ok: true, data });
|
|
47
|
+
}
|
|
48
|
+
function ignored(res, reason) {
|
|
49
|
+
outcome(res, { outcome: 'ignored', reason });
|
|
50
|
+
}
|
|
51
|
+
/** Repository id + installation-binding guard shared by every repo-scoped event. */
|
|
52
|
+
async function boundConnection(ctx, payload) {
|
|
53
|
+
const repository = asRecord(payload.repository);
|
|
54
|
+
const repositoryId = positiveInt(repository?.id);
|
|
55
|
+
if (repositoryId === undefined) {
|
|
56
|
+
sendJson(ctx.res, 400, { error: 'malformed payload' });
|
|
57
|
+
return 'responded';
|
|
58
|
+
}
|
|
59
|
+
const connection = await ctx.deps.connectionStore.getRepoConnectionByRepository(repositoryId);
|
|
60
|
+
if (connection === undefined) {
|
|
61
|
+
ignored(ctx.res, 'no_connection');
|
|
62
|
+
return 'responded';
|
|
63
|
+
}
|
|
64
|
+
const installationId = positiveInt(asRecord(payload.installation)?.id);
|
|
65
|
+
if (installationId !== connection.installationId) {
|
|
66
|
+
// Signed traffic naming a bound repo under the WRONG installation is suspicious — audit it.
|
|
67
|
+
await ctx.deps.audit.emit({
|
|
68
|
+
eventType: 'github.webhook.installation_mismatch',
|
|
69
|
+
org: connection.orgSlug,
|
|
70
|
+
app: connection.appSlug,
|
|
71
|
+
decision: 'deny',
|
|
72
|
+
status: 200,
|
|
73
|
+
details: {
|
|
74
|
+
deliveryId: ctx.deliveryId,
|
|
75
|
+
expectedInstallationId: connection.installationId,
|
|
76
|
+
receivedInstallationId: installationId ?? 0,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
ignored(ctx.res, 'installation_mismatch');
|
|
80
|
+
return 'responded';
|
|
81
|
+
}
|
|
82
|
+
return connection;
|
|
83
|
+
}
|
|
84
|
+
async function recordRun(ctx, connection, input) {
|
|
85
|
+
const result = await ctx.deps.runStore.createDeployRun({
|
|
86
|
+
...input,
|
|
87
|
+
runId: (ctx.deps.newRunId ?? defaultRunId)(),
|
|
88
|
+
orgSlug: connection.orgSlug,
|
|
89
|
+
appSlug: connection.appSlug,
|
|
90
|
+
deliveryId: ctx.deliveryId,
|
|
91
|
+
});
|
|
92
|
+
if (!result.ok) {
|
|
93
|
+
outcome(ctx.res, { outcome: 'duplicate', reason: result.reason });
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
await ctx.deps.audit.emit({
|
|
97
|
+
eventType: 'github.webhook.run_queued',
|
|
98
|
+
org: connection.orgSlug,
|
|
99
|
+
app: connection.appSlug,
|
|
100
|
+
decision: 'allow',
|
|
101
|
+
status: 200,
|
|
102
|
+
details: {
|
|
103
|
+
deliveryId: ctx.deliveryId,
|
|
104
|
+
runId: result.record.runId,
|
|
105
|
+
envName: result.record.envName,
|
|
106
|
+
commitSha: result.record.commitSha,
|
|
107
|
+
sourceEvent: result.record.sourceEvent,
|
|
108
|
+
supersededCount: result.superseded.length,
|
|
109
|
+
...(result.record.blockedReason !== undefined
|
|
110
|
+
? { blockedReason: result.record.blockedReason }
|
|
111
|
+
: {}),
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
outcome(ctx.res, {
|
|
115
|
+
outcome: 'run_queued',
|
|
116
|
+
runId: result.record.runId,
|
|
117
|
+
envName: result.record.envName,
|
|
118
|
+
superseded: result.superseded,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
async function cancelRuns(ctx, connection, filter) {
|
|
122
|
+
const canceled = await ctx.deps.runStore.cancelQueuedDeployRuns({
|
|
123
|
+
orgSlug: connection.orgSlug,
|
|
124
|
+
appSlug: connection.appSlug,
|
|
125
|
+
...filter,
|
|
126
|
+
});
|
|
127
|
+
if (canceled.length > 0) {
|
|
128
|
+
await ctx.deps.audit.emit({
|
|
129
|
+
eventType: 'github.webhook.runs_canceled',
|
|
130
|
+
org: connection.orgSlug,
|
|
131
|
+
app: connection.appSlug,
|
|
132
|
+
decision: 'allow',
|
|
133
|
+
status: 200,
|
|
134
|
+
details: {
|
|
135
|
+
deliveryId: ctx.deliveryId,
|
|
136
|
+
count: canceled.length,
|
|
137
|
+
...(filter.envName !== undefined ? { envName: filter.envName } : {}),
|
|
138
|
+
...(filter.ref !== undefined ? { ref: filter.ref } : {}),
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
outcome(ctx.res, { outcome: 'runs_canceled', canceled });
|
|
143
|
+
}
|
|
144
|
+
async function handlePush(ctx, payload) {
|
|
145
|
+
const connection = await boundConnection(ctx, payload);
|
|
146
|
+
if (connection === 'responded')
|
|
147
|
+
return;
|
|
148
|
+
const ref = typeof payload.ref === 'string' ? payload.ref : undefined;
|
|
149
|
+
if (ref === undefined)
|
|
150
|
+
return sendJson(ctx.res, 400, { error: 'malformed payload' });
|
|
151
|
+
if (payload.deleted === true)
|
|
152
|
+
return cancelRuns(ctx, connection, { ref });
|
|
153
|
+
const after = typeof payload.after === 'string' && payload.after.length > 0 ? payload.after : undefined;
|
|
154
|
+
if (after === undefined)
|
|
155
|
+
return sendJson(ctx.res, 400, { error: 'malformed payload' });
|
|
156
|
+
const actorLogin = senderLogin(payload);
|
|
157
|
+
if (ref !== `refs/heads/${connection.defaultBranch}`) {
|
|
158
|
+
// The pinned mapping: non-default-branch pushes with no PR produce NO run — an audit-level
|
|
159
|
+
// record only, so the runs feed stays signal.
|
|
160
|
+
await ctx.deps.audit.emit({
|
|
161
|
+
eventType: 'github.webhook.push_ignored',
|
|
162
|
+
org: connection.orgSlug,
|
|
163
|
+
app: connection.appSlug,
|
|
164
|
+
decision: 'allow',
|
|
165
|
+
status: 200,
|
|
166
|
+
details: { deliveryId: ctx.deliveryId, ref, commitSha: after },
|
|
167
|
+
});
|
|
168
|
+
return ignored(ctx.res, 'non_default_branch');
|
|
169
|
+
}
|
|
170
|
+
return recordRun(ctx, connection, {
|
|
171
|
+
envName: 'prod',
|
|
172
|
+
sourceEvent: 'push',
|
|
173
|
+
githubRepositoryId: connection.githubRepositoryId,
|
|
174
|
+
commitSha: after,
|
|
175
|
+
ref,
|
|
176
|
+
actorLogin,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
async function handlePullRequest(ctx, payload) {
|
|
180
|
+
const connection = await boundConnection(ctx, payload);
|
|
181
|
+
if (connection === 'responded')
|
|
182
|
+
return;
|
|
183
|
+
const pr = asRecord(payload.pull_request);
|
|
184
|
+
const number = positiveInt(pr?.number);
|
|
185
|
+
const head = asRecord(pr?.head);
|
|
186
|
+
const headSha = typeof head?.sha === 'string' ? head.sha : undefined;
|
|
187
|
+
const headRef = typeof head?.ref === 'string' ? head.ref : undefined;
|
|
188
|
+
const action = typeof payload.action === 'string' ? payload.action : undefined;
|
|
189
|
+
if (number === undefined ||
|
|
190
|
+
headSha === undefined ||
|
|
191
|
+
headRef === undefined ||
|
|
192
|
+
action === undefined) {
|
|
193
|
+
return sendJson(ctx.res, 400, { error: 'malformed payload' });
|
|
194
|
+
}
|
|
195
|
+
const envName = `pr-${number}`;
|
|
196
|
+
if (action === 'closed')
|
|
197
|
+
return cancelRuns(ctx, connection, { envName });
|
|
198
|
+
if (action !== 'opened' && action !== 'synchronize' && action !== 'reopened') {
|
|
199
|
+
return ignored(ctx.res, 'unhandled_action');
|
|
200
|
+
}
|
|
201
|
+
const headRepoId = positiveInt(asRecord(head?.repo)?.id);
|
|
202
|
+
// ADR 0111 §8: fork PRs are recorded but inert — no secrets, no build until owner approval.
|
|
203
|
+
const isFork = headRepoId !== connection.githubRepositoryId;
|
|
204
|
+
const actorLogin = senderLogin(payload);
|
|
205
|
+
return recordRun(ctx, connection, {
|
|
206
|
+
envName,
|
|
207
|
+
sourceEvent: 'pull_request',
|
|
208
|
+
githubRepositoryId: connection.githubRepositoryId,
|
|
209
|
+
commitSha: headSha,
|
|
210
|
+
ref: `refs/heads/${headRef}`,
|
|
211
|
+
prNumber: number,
|
|
212
|
+
actorLogin,
|
|
213
|
+
...(isFork ? { blockedReason: 'fork_pending_approval' } : {}),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
async function disableConnections(ctx, connections, reason) {
|
|
217
|
+
let count = 0;
|
|
218
|
+
for (const connection of connections) {
|
|
219
|
+
const disabled = await ctx.deps.connectionStore.disableRepoConnection(connection.orgSlug, connection.appSlug);
|
|
220
|
+
if (!disabled)
|
|
221
|
+
continue;
|
|
222
|
+
count += 1;
|
|
223
|
+
await ctx.deps.audit.emit({
|
|
224
|
+
eventType: 'github.webhook.connection_disabled',
|
|
225
|
+
org: connection.orgSlug,
|
|
226
|
+
app: connection.appSlug,
|
|
227
|
+
decision: 'allow',
|
|
228
|
+
status: 200,
|
|
229
|
+
details: {
|
|
230
|
+
deliveryId: ctx.deliveryId,
|
|
231
|
+
githubRepositoryId: connection.githubRepositoryId,
|
|
232
|
+
reason,
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
if (count === 0)
|
|
237
|
+
return ignored(ctx.res, 'no_connection');
|
|
238
|
+
outcome(ctx.res, { outcome: 'connection_disabled', count });
|
|
239
|
+
}
|
|
240
|
+
async function handleRepository(ctx, payload) {
|
|
241
|
+
const connection = await boundConnection(ctx, payload);
|
|
242
|
+
if (connection === 'responded')
|
|
243
|
+
return;
|
|
244
|
+
const action = typeof payload.action === 'string' ? payload.action : undefined;
|
|
245
|
+
const repository = asRecord(payload.repository);
|
|
246
|
+
if (action === 'archived')
|
|
247
|
+
return disableConnections(ctx, [connection], 'repository_archived');
|
|
248
|
+
if (action === 'renamed' || action === 'transferred' || action === 'edited') {
|
|
249
|
+
const fullName = typeof repository?.full_name === 'string' ? repository.full_name : undefined;
|
|
250
|
+
const defaultBranch = typeof repository?.default_branch === 'string' ? repository.default_branch : undefined;
|
|
251
|
+
const refreshed = await ctx.deps.connectionStore.refreshRepoMetadata(connection.githubRepositoryId, {
|
|
252
|
+
...(fullName !== undefined
|
|
253
|
+
? { repoName: fullName, ownerLogin: fullName.split('/')[0] ?? connection.ownerLogin }
|
|
254
|
+
: {}),
|
|
255
|
+
...(defaultBranch !== undefined ? { defaultBranch } : {}),
|
|
256
|
+
});
|
|
257
|
+
if (refreshed === undefined)
|
|
258
|
+
return ignored(ctx.res, 'no_connection');
|
|
259
|
+
await ctx.deps.audit.emit({
|
|
260
|
+
eventType: 'github.webhook.metadata_refreshed',
|
|
261
|
+
org: connection.orgSlug,
|
|
262
|
+
app: connection.appSlug,
|
|
263
|
+
decision: 'allow',
|
|
264
|
+
status: 200,
|
|
265
|
+
details: { deliveryId: ctx.deliveryId, githubRepositoryId: connection.githubRepositoryId },
|
|
266
|
+
});
|
|
267
|
+
return outcome(ctx.res, { outcome: 'metadata_refreshed' });
|
|
268
|
+
}
|
|
269
|
+
return ignored(ctx.res, 'unhandled_action');
|
|
270
|
+
}
|
|
271
|
+
async function handleInstallation(ctx, payload) {
|
|
272
|
+
const action = typeof payload.action === 'string' ? payload.action : undefined;
|
|
273
|
+
const installationId = positiveInt(asRecord(payload.installation)?.id);
|
|
274
|
+
if (installationId === undefined)
|
|
275
|
+
return sendJson(ctx.res, 400, { error: 'malformed payload' });
|
|
276
|
+
if (action !== 'deleted')
|
|
277
|
+
return ignored(ctx.res, 'unhandled_action');
|
|
278
|
+
const connections = await ctx.deps.connectionStore.listRepoConnectionsByInstallation(installationId);
|
|
279
|
+
return disableConnections(ctx, connections, 'installation_removed');
|
|
280
|
+
}
|
|
281
|
+
async function handleInstallationRepositories(ctx, payload) {
|
|
282
|
+
const action = typeof payload.action === 'string' ? payload.action : undefined;
|
|
283
|
+
if (action !== 'removed')
|
|
284
|
+
return ignored(ctx.res, 'unhandled_action');
|
|
285
|
+
const installationId = positiveInt(asRecord(payload.installation)?.id);
|
|
286
|
+
if (installationId === undefined)
|
|
287
|
+
return sendJson(ctx.res, 400, { error: 'malformed payload' });
|
|
288
|
+
const removed = Array.isArray(payload.repositories_removed) ? payload.repositories_removed : [];
|
|
289
|
+
const connections = [];
|
|
290
|
+
for (const item of removed) {
|
|
291
|
+
const id = positiveInt(asRecord(item)?.id);
|
|
292
|
+
if (id === undefined)
|
|
293
|
+
continue;
|
|
294
|
+
const connection = await ctx.deps.connectionStore.getRepoConnectionByRepository(id);
|
|
295
|
+
// Same repository+installation binding rule as every other event: a delivery for installation X
|
|
296
|
+
// must never disable a repo bound under installation Y.
|
|
297
|
+
if (connection !== undefined && connection.installationId === installationId) {
|
|
298
|
+
connections.push(connection);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return disableConnections(ctx, connections, 'repository_removed_from_installation');
|
|
302
|
+
}
|
|
303
|
+
export async function handleGithubWebhook(req, res, deps) {
|
|
304
|
+
// Fail closed when the feature is unconfigured: with no secret there is nothing to verify against.
|
|
305
|
+
if (deps.webhookSecret === undefined || deps.webhookSecret.length === 0) {
|
|
306
|
+
return sendJson(res, 403, { error: 'webhook not configured' });
|
|
307
|
+
}
|
|
308
|
+
const body = await readRawBody(req, deps.maxBody);
|
|
309
|
+
if (!body.ok)
|
|
310
|
+
return sendJson(res, 413, { error: 'request body too large' });
|
|
311
|
+
// Layer 1: the signature, over raw bytes, before ANY header/JSON interpretation.
|
|
312
|
+
const signature = req.headers[SIGNATURE_HEADER];
|
|
313
|
+
const signatureValue = Array.isArray(signature) ? signature[0] : signature;
|
|
314
|
+
if (!verifyWebhookSignature(body.raw, signatureValue, deps.webhookSecret)) {
|
|
315
|
+
return sendJson(res, 401, { error: 'invalid signature' });
|
|
316
|
+
}
|
|
317
|
+
// Layer 2: required delivery headers.
|
|
318
|
+
const eventHeader = req.headers['x-github-event'];
|
|
319
|
+
const deliveryHeader = req.headers['x-github-delivery'];
|
|
320
|
+
const eventName = Array.isArray(eventHeader) ? eventHeader[0] : eventHeader;
|
|
321
|
+
const deliveryId = Array.isArray(deliveryHeader) ? deliveryHeader[0] : deliveryHeader;
|
|
322
|
+
if (eventName === undefined || deliveryId === undefined || deliveryId.length === 0) {
|
|
323
|
+
return sendJson(res, 400, { error: 'missing event headers' });
|
|
324
|
+
}
|
|
325
|
+
// Layer 3: payload shape.
|
|
326
|
+
let payload;
|
|
327
|
+
try {
|
|
328
|
+
const parsed = JSON.parse(body.raw.toString('utf8'));
|
|
329
|
+
const record = asRecord(parsed);
|
|
330
|
+
if (record === undefined)
|
|
331
|
+
return sendJson(res, 400, { error: 'malformed payload' });
|
|
332
|
+
payload = record;
|
|
333
|
+
}
|
|
334
|
+
catch {
|
|
335
|
+
return sendJson(res, 400, { error: 'malformed payload' });
|
|
336
|
+
}
|
|
337
|
+
const ctx = { deliveryId, deps, res };
|
|
338
|
+
switch (eventName) {
|
|
339
|
+
case 'push':
|
|
340
|
+
return handlePush(ctx, payload);
|
|
341
|
+
case 'pull_request':
|
|
342
|
+
return handlePullRequest(ctx, payload);
|
|
343
|
+
case 'repository':
|
|
344
|
+
return handleRepository(ctx, payload);
|
|
345
|
+
case 'installation':
|
|
346
|
+
return handleInstallation(ctx, payload);
|
|
347
|
+
case 'installation_repositories':
|
|
348
|
+
return handleInstallationRepositories(ctx, payload);
|
|
349
|
+
default:
|
|
350
|
+
// The subscribed-event set can drift ahead of the handled set — unknown events are safely
|
|
351
|
+
// acknowledged so GitHub never retries them.
|
|
352
|
+
return ignored(res, 'unsupported_event');
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
//# sourceMappingURL=github-webhook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-webhook.js","sourceRoot":"","sources":["../../src/routes/github-webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAiC3C,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAE/C,iGAAiG;AACjG,MAAM,UAAU,sBAAsB,CACpC,OAAe,EACf,eAAmC,EACnC,MAAc;IAEd,IAAI,eAAe,KAAK,SAAS,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1F,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACzD,+FAA+F;IAC/F,mEAAmE;IACnE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IACpD,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;IACvE,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACjD,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YACf,OAAO,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACxC,KAAK,cAAc;YACjB,OAAO,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC1C,KAAK,2BAA2B;YAC9B,OAAO,8BAA8B,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACtD;YACE,0FAA0F;YAC1F,6CAA6C;YAC7C,OAAO,OAAO,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dispatch for the org-admin control-plane routes: the orgs collection, the single-org item
|
|
3
|
+
* (PATCH rename / GET inspect), members, and invitations. Extracted verbatim from `service.ts`
|
|
4
|
+
* (which stays a thin composition root under the size gate), the same way as
|
|
5
|
+
* `analytics-dispatch.ts`/`github-dispatch.ts`. The path families here (`/v1/orgs`,
|
|
6
|
+
* `/v1/orgs/{org}`, `.../members`, `.../invitations`) are disjoint from the ADR 0128 resource
|
|
7
|
+
* reads (`apps`/`envs`/`deployments`), so this dispatcher's position next to them in the
|
|
8
|
+
* composition root is not behavior-bearing.
|
|
9
|
+
*/
|
|
10
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
11
|
+
import type { TlsPosture } from '@noodle-borg/transport-http';
|
|
12
|
+
import type { DeployAuthGate } from '../auth/deploy-gate.js';
|
|
13
|
+
import type { AuditSink } from '../store/audit.js';
|
|
14
|
+
import type { ControlPlaneStore } from '../store.js';
|
|
15
|
+
export interface OrgAdminDispatchDeps {
|
|
16
|
+
readonly gate: DeployAuthGate;
|
|
17
|
+
readonly controlPlane: ControlPlaneStore;
|
|
18
|
+
readonly audit: AuditSink;
|
|
19
|
+
readonly maxBody: number;
|
|
20
|
+
readonly applySecurityHeaders: (res: ServerResponse, tls: TlsPosture) => void;
|
|
21
|
+
readonly enforceHttps: (req: IncomingMessage, res: ServerResponse, tls: TlsPosture) => boolean;
|
|
22
|
+
readonly sendJson: (res: ServerResponse, status: number, body: unknown) => void;
|
|
23
|
+
readonly tls: TlsPosture;
|
|
24
|
+
}
|
|
25
|
+
/** Try the org-admin routes; returns true when the request was handled (or a guard ended it). */
|
|
26
|
+
export declare function dispatchOrgAdminRoutes(req: IncomingMessage, res: ServerResponse, url: URL, deps: OrgAdminDispatchDeps): boolean;
|
|
27
|
+
//# sourceMappingURL=org-admin-dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-admin-dispatch.d.ts","sourceRoot":"","sources":["../../src/routes/org-admin-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAUrD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,oBAAoB,EAAE,CAAC,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,UAAU,KAAK,IAAI,CAAC;IAC9E,QAAQ,CAAC,YAAY,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,UAAU,KAAK,OAAO,CAAC;IAC/F,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,I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