Commit f553524
committed
Improve compliance of
This commit introduces the following differences in behavior:
- GET and HEAD requests to `/api/jobs/{job_id}/files` return HTTP status code 400 when the given path does not refer to a file or the input datasets for the job have been purged and 404 when the given path does not exist.
- PROPFIND requests to `/api/jobs/{job_id}/files` are answered with HTTP status code 501 (read motivation for this change below).
- POST requests to `/api/jobs/{job_id}/files` are answered with HTTP status code 400 when no file is provided.
The reason behind the code explicitly answering `PROPFIND` requests with status code 501 is an unfortunate interaction between the ARC remote job runner that is under development, the behavior of legacy API endpoints and how they are integrated within the FastAPI app.
The ARC remote job runner (which will be implemented as `lib.galaxy.jobs.runners.pulsar.PulsarARCJobRunner`) expects this endpoint to return HTTP codes other than 404 when `PROPFIND` requests are issued. They are not part of the HTTP spec, but they are used in the WebDAV protocol. The correct answer to such requests is likely 501 (not implemented).
FastAPI returns HTTP 405 (method not allowed) for `PROPFIND`, which maybe is not fully correct but tolerable because it is one less quirk to maintain.
However, because of the way legacy WSGI endpoints are injected into the FastAPI app (using `app.mount("/", wsgi_handler)`), the built-in support for returning HTTP 405 for `PROPFIND` breaks, because such requests are passed to the `wsgi_handler` sub-application. This means that the endpoint still needs to include some code to handle this behavior.
When ALL routes have been migrated to ASGI (no WSGI handler sub-application needed anymore), some lines of code can be removed, they are labeled using comments.FastAPIJobFiles with the HTTP spec (files endpoint)1 parent 071d2d5 commit f553524
File tree
5 files changed
+165
-22
lines changed- client/src/api/schema
- lib/galaxy
- webapps/galaxy/api
- work
- test/integration
5 files changed
+165
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31259 | 31259 | | |
31260 | 31260 | | |
31261 | 31261 | | |
31262 | | - | |
| 31262 | + | |
31263 | 31263 | | |
| 31264 | + | |
| 31265 | + | |
| 31266 | + | |
| 31267 | + | |
| 31268 | + | |
| 31269 | + | |
| 31270 | + | |
| 31271 | + | |
| 31272 | + | |
| 31273 | + | |
| 31274 | + | |
| 31275 | + | |
| 31276 | + | |
| 31277 | + | |
| 31278 | + | |
| 31279 | + | |
| 31280 | + | |
| 31281 | + | |
31264 | 31282 | | |
31265 | 31283 | | |
31266 | 31284 | | |
| |||
31319 | 31337 | | |
31320 | 31338 | | |
31321 | 31339 | | |
| 31340 | + | |
| 31341 | + | |
| 31342 | + | |
| 31343 | + | |
| 31344 | + | |
| 31345 | + | |
| 31346 | + | |
31322 | 31347 | | |
31323 | 31348 | | |
31324 | 31349 | | |
| |||
31368 | 31393 | | |
31369 | 31394 | | |
31370 | 31395 | | |
31371 | | - | |
| 31396 | + | |
31372 | 31397 | | |
| 31398 | + | |
| 31399 | + | |
| 31400 | + | |
| 31401 | + | |
| 31402 | + | |
| 31403 | + | |
| 31404 | + | |
| 31405 | + | |
| 31406 | + | |
| 31407 | + | |
| 31408 | + | |
| 31409 | + | |
| 31410 | + | |
| 31411 | + | |
| 31412 | + | |
| 31413 | + | |
| 31414 | + | |
| 31415 | + | |
31373 | 31416 | | |
31374 | 31417 | | |
31375 | 31418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
268 | 272 | | |
269 | 273 | | |
270 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
134 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
135 | 152 | | |
136 | 153 | | |
137 | 154 | | |
138 | 155 | | |
139 | 156 | | |
140 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
141 | 174 | | |
142 | 175 | | |
143 | 176 | | |
| |||
155 | 188 | | |
156 | 189 | | |
157 | 190 | | |
158 | | - | |
| 191 | + | |
159 | 192 | | |
160 | 193 | | |
161 | 194 | | |
162 | 195 | | |
163 | 196 | | |
164 | 197 | | |
165 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
166 | 204 | | |
167 | 205 | | |
168 | 206 | | |
| |||
176 | 214 | | |
177 | 215 | | |
178 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
179 | 220 | | |
180 | 221 | | |
181 | 222 | | |
| |||
184 | 225 | | |
185 | 226 | | |
186 | 227 | | |
| 228 | + | |
187 | 229 | | |
188 | 230 | | |
189 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
84 | 81 | | |
85 | 82 | | |
86 | 83 | | |
| |||
115 | 112 | | |
116 | 113 | | |
117 | 114 | | |
118 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
119 | 138 | | |
120 | | - | |
| 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 | + | |
121 | 166 | | |
122 | 167 | | |
123 | 168 | | |
| |||
269 | 314 | | |
270 | 315 | | |
271 | 316 | | |
272 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
273 | 321 | | |
274 | | - | |
| 322 | + | |
| 323 | + | |
275 | 324 | | |
276 | 325 | | |
277 | 326 | | |
| |||
0 commit comments