You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(api): reject a non-positive-integer installation id on the seven id routes (#9740)
Seven routes parsed an installation id and validated it with Number.isFinite
alone, which accepts fractions and exponent notation -- Number("1.5") -> 1.5 and
0/negative all passed and were bound straight into the D1 lookup. A GitHub
installation id is always a positive integer, and the repo's own sibling routes
(the dead-letter-queue admin routes, the chat-qa :number param) already guard with
!Number.isInteger(id) || id <= 0.
Switch all seven -- GET/`/v1/installations/:id/{health,repair}`,
POST `.../repair/refresh`, and their four `/v1/app/installations/:id/*` siblings
(health, repair, repair/refresh, agent/bulk-settings) -- to that guard, returning
the existing { error: "invalid_installation_id" } body with 400 unchanged. The two
`/v1/internal/orb/*` routes that parse installationId from a JSON body are out of
scope and untouched.
Every one of the seven operations now declares 400 in the published OpenAPI
document (the four app routes in orb-and-control-route-specs.ts, the three legacy
routes' registerPath blocks in spec.ts); bulk-settings' existing 400 description is
widened to cover the id cause too. openapi.json is regenerated.
Adds a test asserting each of the seven routes rejects a fractional/zero/negative
id with 400 invalid_installation_id, while a valid positive integer still reaches
the handler.
Closes#9716
summary: "Recompute an installation's repair plan",
194
194
auth: "session",
195
-
responses: {200: {description: "Repair plan recomputed"},404: {description: "No such installation"}, ...SESSION_AUTH_RESPONSES},
195
+
responses: {200: {description: "Repair plan recomputed"},400: {description: "Malformed installation id"},404: {description: "No such installation"}, ...SESSION_AUTH_RESPONSES},
summary: "Apply agent settings across every repo in an installation",
203
203
auth: "session",
204
-
responses: {200: {description: "Settings applied"},400: {description: "Malformed settings"},404: {description: "No such installation"}, ...SESSION_AUTH_RESPONSES},
204
+
responses: {200: {description: "Settings applied"},400: {description: "Malformed installation id or settings"},404: {description: "No such installation"}, ...SESSION_AUTH_RESPONSES},
0 commit comments