-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
439 lines (439 loc) · 21.5 KB
/
Copy pathopenapi.json
File metadata and controls
439 lines (439 loc) · 21.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
{
"openapi": "3.1.0",
"info": {
"title": "Noema API",
"version": "0.1.0",
"description": "Machine-readable contract for Noema liveness, runtime readiness, and GitHub Actions OIDC credential exchange. Deployment hostnames are environment-specific and intentionally not embedded in this document."
},
"tags": [
{ "name": "Health", "description": "Process liveness only." },
{ "name": "Readiness", "description": "Fail-closed runtime traffic readiness without external network calls." },
{ "name": "Exchange", "description": "GitHub Actions OIDC to repository-scoped GitHub App installation-token exchange." }
],
"paths": {
"/health": {
"get": {
"tags": ["Health"],
"operationId": "getHealth",
"summary": "Check Worker liveness",
"description": "Returns process/request-path liveness only. A successful response is not credential-exchange readiness.",
"responses": {
"200": {
"description": "The Worker request path is live.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" }
},
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/HealthSuccess" } }
}
}
}
}
},
"/ready": {
"get": {
"tags": ["Readiness"],
"operationId": "getReadiness",
"summary": "Check runtime traffic readiness",
"description": "Validates local credential-exchange configuration and required Durable Object bindings without an external network request or Durable Object invocation.",
"responses": {
"200": { "$ref": "#/components/responses/Ready" },
"503": { "$ref": "#/components/responses/NotReady" }
}
},
"head": {
"tags": ["Readiness"],
"operationId": "headReadiness",
"summary": "Check readiness without a response body",
"description": "Returns the same status and headers as GET /ready with no response body.",
"responses": {
"200": { "$ref": "#/components/responses/ReadyHead" },
"503": { "$ref": "#/components/responses/NotReadyHead" }
}
}
},
"/exchange": {
"post": {
"tags": ["Exchange"],
"operationId": "exchangeGithubActionsOidc",
"summary": "Exchange an authorized GitHub Actions OIDC JWT",
"description": "Authenticates the GitHub Actions OIDC bearer, exact trusted workflow identity, repository authorization, distributed rate limit and replay boundary before returning a short-lived repository-scoped GitHub App installation token. Returned tokens are sensitive and must not be logged or persisted as ordinary telemetry.",
"security": [{ "githubActionsOidc": [] }],
"x-request-body-limit-bytes": 8192,
"requestBody": {
"required": false,
"description": "Optional target repository selection. When a body is present, its media-type token must be application/json and the wire body is limited to 8,192 bytes before credential-bearing work.",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ExchangeRequest" }
}
}
},
"responses": {
"200": {
"description": "Authorized short-lived installation token issued.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" },
"X-Rate-Limit-Limit": { "$ref": "#/components/headers/RateLimitLimit" },
"X-Rate-Limit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" },
"X-Rate-Limit-Scope": { "$ref": "#/components/headers/RateLimitScope" },
"X-Oidc-Replay-Protection": { "$ref": "#/components/headers/OidcReplayProtection" }
},
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/ExchangeSuccess" } }
}
},
"400": { "$ref": "#/components/responses/BadRequest" },
"401": {
"description": "Bearer authentication is absent or invalid.",
"headers": {
"WWW-Authenticate": { "$ref": "#/components/headers/WwwAuthenticate" },
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" },
"X-Rate-Limit-Limit": { "$ref": "#/components/headers/RateLimitLimit" },
"X-Rate-Limit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" },
"X-Rate-Limit-Scope": { "$ref": "#/components/headers/RateLimitScope" }
},
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
}
},
"403": { "$ref": "#/components/responses/Forbidden" },
"405": {
"description": "The exchange endpoint accepts POST only.",
"headers": {
"Allow": {
"description": "Permitted method for the exchange endpoint.",
"schema": { "type": "string", "const": "POST" }
},
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" },
"X-Rate-Limit-Limit": { "$ref": "#/components/headers/RateLimitLimit" },
"X-Rate-Limit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" },
"X-Rate-Limit-Scope": { "$ref": "#/components/headers/RateLimitScope" }
},
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
}
},
"413": { "$ref": "#/components/responses/PayloadTooLarge" },
"415": { "$ref": "#/components/responses/UnsupportedMediaType" },
"429": {
"description": "Distributed or local exchange rate limit exceeded.",
"headers": {
"Retry-After": { "$ref": "#/components/headers/RetryAfter" },
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" },
"X-Rate-Limit-Limit": { "$ref": "#/components/headers/RateLimitLimit" },
"X-Rate-Limit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" },
"X-Rate-Limit-Scope": { "$ref": "#/components/headers/RateLimitScope" }
},
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
}
},
"500": { "$ref": "#/components/responses/InternalError" },
"502": { "$ref": "#/components/responses/BadGateway" },
"503": { "$ref": "#/components/responses/ServiceUnavailable" }
}
}
}
},
"components": {
"securitySchemes": {
"githubActionsOidc": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "GitHub Actions OIDC JWT",
"description": "GitHub Actions OIDC JWT evaluated against Noema's issuer, audience, owner, exact workflow-ref/SHA, authorization, rate-limit and replay controls."
}
},
"headers": {
"CacheControl": {
"description": "Prevents credential or diagnostic response caching.",
"schema": { "type": "string", "const": "no-store" }
},
"Pragma": {
"description": "Legacy no-cache directive.",
"schema": { "type": "string", "const": "no-cache" }
},
"ContentTypeOptions": {
"description": "Disables MIME sniffing.",
"schema": { "type": "string", "const": "nosniff" }
},
"TraceId": {
"description": "Non-secret request trace identifier.",
"schema": { "type": "string" }
},
"LatencyMs": {
"description": "Observed request latency in milliseconds.",
"schema": { "type": "string", "pattern": "^[0-9]+$" }
},
"Readiness": {
"description": "Runtime traffic-readiness state.",
"schema": { "type": "string", "enum": ["ready", "not-ready"] }
},
"RetryAfter": {
"description": "Delay before retry in seconds.",
"schema": { "type": "string", "pattern": "^[0-9]+$" }
},
"WwwAuthenticate": {
"description": "Standard Bearer challenge for missing or invalid credentials.",
"schema": { "type": "string", "pattern": "^Bearer " }
},
"RateLimitLimit": {
"description": "Configured distributed exchange-request limit for the active window.",
"schema": { "type": "string", "pattern": "^[0-9]+$" }
},
"RateLimitRemaining": {
"description": "Distributed exchange requests remaining in the active window after this decision.",
"schema": { "type": "string", "pattern": "^[0-9]+$" }
},
"RateLimitScope": {
"description": "Identifies the distributed rate-limit authority that evaluated the exchange request.",
"schema": { "type": "string", "const": "distributed" }
},
"OidcReplayProtection": {
"description": "Confirms that the successful exchange consumed the verified OIDC identity through the single-use replay boundary.",
"schema": { "type": "string", "const": "single-use" }
}
},
"schemas": {
"HealthSuccess": {
"type": "object",
"required": ["ok", "data", "trace_id"],
"properties": {
"ok": { "type": "boolean", "const": true },
"data": {
"type": "object",
"required": ["name"],
"properties": { "name": { "type": "string", "const": "noema" } }
},
"trace_id": { "type": "string" }
}
},
"ReadinessSuccess": {
"type": "object",
"required": ["ok", "data", "trace_id"],
"properties": {
"ok": { "type": "boolean", "const": true },
"data": {
"type": "object",
"required": ["name", "status", "checks"],
"properties": {
"name": { "type": "string", "const": "noema" },
"status": { "type": "string", "const": "ready" },
"checks": {
"type": "object",
"required": ["configuration"],
"properties": { "configuration": { "type": "string", "const": "pass" } }
}
}
},
"trace_id": { "type": "string" }
}
},
"RepositoryLocator": {
"type": "string",
"description": "Authorized owner/repository locator. Each path segment must match [A-Za-z0-9_.-]+ and must not be exactly `.` or `..`. Names such as `.github` remain valid. Constraints use RE2-safe patterns plus JSON Schema not/allOf so buyer tooling that cannot compile lookaheads still rejects traversal segments.",
"allOf": [
{ "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$" },
{ "not": { "pattern": "^\\.{1,2}/" } },
{ "not": { "pattern": "/\\.{1,2}$" } }
]
},
"ExchangeRequest": {
"type": "object",
"properties": {
"target_repository": { "$ref": "#/components/schemas/RepositoryLocator" }
}
},
"ExchangeSuccess": {
"type": "object",
"required": ["ok", "data", "trace_id"],
"properties": {
"ok": { "type": "boolean", "const": true },
"data": {
"type": "object",
"required": ["token", "repository", "workflow_ref", "token_expires_at"],
"properties": {
"token": { "type": "string", "description": "Sensitive short-lived GitHub App installation token. No example value is embedded." },
"repository": { "$ref": "#/components/schemas/RepositoryLocator" },
"workflow_ref": { "type": "string" },
"token_expires_at": { "type": "string", "format": "date-time" }
}
},
"trace_id": { "type": "string" }
}
},
"ErrorResponse": {
"type": "object",
"required": ["ok", "error_code", "message", "trace_id"],
"properties": {
"ok": { "type": "boolean", "const": false },
"error_code": { "type": "string", "pattern": "^ERR_[A-Z0-9_]+$" },
"message": { "type": "string" },
"details": { "type": "object", "additionalProperties": true },
"trace_id": { "type": "string" }
}
}
},
"responses": {
"Ready": {
"description": "Credential-exchange configuration is locally ready for traffic.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" },
"X-Noema-Readiness": { "$ref": "#/components/headers/Readiness" }
},
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/ReadinessSuccess" } }
}
},
"NotReady": {
"description": "Credential exchange is not ready; listed check identifiers are non-secret stable identifiers.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" },
"X-Noema-Readiness": { "$ref": "#/components/headers/Readiness" },
"Retry-After": { "$ref": "#/components/headers/RetryAfter" }
},
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
}
},
"ReadyHead": {
"description": "Same ready status and headers as GET /ready; no response body.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" },
"X-Noema-Readiness": { "$ref": "#/components/headers/Readiness" }
}
},
"NotReadyHead": {
"description": "Same not-ready status and headers as GET /ready; no response body.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" },
"X-Noema-Readiness": { "$ref": "#/components/headers/Readiness" },
"Retry-After": { "$ref": "#/components/headers/RetryAfter" }
}
},
"BadRequest": {
"description": "Malformed token or request input.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" }
},
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
},
"Forbidden": {
"description": "Repository or exact workflow trust policy rejected the request.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" },
"X-Rate-Limit-Limit": { "$ref": "#/components/headers/RateLimitLimit" },
"X-Rate-Limit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" },
"X-Rate-Limit-Scope": { "$ref": "#/components/headers/RateLimitScope" }
},
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
},
"PayloadTooLarge": {
"description": "Exchange JSON wire body exceeds 8,192 bytes.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" }
},
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
},
"UnsupportedMediaType": {
"description": "Exchange request body is present but its media-type token is not application/json.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" }
},
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
},
"InternalError": {
"description": "Credential-exchange upstream or internal failure.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" },
"X-Rate-Limit-Limit": { "$ref": "#/components/headers/RateLimitLimit" },
"X-Rate-Limit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" },
"X-Rate-Limit-Scope": { "$ref": "#/components/headers/RateLimitScope" }
},
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
},
"BadGateway": {
"description": "GitHub OIDC/JWKS or GitHub API upstream temporary failure.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" },
"X-Rate-Limit-Limit": { "$ref": "#/components/headers/RateLimitLimit" },
"X-Rate-Limit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" },
"X-Rate-Limit-Scope": { "$ref": "#/components/headers/RateLimitScope" }
},
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
},
"ServiceUnavailable": {
"description": "Fail-closed configuration, distributed-control, or upstream availability boundary.",
"headers": {
"Cache-Control": { "$ref": "#/components/headers/CacheControl" },
"Pragma": { "$ref": "#/components/headers/Pragma" },
"X-Content-Type-Options": { "$ref": "#/components/headers/ContentTypeOptions" },
"X-Trace-Id": { "$ref": "#/components/headers/TraceId" },
"X-Latency-Ms": { "$ref": "#/components/headers/LatencyMs" }
},
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
}
}
}
}