@noodleseed/one 0.17.0 → 0.18.0
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/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/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/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
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { noopLogger } from '@noodle-borg/transport-http';
|
|
2
|
+
import { buildAlertWebhookPayload, deliverAlertWebhook, } from './alert-webhook.js';
|
|
3
|
+
import { aggregateRequestEvents } from './request-event-metrics.js';
|
|
4
|
+
/**
|
|
5
|
+
* Periodic alert-rule evaluator (E2, ADR 0130), modeled on `ArchiveSweeper`: a throttled
|
|
6
|
+
* `maybeSweep()` (boot + a `serveService` interval timer) drives `sweepNow()`, which evaluates
|
|
7
|
+
* every ENABLED rule against its own window of the tenant's request-event stream using the same
|
|
8
|
+
* `aggregateRequestEvents` the metrics route serves — one aggregation, no duplicate math.
|
|
9
|
+
*
|
|
10
|
+
* EDGE-TRIGGERED: a rule fires on the non-breaching → breaching transition, and re-fires while
|
|
11
|
+
* still breaching only after `cooldownMinutes` since the last fire. Delivery is a single attempt;
|
|
12
|
+
* a failed delivery still stamps `lastFiredAt` so the sweep never becomes a retry loop (retries/
|
|
13
|
+
* backoff are an explicit E3 deferral). Firing state persists so edge-triggering survives restarts.
|
|
14
|
+
*
|
|
15
|
+
* Logging is closed-vocabulary + rule id + HTTP status only — the webhook URL is sensitive and
|
|
16
|
+
* never appears in any log line.
|
|
17
|
+
*
|
|
18
|
+
* Instance scope: the sweep is per-instance (in-flight-guarded and throttled locally). On a
|
|
19
|
+
* multi-instance deployment two instances can each fire the same breach once before the shared
|
|
20
|
+
* firing state persists — a duplicate notification, never lost/corrupted state. A cross-instance
|
|
21
|
+
* atomic fire claim is an explicit E3 deferral (ADR 0130).
|
|
22
|
+
*/
|
|
23
|
+
export const ALERT_EVALUATION_INTERVAL_MS = 60_000;
|
|
24
|
+
/** Same bounded read as the metrics route (`METRICS_SCAN_LIMIT`). */
|
|
25
|
+
const EVAL_SCAN_LIMIT = 50_000;
|
|
26
|
+
/** The observed value a rule compares against its threshold, per metric. */
|
|
27
|
+
export function observedMetricValue(metric, metrics) {
|
|
28
|
+
switch (metric) {
|
|
29
|
+
case 'error_share':
|
|
30
|
+
return metrics.errors.errorRate;
|
|
31
|
+
case 'error_count':
|
|
32
|
+
return metrics.errors.toolErrors + metrics.errors.mcpErrors;
|
|
33
|
+
case 'calls':
|
|
34
|
+
return metrics.totals.requests;
|
|
35
|
+
case 'p95_ms':
|
|
36
|
+
return metrics.latency.p95Ms;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export class AlertEvaluator {
|
|
40
|
+
#alertRules;
|
|
41
|
+
#requestEvents;
|
|
42
|
+
#allowLoopback;
|
|
43
|
+
#deliver;
|
|
44
|
+
#clock;
|
|
45
|
+
#logger;
|
|
46
|
+
#intervalMs;
|
|
47
|
+
#lastSweepStartedAt;
|
|
48
|
+
#sweepInFlight = false;
|
|
49
|
+
constructor(options) {
|
|
50
|
+
this.#alertRules = options.alertRules;
|
|
51
|
+
this.#requestEvents = options.requestEvents;
|
|
52
|
+
this.#allowLoopback = options.allowLoopbackWebhooks === true;
|
|
53
|
+
this.#deliver =
|
|
54
|
+
options.deliver ??
|
|
55
|
+
((url, payload, deliverOptions) => deliverAlertWebhook(url, payload, deliverOptions));
|
|
56
|
+
this.#clock = options.clock ?? (() => new Date());
|
|
57
|
+
this.#logger = options.logger ?? noopLogger;
|
|
58
|
+
this.#intervalMs = options.intervalMs ?? ALERT_EVALUATION_INTERVAL_MS;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Throttled, fire-and-forget sweep (the serve-time interval calls this): never throws, and
|
|
62
|
+
* never overlaps — a sweep that outlives the interval (slow store/webhook timeouts) must not
|
|
63
|
+
* race a second sweep into double-delivering the same breach before state persists.
|
|
64
|
+
*/
|
|
65
|
+
maybeSweep() {
|
|
66
|
+
if (this.#sweepInFlight)
|
|
67
|
+
return;
|
|
68
|
+
const now = this.#clock().getTime();
|
|
69
|
+
if (this.#lastSweepStartedAt !== undefined &&
|
|
70
|
+
now - this.#lastSweepStartedAt < this.#intervalMs) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
this.#lastSweepStartedAt = now;
|
|
74
|
+
this.#sweepInFlight = true;
|
|
75
|
+
void this.sweepNow()
|
|
76
|
+
.catch((error) => {
|
|
77
|
+
this.#logger.warn('alert.sweep.failed', {
|
|
78
|
+
message: error instanceof Error ? error.message : String(error),
|
|
79
|
+
});
|
|
80
|
+
})
|
|
81
|
+
.finally(() => {
|
|
82
|
+
this.#sweepInFlight = false;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
async sweepNow() {
|
|
86
|
+
const rules = await this.#alertRules.listEnabledAlertRules();
|
|
87
|
+
let fired = 0;
|
|
88
|
+
for (const rule of rules) {
|
|
89
|
+
try {
|
|
90
|
+
if (await this.#evaluateRule(rule))
|
|
91
|
+
fired += 1;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
// One bad rule (store fault, throwing delivery seam) must not starve the others. Store
|
|
95
|
+
// errors never carry the webhook URL; delivery outcomes are closed codes by construction.
|
|
96
|
+
this.#logger.warn('alert.evaluate.failed', {
|
|
97
|
+
ruleId: rule.id,
|
|
98
|
+
message: error instanceof Error ? error.name : 'unknown',
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return { evaluated: rules.length, fired };
|
|
103
|
+
}
|
|
104
|
+
async #evaluateRule(rule) {
|
|
105
|
+
const now = this.#clock();
|
|
106
|
+
const since = new Date(now.getTime() - rule.windowMinutes * 60_000).toISOString();
|
|
107
|
+
const events = await this.#requestEvents.list({
|
|
108
|
+
org: rule.orgSlug,
|
|
109
|
+
app: rule.appSlug,
|
|
110
|
+
env: rule.environment,
|
|
111
|
+
since,
|
|
112
|
+
limit: EVAL_SCAN_LIMIT,
|
|
113
|
+
});
|
|
114
|
+
const observed = observedMetricValue(rule.metric, aggregateRequestEvents(events));
|
|
115
|
+
const breaching = observed >= rule.threshold;
|
|
116
|
+
const transition = breaching && !rule.breaching;
|
|
117
|
+
const cooldownElapsed = rule.lastFiredAt === undefined ||
|
|
118
|
+
now.getTime() - Date.parse(rule.lastFiredAt) >= rule.cooldownMinutes * 60_000;
|
|
119
|
+
const shouldFire = transition || (breaching && rule.breaching && cooldownElapsed);
|
|
120
|
+
if (shouldFire) {
|
|
121
|
+
const firedAt = now.toISOString();
|
|
122
|
+
const payload = buildAlertWebhookPayload(rule, 'breach', observed, firedAt);
|
|
123
|
+
const outcome = await this.#deliver(rule.webhookUrl, payload, {
|
|
124
|
+
allowLoopback: this.#allowLoopback,
|
|
125
|
+
});
|
|
126
|
+
if (outcome.delivered) {
|
|
127
|
+
this.#logger.info('alert.webhook.delivered', {
|
|
128
|
+
ruleId: rule.id,
|
|
129
|
+
status: outcome.status ?? 0,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
this.#logger.warn('alert.webhook.failed', {
|
|
134
|
+
ruleId: rule.id,
|
|
135
|
+
reason: outcome.reason ?? 'unknown',
|
|
136
|
+
...(outcome.status !== undefined ? { status: outcome.status } : {}),
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
// Stamp the fire regardless of delivery outcome: a single attempt, never a retry loop (E3).
|
|
140
|
+
await this.#alertRules.updateAlertFiringState(rule.id, {
|
|
141
|
+
breaching: true,
|
|
142
|
+
lastObserved: observed,
|
|
143
|
+
lastFiredAt: firedAt,
|
|
144
|
+
});
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
if (breaching !== rule.breaching) {
|
|
148
|
+
// Recovery (or a breach the fire path above already covers): persist the edge so the next
|
|
149
|
+
// crossing is a fresh transition. `lastFiredAt` is preserved by omission.
|
|
150
|
+
await this.#alertRules.updateAlertFiringState(rule.id, {
|
|
151
|
+
breaching,
|
|
152
|
+
lastObserved: observed,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=alert-evaluator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-evaluator.js","sourceRoot":"","sources":["../src/alert-evaluator.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAGL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAuB,MAAM,4BAA4B,CAAC;AAGzF;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;AACnD,qEAAqE;AACrE,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B,4EAA4E;AAC5E,MAAM,UAAU,mBAAmB,CAAC,MAAmB,EAAE,OAAuB;IAC9E,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,aAAa;YAChB,OAAO,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;QAClC,KAAK,aAAa;YAChB,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;QAC9D,KAAK,OAAO;YACV,OAAO,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;QACjC,KAAK,QAAQ;YACX,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;IACjC,CAAC;AACH,CAAC;AAoBD,MAAM,OAAO,cAAc;IAChB,WAAW,CAAiB;IAC5B,cAAc,CAAoB;IAClC,cAAc,CAAU;IACxB,QAAQ,CAAgD;IACxD,MAAM,CAAa;IACnB,OAAO,CAAS;IAChB,WAAW,CAAS;IAC7B,mBAAmB,CAAqB;IACxC,cAAc,GAAG,KAAK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M,EAAE,OAAO,CAAC,MAAM,IAAI,SAAS;oBACnC,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBACpE,CAAC,CAAC;YACL,CAAC;YACD,4FAA4F;YAC5F,MAAM,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,EAAE;gBACrD,SAAS,EAAE,IAAI;gBACf,YAAY,EAAE,QAAQ;gBACtB,WAAW,EAAE,OAAO;aACrB,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,SAAS,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;YACjC,0FAA0F;YAC1F,0EAA0E;YAC1E,MAAM,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,EAAE;gBACrD,SAAS;gBACT,YAAY,EAAE,QAAQ;aACvB,CAAC,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type DnsLookup } from '@noodle-borg/connector-http';
|
|
2
|
+
import type { AlertMetric, AlertRuleRecord } from './store/alert-rules.js';
|
|
3
|
+
/**
|
|
4
|
+
* Alert webhook delivery (E2, ADR 0130): a single POST attempt with a bounded timeout through the
|
|
5
|
+
* shared SSRF guard (`guardedFetch` pins DNS resolutions to public unicast addresses — the same
|
|
6
|
+
* anti-rebinding layer the HTTP connector uses). No retries, no backoff queue (deferred to E3).
|
|
7
|
+
*
|
|
8
|
+
* The webhook URL is SENSITIVE (it may embed capability tokens). Nothing this module returns or
|
|
9
|
+
* throws carries the URL, its host, or an upstream error message: outcomes are closed-vocabulary
|
|
10
|
+
* reason codes plus the HTTP status, safe to log verbatim.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ALERT_WEBHOOK_SCHEMA_VERSION = 1;
|
|
13
|
+
export interface AlertWebhookPayload {
|
|
14
|
+
readonly schemaVersion: typeof ALERT_WEBHOOK_SCHEMA_VERSION;
|
|
15
|
+
readonly event: 'breach' | 'test';
|
|
16
|
+
readonly org: string;
|
|
17
|
+
readonly app: string;
|
|
18
|
+
readonly env: string;
|
|
19
|
+
readonly rule: {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly name?: string;
|
|
22
|
+
readonly metric: AlertMetric;
|
|
23
|
+
readonly threshold: number;
|
|
24
|
+
readonly windowMinutes: number;
|
|
25
|
+
readonly comparison: '>=';
|
|
26
|
+
};
|
|
27
|
+
readonly observed: number;
|
|
28
|
+
readonly firedAt: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function buildAlertWebhookPayload(rule: AlertRuleRecord, event: 'breach' | 'test', observed: number, firedAt: string): AlertWebhookPayload;
|
|
31
|
+
/** Closed-vocabulary outcome — safe to log and to return to callers (never carries the URL). */
|
|
32
|
+
export interface AlertWebhookDelivery {
|
|
33
|
+
readonly delivered: boolean;
|
|
34
|
+
readonly status?: number;
|
|
35
|
+
readonly reason?: 'invalid_url' | 'egress_blocked' | 'timeout' | 'network_error' | 'http_error';
|
|
36
|
+
}
|
|
37
|
+
export interface WebhookUrlPolicy {
|
|
38
|
+
/**
|
|
39
|
+
* Development/test-only carve-out: allow `http://localhost`, `http://127.0.0.1`, and `[::1]`
|
|
40
|
+
* targets (mirrors `customerVerifierAllowInsecureLocalhost`). Off in production: webhooks are
|
|
41
|
+
* https-only and literal private/reserved IPs are rejected outright.
|
|
42
|
+
*/
|
|
43
|
+
readonly allowLoopback: boolean;
|
|
44
|
+
}
|
|
45
|
+
export type WebhookUrlValidation = {
|
|
46
|
+
ok: true;
|
|
47
|
+
url: URL;
|
|
48
|
+
} | {
|
|
49
|
+
ok: false;
|
|
50
|
+
error: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Policy validation for a webhook URL, applied at rule create/test time AND re-applied on every
|
|
54
|
+
* delivery (defense in depth for stored rules). Error messages are generic policy text — they
|
|
55
|
+
* never echo the URL, host, or credentials back.
|
|
56
|
+
*/
|
|
57
|
+
export declare function validateAlertWebhookUrl(raw: string, policy: WebhookUrlPolicy): WebhookUrlValidation;
|
|
58
|
+
export interface DeliverAlertWebhookOptions {
|
|
59
|
+
readonly allowLoopback?: boolean;
|
|
60
|
+
/** Whole-attempt bound. Default 10s. */
|
|
61
|
+
readonly timeoutMs?: number;
|
|
62
|
+
/** Injectable DNS resolver for SSRF tests (threaded into the guarded agent). */
|
|
63
|
+
readonly lookup?: DnsLookup;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Single-attempt webhook POST. Loopback targets (dev carve-out) use the plain platform fetch —
|
|
67
|
+
* the pinned lookup would reject loopback resolutions by design; everything else goes through
|
|
68
|
+
* {@link guardedFetch}. Redirects are not followed (a redirect could re-point the request at an
|
|
69
|
+
* unguarded literal-IP target); a 3xx reports as an ordinary non-2xx outcome.
|
|
70
|
+
*/
|
|
71
|
+
export declare function deliverAlertWebhook(rawUrl: string, payload: AlertWebhookPayload, options?: DeliverAlertWebhookOptions): Promise<AlertWebhookDelivery>;
|
|
72
|
+
//# sourceMappingURL=alert-webhook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-webhook.d.ts","sourceRoot":"","sources":["../src/alert-webhook.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAiC,MAAM,6BAA6B,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE3E;;;;;;;;GAQG;AAEH,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAI9C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,aAAa,EAAE,OAAO,4BAA4B,CAAC;IAC5D,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,GAAG,EAAE,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,MAAM,EAAE,gBAAgB,GACvB,oBAAoB,CAmCtB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,wCAAwC;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,gFAAgF;IAChF,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,oBAAoB,CAAC,CAkC/B"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { isIP } from 'node:net';
|
|
2
|
+
import { guardedFetch, isPublicUnicast } from '@noodle-borg/connector-http';
|
|
3
|
+
/**
|
|
4
|
+
* Alert webhook delivery (E2, ADR 0130): a single POST attempt with a bounded timeout through the
|
|
5
|
+
* shared SSRF guard (`guardedFetch` pins DNS resolutions to public unicast addresses — the same
|
|
6
|
+
* anti-rebinding layer the HTTP connector uses). No retries, no backoff queue (deferred to E3).
|
|
7
|
+
*
|
|
8
|
+
* The webhook URL is SENSITIVE (it may embed capability tokens). Nothing this module returns or
|
|
9
|
+
* throws carries the URL, its host, or an upstream error message: outcomes are closed-vocabulary
|
|
10
|
+
* reason codes plus the HTTP status, safe to log verbatim.
|
|
11
|
+
*/
|
|
12
|
+
export const ALERT_WEBHOOK_SCHEMA_VERSION = 1;
|
|
13
|
+
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
14
|
+
const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '::1']);
|
|
15
|
+
export function buildAlertWebhookPayload(rule, event, observed, firedAt) {
|
|
16
|
+
return {
|
|
17
|
+
schemaVersion: ALERT_WEBHOOK_SCHEMA_VERSION,
|
|
18
|
+
event,
|
|
19
|
+
org: rule.orgSlug,
|
|
20
|
+
app: rule.appSlug,
|
|
21
|
+
env: rule.environment,
|
|
22
|
+
rule: {
|
|
23
|
+
id: rule.id,
|
|
24
|
+
...(rule.name !== undefined ? { name: rule.name } : {}),
|
|
25
|
+
metric: rule.metric,
|
|
26
|
+
threshold: rule.threshold,
|
|
27
|
+
windowMinutes: rule.windowMinutes,
|
|
28
|
+
comparison: rule.comparison,
|
|
29
|
+
},
|
|
30
|
+
observed,
|
|
31
|
+
firedAt,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Policy validation for a webhook URL, applied at rule create/test time AND re-applied on every
|
|
36
|
+
* delivery (defense in depth for stored rules). Error messages are generic policy text — they
|
|
37
|
+
* never echo the URL, host, or credentials back.
|
|
38
|
+
*/
|
|
39
|
+
export function validateAlertWebhookUrl(raw, policy) {
|
|
40
|
+
let url;
|
|
41
|
+
try {
|
|
42
|
+
url = new URL(raw);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return { ok: false, error: '"webhookUrl" must be a valid absolute URL' };
|
|
46
|
+
}
|
|
47
|
+
if (url.username !== '' || url.password !== '') {
|
|
48
|
+
return { ok: false, error: '"webhookUrl" must not embed credentials' };
|
|
49
|
+
}
|
|
50
|
+
const host = url.hostname.replace(/^\[|\]$/g, '');
|
|
51
|
+
const loopback = LOOPBACK_HOSTS.has(host);
|
|
52
|
+
if (url.protocol === 'http:') {
|
|
53
|
+
if (loopback && policy.allowLoopback)
|
|
54
|
+
return { ok: true, url };
|
|
55
|
+
return {
|
|
56
|
+
ok: false,
|
|
57
|
+
error: '"webhookUrl" must use https (plain http is allowed only for loopback targets outside production)',
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (url.protocol !== 'https:') {
|
|
61
|
+
return { ok: false, error: '"webhookUrl" must use https' };
|
|
62
|
+
}
|
|
63
|
+
if (loopback) {
|
|
64
|
+
return policy.allowLoopback
|
|
65
|
+
? { ok: true, url }
|
|
66
|
+
: { ok: false, error: '"webhookUrl" must not target a loopback address' };
|
|
67
|
+
}
|
|
68
|
+
// Literal IPs carry no DNS step for the delivery-time guard to pin, so they are policy-checked
|
|
69
|
+
// here: only public unicast addresses are accepted (blocks 10/8, 172.16/12, 192.168/16,
|
|
70
|
+
// link-local incl. the cloud metadata address, and other reserved ranges).
|
|
71
|
+
if (isIP(host) !== 0 && !isPublicUnicast(host)) {
|
|
72
|
+
return { ok: false, error: '"webhookUrl" must not target a private or reserved IP address' };
|
|
73
|
+
}
|
|
74
|
+
return { ok: true, url };
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Single-attempt webhook POST. Loopback targets (dev carve-out) use the plain platform fetch —
|
|
78
|
+
* the pinned lookup would reject loopback resolutions by design; everything else goes through
|
|
79
|
+
* {@link guardedFetch}. Redirects are not followed (a redirect could re-point the request at an
|
|
80
|
+
* unguarded literal-IP target); a 3xx reports as an ordinary non-2xx outcome.
|
|
81
|
+
*/
|
|
82
|
+
export async function deliverAlertWebhook(rawUrl, payload, options = {}) {
|
|
83
|
+
const validated = validateAlertWebhookUrl(rawUrl, {
|
|
84
|
+
allowLoopback: options.allowLoopback === true,
|
|
85
|
+
});
|
|
86
|
+
if (!validated.ok)
|
|
87
|
+
return { delivered: false, reason: 'invalid_url' };
|
|
88
|
+
const init = {
|
|
89
|
+
method: 'POST',
|
|
90
|
+
headers: {
|
|
91
|
+
'content-type': 'application/json; charset=utf-8',
|
|
92
|
+
'user-agent': 'noodleseed-alerts/1',
|
|
93
|
+
},
|
|
94
|
+
body: JSON.stringify(payload),
|
|
95
|
+
redirect: 'manual',
|
|
96
|
+
signal: AbortSignal.timeout(options.timeoutMs ?? DEFAULT_TIMEOUT_MS),
|
|
97
|
+
};
|
|
98
|
+
const host = validated.url.hostname.replace(/^\[|\]$/g, '');
|
|
99
|
+
try {
|
|
100
|
+
const response = LOOPBACK_HOSTS.has(host)
|
|
101
|
+
? await fetch(validated.url, init)
|
|
102
|
+
: await guardedFetch(validated.url, init, {
|
|
103
|
+
...(options.timeoutMs !== undefined ? { connectTimeoutMs: options.timeoutMs } : {}),
|
|
104
|
+
...(options.lookup !== undefined ? { lookup: options.lookup } : {}),
|
|
105
|
+
});
|
|
106
|
+
// Drain/cancel the body — the response content is untrusted and unbounded; only the status matters.
|
|
107
|
+
try {
|
|
108
|
+
await response.body?.cancel();
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
// ignore: some bodies are already consumed/closed
|
|
112
|
+
}
|
|
113
|
+
if (response.ok)
|
|
114
|
+
return { delivered: true, status: response.status };
|
|
115
|
+
return { delivered: false, status: response.status, reason: 'http_error' };
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
return { delivered: false, reason: classifyDeliveryError(error) };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** Map a fetch failure to a closed reason code — upstream messages may embed the URL/host. */
|
|
122
|
+
function classifyDeliveryError(error) {
|
|
123
|
+
if (error instanceof Error) {
|
|
124
|
+
if (error.name === 'TimeoutError' || error.name === 'AbortError')
|
|
125
|
+
return 'timeout';
|
|
126
|
+
if (error.message.startsWith('egress blocked:'))
|
|
127
|
+
return 'egress_blocked';
|
|
128
|
+
const cause = error.cause;
|
|
129
|
+
if (cause instanceof Error && cause.message.startsWith('egress blocked:')) {
|
|
130
|
+
return 'egress_blocked';
|
|
131
|
+
}
|
|
132
|
+
if (cause instanceof Error && (cause.name === 'TimeoutError' || cause.name === 'AbortError')) {
|
|
133
|
+
return 'timeout';
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return 'network_error';
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=alert-webhook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-webhook.js","sourceRoot":"","sources":["../src/alert-webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAkB,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG5F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* flow redirects the installer's BROWSER to the GitHub App's configured "Setup URL" once the install
|
|
4
4
|
* completes — a request the CLI process cannot receive directly (it has no public callback endpoint of
|
|
5
5
|
* its own). `GET /v1/github/setup` (`../routes/github-setup.ts`) IS that Setup URL: it lands the
|
|
@@ -8,10 +8,14 @@
|
|
|
8
8
|
* (same file) until the entry appears, then proceeds to `POST /v1/github/installations/claim`.
|
|
9
9
|
*
|
|
10
10
|
* Entries expire on the same 10-minute TTL as the nonce itself (`install-nonce.ts`) so a stale poll can
|
|
11
|
-
* never resurrect an old install correlation.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* never resurrect an old install correlation. The interface is async because a multi-instance
|
|
12
|
+
* deployment backs it with Postgres (`PostgresArtifactStore` implements it — GHD-2 closed the gap
|
|
13
|
+
* flagged in the GHD-1 review): the setup redirect and the CLI poll can land on different instances,
|
|
14
|
+
* so the hand-off must live in the shared store. The in-memory backend remains the single-instance
|
|
15
|
+
* dev/test default.
|
|
14
16
|
*/
|
|
17
|
+
/** Shared hand-off TTL — mirrors the install-nonce TTL so neither side outlives the other. */
|
|
18
|
+
export declare const PENDING_GITHUB_INSTALLATION_TTL_MS: number;
|
|
15
19
|
export interface PendingGithubInstallationStore {
|
|
16
20
|
/**
|
|
17
21
|
* Record that the setup redirect landed for `state`, carrying the installationId GitHub reported.
|
|
@@ -19,13 +23,16 @@ export interface PendingGithubInstallationStore {
|
|
|
19
23
|
* redirect cannot overwrite the recorded installation (hardening: the repo-confirm step and the
|
|
20
24
|
* repo-in-installation re-verification already blunt a swapped id; this closes the race outright).
|
|
21
25
|
*/
|
|
22
|
-
put(state: string, installationId: number): void
|
|
26
|
+
put(state: string, installationId: number): Promise<void>;
|
|
23
27
|
/** The installationId stashed for `state`, or `undefined` if it hasn't landed yet (or has expired). */
|
|
24
|
-
get(state: string): number | undefined
|
|
28
|
+
get(state: string): Promise<number | undefined>;
|
|
25
29
|
}
|
|
26
30
|
export declare class InMemoryPendingGithubInstallationStore implements PendingGithubInstallationStore {
|
|
27
31
|
#private;
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
constructor(options?: {
|
|
33
|
+
now?: () => Date;
|
|
34
|
+
});
|
|
35
|
+
put(state: string, installationId: number): Promise<void>;
|
|
36
|
+
get(state: string): Promise<number | undefined>;
|
|
30
37
|
}
|
|
31
38
|
//# sourceMappingURL=pending-installations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-installations.d.ts","sourceRoot":"","sources":["../../src/github/pending-installations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pending-installations.d.ts","sourceRoot":"","sources":["../../src/github/pending-installations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8FAA8F;AAC9F,eAAO,MAAM,kCAAkC,QAAiB,CAAC;AAOjE,MAAM,WAAW,8BAA8B;IAC7C;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,uGAAuG;IACvG,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACjD;AAED,qBAAa,sCAAuC,YAAW,8BAA8B;;gBAI/E,OAAO,GAAE;QAAE,GAAG,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO;IAIxC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzD,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAStD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Hand-off store for the CLI `noodle github connect` poll (GHD-1.4). GitHub's installation
|
|
3
3
|
* flow redirects the installer's BROWSER to the GitHub App's configured "Setup URL" once the install
|
|
4
4
|
* completes — a request the CLI process cannot receive directly (it has no public callback endpoint of
|
|
5
5
|
* its own). `GET /v1/github/setup` (`../routes/github-setup.ts`) IS that Setup URL: it lands the
|
|
@@ -8,23 +8,30 @@
|
|
|
8
8
|
* (same file) until the entry appears, then proceeds to `POST /v1/github/installations/claim`.
|
|
9
9
|
*
|
|
10
10
|
* Entries expire on the same 10-minute TTL as the nonce itself (`install-nonce.ts`) so a stale poll can
|
|
11
|
-
* never resurrect an old install correlation.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* never resurrect an old install correlation. The interface is async because a multi-instance
|
|
12
|
+
* deployment backs it with Postgres (`PostgresArtifactStore` implements it — GHD-2 closed the gap
|
|
13
|
+
* flagged in the GHD-1 review): the setup redirect and the CLI poll can land on different instances,
|
|
14
|
+
* so the hand-off must live in the shared store. The in-memory backend remains the single-instance
|
|
15
|
+
* dev/test default.
|
|
14
16
|
*/
|
|
15
|
-
|
|
17
|
+
/** Shared hand-off TTL — mirrors the install-nonce TTL so neither side outlives the other. */
|
|
18
|
+
export const PENDING_GITHUB_INSTALLATION_TTL_MS = 10 * 60 * 1000;
|
|
16
19
|
export class InMemoryPendingGithubInstallationStore {
|
|
17
20
|
#entries = new Map();
|
|
18
|
-
|
|
21
|
+
#now;
|
|
22
|
+
constructor(options = {}) {
|
|
23
|
+
this.#now = options.now ?? (() => new Date());
|
|
24
|
+
}
|
|
25
|
+
async put(state, installationId) {
|
|
19
26
|
if (this.#entries.has(state))
|
|
20
27
|
return; // first write wins — see the interface doc
|
|
21
|
-
this.#entries.set(state, { installationId, createdAt:
|
|
28
|
+
this.#entries.set(state, { installationId, createdAt: this.#now().getTime() });
|
|
22
29
|
}
|
|
23
|
-
get(state) {
|
|
30
|
+
async get(state) {
|
|
24
31
|
const entry = this.#entries.get(state);
|
|
25
32
|
if (entry === undefined)
|
|
26
33
|
return undefined;
|
|
27
|
-
if (
|
|
34
|
+
if (this.#now().getTime() - entry.createdAt > PENDING_GITHUB_INSTALLATION_TTL_MS) {
|
|
28
35
|
this.#entries.delete(state);
|
|
29
36
|
return undefined;
|
|
30
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-installations.js","sourceRoot":"","sources":["../../src/github/pending-installations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pending-installations.js","sourceRoot":"","sources":["../../src/github/pending-installations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8FAA8F;AAC9F,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAmBjE,MAAM,OAAO,sCAAsC;IACxC,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC3C,IAAI,CAAa;IAE1B,YAAY,UAAgC,EAAE;QAC5C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,KAAa,EAAE,cAAsB;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,2CAA2C;QACjF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,KAAa;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAC1C,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,SAAS,GAAG,kCAAkC,EAAE,CAAC;YACjF,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5B,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,KAAK,CAAC,cAAc,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { ensureAuditSchema, PostgresAuditStore } from '@noodle-borg/module-audit';
|
|
2
|
+
export { ALERT_EVALUATION_INTERVAL_MS, AlertEvaluator, type AlertEvaluatorOptions, observedMetricValue, } from './alert-evaluator.js';
|
|
3
|
+
export { ALERT_WEBHOOK_SCHEMA_VERSION, type AlertWebhookDelivery, type AlertWebhookPayload, buildAlertWebhookPayload, type DeliverAlertWebhookOptions, deliverAlertWebhook, validateAlertWebhookUrl, type WebhookUrlPolicy, } from './alert-webhook.js';
|
|
2
4
|
export { ARCHIVE_SWEEP_INTERVAL_MS, ArchiveSweeper, type ArchiveSweeperOptions, DEFAULT_ARCHIVE_RETENTION_DAYS, resolveArchiveRetentionDays, } from './archive-sweeper.js';
|
|
3
5
|
export { type AssetAdapterKind, type AssetConfigInput, type AssetConfigResolution, type AssetQuotaOverride, createAssetStore, type ResolvedAssetConfig, resolveAssetConfig, } from './asset-config.js';
|
|
4
6
|
export { type AssetStore, type AssetUploadPlan, type AssetUploadTarget, InMemoryAssetStore, type InMemoryAssetStoreOptions, } from './assets.js';
|
|
@@ -17,20 +19,26 @@ export { CachingPolicyAssignmentStore, type PolicyCacheOptions, } from './policy
|
|
|
17
19
|
export { InMemoryPolicyCounterStore } from './policy-counters.js';
|
|
18
20
|
export { type DeployError, type DeployResult, type RecoverResult, type RollbackResult, ServerRegistry, } from './registry.js';
|
|
19
21
|
export { aggregateRequestEvents, type ClientMetrics, type MethodMetrics, type RequestMetrics, type SeriesBucket, type ToolMetrics, } from './request-event-metrics.js';
|
|
20
|
-
export { AppResponseSchema, AppSummarySchema, AppsListResponseSchema, DeploymentResponseSchema, DeploymentSummarySchema, EnvResponseSchema, EnvSummarySchema, EnvsListResponseSchema, GithubConnectionResponseSchema, GithubInstallUrlResponseSchema, OrgSummarySchema, RepoConnectionSchema, } from './routes/contracts.js';
|
|
22
|
+
export { AppResponseSchema, AppSummarySchema, AppsListResponseSchema, DeploymentResponseSchema, DeploymentSummarySchema, DeployRunSchema, EnvResponseSchema, EnvSummarySchema, EnvsListResponseSchema, GithubConnectionResponseSchema, GithubInstallUrlResponseSchema, GithubRunsListResponseSchema, OrgSummarySchema, RepoConnectionSchema, } from './routes/contracts.js';
|
|
21
23
|
export { type GcpKmsConfig, gcpKmsMasterKeyProvider, type KmsClient, } from './secret/kms-master-key.js';
|
|
22
24
|
export { type RunningService, serveService } from './serve.js';
|
|
23
25
|
export { createServiceHandler } from './service.js';
|
|
24
26
|
export { capabilitiesForConfig, defineNoodleService, expandServiceProfile, type NoodleServiceConfig, type ObservabilityConfig, type ObservabilityLogFormat, type ObservabilityLogLevel, type ObservabilityLogSink, parseNoodleServiceYaml, resolveServiceConfigSource, type ServiceConfigSource, } from './service-config.js';
|
|
27
|
+
export { ALERT_METRICS, ALERT_WINDOWS_MINUTES, type AlertFiringState, type AlertMetric, type AlertRuleRecord, type AlertRuleStore, type AlertWindowMinutes, type CreateAlertRuleInput, DEFAULT_ALERT_COOLDOWN_MINUTES, InMemoryAlertRuleStore, MAX_ALERT_RULES_PER_ENV, } from './store/alert-rules.js';
|
|
28
|
+
export { JsonFileAlertRuleStore } from './store/alert-rules-json-file.js';
|
|
25
29
|
export { AUDIT_SCHEMA_VERSION, type AuditDecision, type AuditDetails, type AuditEvent, type AuditEventInput, type AuditFilter, type AuditSink, type AuditStore, InMemoryAuditStore, type InMemoryAuditStoreOptions, MultiSink, redactDetails, StdoutAuditSink, } from './store/audit.js';
|
|
26
30
|
export { InMemoryControlPlaneStore } from './store/control-plane.js';
|
|
27
31
|
export { InMemoryGithubConnectionStore } from './store/github-connections.js';
|
|
28
32
|
export { JsonFileGithubConnectionStore } from './store/github-connections-json-file.js';
|
|
33
|
+
export { canTransitionDeployRun, DEFAULT_DEPLOY_RUN_LIST_LIMIT, DEPLOY_RUN_TRANSITIONS, InMemoryGithubDeployRunStore, } from './store/github-runs.js';
|
|
34
|
+
export { JsonFileGithubDeployRunStore } from './store/github-runs-json-file.js';
|
|
35
|
+
export { PostgresPendingGithubInstallationStore } from './store/pending-installations-postgres.js';
|
|
29
36
|
export { PostgresArtifactStore, type PostgresStoreOptions } from './store/postgres.js';
|
|
37
|
+
export { ensureAlertRuleSchema, PostgresAlertRuleStore, } from './store/postgres-alerts.js';
|
|
30
38
|
export { ensureStateHandleSchema, PostgresStateHandleStore, type PostgresStateHandleStoreOptions, } from './store/postgres-state-handles.js';
|
|
31
39
|
export { RequestEventBuffer } from './store/request-event-buffer.js';
|
|
32
40
|
export { InMemoryRequestEventStore } from './store/request-events.js';
|
|
33
41
|
export { ensureRequestEventSchema, PostgresRequestEventStore, } from './store/request-events-postgres.js';
|
|
34
42
|
export { InMemoryUserAppLogStore, type InMemoryUserAppLogStoreOptions, type UserAppLogEvent, type UserAppLogFilter, type UserAppLogInput, type UserAppLogLevel, type UserAppLogSink, type UserAppLogStore, } from './store/user-app-logs.js';
|
|
35
|
-
export { type AppArchiveResult, type AppRestoreResult, type AppSummary, type ArtifactStore, CONFIG_NAME_PATTERN, type ConfigScope, type ConfigStore, type ConfigValueMetadata, type ControlPlaneStore, DEPLOYMENT_ID_PATTERN, type DeploymentListFilter, type DeploymentSummary, type DeployRecord, DOMAIN_PATTERN, type EnvSummary, type GithubConnectionStore, InMemoryArtifactStore, InMemoryConfigStore, JsonFileArtifactStore, type ManagedConfigKind, type OrgDomainRecord, type OrgInvitationRecord, type OrgMemberRecord, type OrgRecord, type OrgRole, type RepoConnectionConflict, type RepoConnectionConflictReason, type RepoConnectionRecord, resolveConfigScope, type SecretEnvelope, type SignupAllowlistKind, type SignupAllowlistRecord, SLUG_PATTERN, scopeChain, type TenantAuthConfig, type TenantRef, type UpsertRepoConnectionInput, type UpsertRepoConnectionResult, validateConfigName, validateConfigScope, validateDomain, validateOrgRole, validatePositiveInteger, validateSignupAllowlistKind, validateSlug, validateTenantRef, } from './store.js';
|
|
43
|
+
export { type AppArchiveResult, type AppRestoreResult, type AppSummary, type ArtifactStore, type CancelQueuedDeployRunsFilter, CONFIG_NAME_PATTERN, type ConfigScope, type ConfigStore, type ConfigValueMetadata, type ControlPlaneStore, type CreateDeployRunDuplicateReason, type CreateDeployRunInput, type CreateDeployRunResult, DEPLOYMENT_ID_PATTERN, type DeploymentListFilter, type DeploymentSummary, type DeployRecord, type DeployRunRecord, type DeployRunSourceEvent, type DeployRunStatus, DOMAIN_PATTERN, type EnvSummary, type GithubConnectionStore, type GithubDeployRunStore, InMemoryArtifactStore, InMemoryConfigStore, JsonFileArtifactStore, type ListDeployRunsResult, type ManagedConfigKind, type OrgDomainRecord, type OrgInvitationRecord, type OrgMemberRecord, type OrgRecord, type OrgRole, type RepoConnectionConflict, type RepoConnectionConflictReason, type RepoConnectionRecord, resolveConfigScope, type SecretEnvelope, type SignupAllowlistKind, type SignupAllowlistRecord, SLUG_PATTERN, scopeChain, type TenantAuthConfig, type TenantRef, type UpsertRepoConnectionInput, type UpsertRepoConnectionResult, validateConfigName, validateConfigScope, validateDomain, validateOrgRole, validatePositiveInteger, validateSignupAllowlistKind, validateSlug, validateTenantRef, } from './store.js';
|
|
36
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,KAAK,qBAAqB,EAC1B,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,KAAK,mBAAmB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sB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,YAAY,EACZ,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,2BAA2B,EAC3B,YAAY,EACZ,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { ensureAuditSchema, PostgresAuditStore } from '@noodle-borg/module-audit';
|
|
2
|
+
export { ALERT_EVALUATION_INTERVAL_MS, AlertEvaluator, observedMetricValue, } from './alert-evaluator.js';
|
|
3
|
+
export { ALERT_WEBHOOK_SCHEMA_VERSION, buildAlertWebhookPayload, deliverAlertWebhook, validateAlertWebhookUrl, } from './alert-webhook.js';
|
|
2
4
|
export { ARCHIVE_SWEEP_INTERVAL_MS, ArchiveSweeper, DEFAULT_ARCHIVE_RETENTION_DAYS, resolveArchiveRetentionDays, } from './archive-sweeper.js';
|
|
3
5
|
export { createAssetStore, resolveAssetConfig, } from './asset-config.js';
|
|
4
6
|
export { InMemoryAssetStore, } from './assets.js';
|
|
@@ -16,16 +18,22 @@ export { CachingPolicyAssignmentStore, } from './policy-cache.js';
|
|
|
16
18
|
export { InMemoryPolicyCounterStore } from './policy-counters.js';
|
|
17
19
|
export { ServerRegistry, } from './registry.js';
|
|
18
20
|
export { aggregateRequestEvents, } from './request-event-metrics.js';
|
|
19
|
-
export { AppResponseSchema, AppSummarySchema, AppsListResponseSchema, DeploymentResponseSchema, DeploymentSummarySchema, EnvResponseSchema, EnvSummarySchema, EnvsListResponseSchema, GithubConnectionResponseSchema, GithubInstallUrlResponseSchema, OrgSummarySchema, RepoConnectionSchema, } from './routes/contracts.js';
|
|
21
|
+
export { AppResponseSchema, AppSummarySchema, AppsListResponseSchema, DeploymentResponseSchema, DeploymentSummarySchema, DeployRunSchema, EnvResponseSchema, EnvSummarySchema, EnvsListResponseSchema, GithubConnectionResponseSchema, GithubInstallUrlResponseSchema, GithubRunsListResponseSchema, OrgSummarySchema, RepoConnectionSchema, } from './routes/contracts.js';
|
|
20
22
|
export { gcpKmsMasterKeyProvider, } from './secret/kms-master-key.js';
|
|
21
23
|
export { serveService } from './serve.js';
|
|
22
24
|
export { createServiceHandler } from './service.js';
|
|
23
25
|
export { capabilitiesForConfig, defineNoodleService, expandServiceProfile, parseNoodleServiceYaml, resolveServiceConfigSource, } from './service-config.js';
|
|
26
|
+
export { ALERT_METRICS, ALERT_WINDOWS_MINUTES, DEFAULT_ALERT_COOLDOWN_MINUTES, InMemoryAlertRuleStore, MAX_ALERT_RULES_PER_ENV, } from './store/alert-rules.js';
|
|
27
|
+
export { JsonFileAlertRuleStore } from './store/alert-rules-json-file.js';
|
|
24
28
|
export { AUDIT_SCHEMA_VERSION, InMemoryAuditStore, MultiSink, redactDetails, StdoutAuditSink, } from './store/audit.js';
|
|
25
29
|
export { InMemoryControlPlaneStore } from './store/control-plane.js';
|
|
26
30
|
export { InMemoryGithubConnectionStore } from './store/github-connections.js';
|
|
27
31
|
export { JsonFileGithubConnectionStore } from './store/github-connections-json-file.js';
|
|
32
|
+
export { canTransitionDeployRun, DEFAULT_DEPLOY_RUN_LIST_LIMIT, DEPLOY_RUN_TRANSITIONS, InMemoryGithubDeployRunStore, } from './store/github-runs.js';
|
|
33
|
+
export { JsonFileGithubDeployRunStore } from './store/github-runs-json-file.js';
|
|
34
|
+
export { PostgresPendingGithubInstallationStore } from './store/pending-installations-postgres.js';
|
|
28
35
|
export { PostgresArtifactStore } from './store/postgres.js';
|
|
36
|
+
export { ensureAlertRuleSchema, PostgresAlertRuleStore, } from './store/postgres-alerts.js';
|
|
29
37
|
export { ensureStateHandleSchema, PostgresStateHandleStore, } from './store/postgres-state-handles.js';
|
|
30
38
|
export { RequestEventBuffer } from './store/request-event-buffer.js';
|
|
31
39
|
export { InMemoryRequestEventStore } from './store/request-events.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EACL,yBAAyB,EACzB,cAAc,EAEd,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKL,gBAAgB,EAEhB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAIL,kBAAkB,GAEnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,YAAY,EACZ,WAAW,EAGX,iBAAiB,EAEjB,sBAAsB,EAEtB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAkB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EACL,qBAAqB,EAGrB,sBAAsB,EACtB,+BAA+B,EAC/B,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oBAAoB,EAGpB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,qBAAqB,EACrB,cAAc,EACd,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAKL,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,sCAAsC,GAEvC,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,8BAA8B,EAE9B,6BAA6B,EAC7B,wBAAwB,EAIxB,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