Refuse a query string on every route
Breaking: every route now answers a request with a query string with 400 invalid_query, where all but the module routes used to ignore it. A caller must drop the query string and send any input in the JSON body. No route takes an input from the query any more, now that the module routes take copies and printer in the JSON body. The other routes ignored a query, so a caller that sent one had it dropped without a word: an old module caller's ?copies=2 on another route, or a typo. The refusal's message is "query parameters are not accepted". The check runs after routing and, under /api/v1, after the token, the rate limit and the token's scope, so an unknown route still answers 404 and a token sent only in the query still 401. A bare question mark is no query. The OpenAPI document lists invalid_query on every route, and a route's parameters can no longer be in the query. Nothing that ships with the daemon sends it a query: the install, the Docker image and the ntfy recipes post bodies or read /healthz plainly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9e829bfce7
commit
6bfaee0bc8
8 files changed
+212
-33
No files matched your search
+90
-10
@@ -819,6 +819,19 @@
|
||||
},
|
||||
"description": "The running build"
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Bad Request. invalid_query: query parameters are not accepted.",
|
||||
"x-uberbringer-codes": [
|
||||
"invalid_query"
|
||||
]
|
||||
},
|
||||
"500": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
@@ -866,6 +879,19 @@
|
||||
},
|
||||
"description": "The job's status"
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Bad Request. invalid_query: query parameters are not accepted.",
|
||||
"x-uberbringer-codes": [
|
||||
"invalid_query"
|
||||
]
|
||||
},
|
||||
"401": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
@@ -962,6 +988,19 @@
|
||||
},
|
||||
"description": "The modules"
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Bad Request. invalid_query: query parameters are not accepted.",
|
||||
"x-uberbringer-codes": [
|
||||
"invalid_query"
|
||||
]
|
||||
},
|
||||
"401": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
@@ -1068,9 +1107,10 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Bad Request. invalid_job: invalid job.",
|
||||
"description": "Bad Request. invalid_job: invalid job; invalid_query: query parameters are not accepted.",
|
||||
"x-uberbringer-codes": [
|
||||
"invalid_job"
|
||||
"invalid_job",
|
||||
"invalid_query"
|
||||
]
|
||||
},
|
||||
"401": {
|
||||
@@ -1232,11 +1272,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Bad Request. invalid_payload: invalid payload; invalid_query: query parameters are not accepted; unknown_printer: unknown printer.",
|
||||
"description": "Bad Request. invalid_payload: invalid payload; unknown_printer: unknown printer; invalid_query: query parameters are not accepted.",
|
||||
"x-uberbringer-codes": [
|
||||
"invalid_payload",
|
||||
"invalid_query",
|
||||
"unknown_printer"
|
||||
"unknown_printer",
|
||||
"invalid_query"
|
||||
]
|
||||
},
|
||||
"401": {
|
||||
@@ -1401,9 +1441,10 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Bad Request. invalid_job: invalid job.",
|
||||
"description": "Bad Request. invalid_job: invalid job; invalid_query: query parameters are not accepted.",
|
||||
"x-uberbringer-codes": [
|
||||
"invalid_job"
|
||||
"invalid_job",
|
||||
"invalid_query"
|
||||
]
|
||||
},
|
||||
"401": {
|
||||
@@ -1578,11 +1619,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Bad Request. invalid_payload: invalid payload; invalid_query: query parameters are not accepted; unknown_printer: unknown printer.",
|
||||
"description": "Bad Request. invalid_payload: invalid payload; unknown_printer: unknown printer; invalid_query: query parameters are not accepted.",
|
||||
"x-uberbringer-codes": [
|
||||
"invalid_payload",
|
||||
"invalid_query",
|
||||
"unknown_printer"
|
||||
"unknown_printer",
|
||||
"invalid_query"
|
||||
]
|
||||
},
|
||||
"401": {
|
||||
@@ -1743,6 +1784,19 @@
|
||||
},
|
||||
"description": "The printer is reachable and ready, or does not report status"
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Bad Request. invalid_query: query parameters are not accepted.",
|
||||
"x-uberbringer-codes": [
|
||||
"invalid_query"
|
||||
]
|
||||
},
|
||||
"500": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
@@ -1789,6 +1843,19 @@
|
||||
},
|
||||
"description": "The document"
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Bad Request. invalid_query: query parameters are not accepted.",
|
||||
"x-uberbringer-codes": [
|
||||
"invalid_query"
|
||||
]
|
||||
},
|
||||
"500": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
@@ -1824,6 +1891,19 @@
|
||||
},
|
||||
"description": "A robots.txt that allows everything"
|
||||
},
|
||||
"400": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Bad Request. invalid_query: query parameters are not accepted.",
|
||||
"x-uberbringer-codes": [
|
||||
"invalid_query"
|
||||
]
|
||||
},
|
||||
"500": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
|
||||
Reference in new issue
Block a user