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
Migrate JobFilesAPIController to FastAPI (excluding TUS uploads)
`FastAPIJobFiles` is the new, FastAPI version of `JobFilesAPIController`. The endpoints that have been migrated should exhibit exactly the same behavior as the old ones from `FastAPIJobFiles`. Something to keep in mind is that while FastAPI has some extra built-in features that the legacy WSGI system did not have, such as answering HEAD requests, those do not work because of the way legacy WSGI endpoints are injected into the FastAPI app (using `app.mount("/", wsgi_handler)`), meaning that for example, HEAD requests are passed to the `wsgi_handler` sub-application.
Endpoints dedicated to TUS uploads work in tandem with the WSGI middleware `TusMiddleware` from the `tuswsgi` package. As explained above, WSGI middlewares and endpoints are injected into the FastAPI app after FastAPI routes as a single sub-application `wsgi_handler` using `app.mount("/", wsgi_handler)`, meaning that requests are passed to the `wsgi_handler` sub-application (and thus to `TusMiddleware`) only if there was no FastAPI endpoint defined to handle them. Therefore, they cannot be migrated to FastAPI unless `TusMiddleware` is also migrated to ASGI.
/** @description A key used to authenticate this request as acting on behalf or a job runner for the specified job. */
31239
+
job_key: string;
31240
+
};
31241
+
header?: {
31242
+
/** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */
31243
+
"run-as"?: string | null;
31244
+
};
31245
+
path: {
31246
+
/** @description Encoded id string of the job. */
31247
+
job_id: string;
31248
+
};
31249
+
cookie?: never;
31250
+
};
31251
+
requestBody?: never;
31252
+
responses: {
31253
+
/** @description Contents of file. */
31254
+
200: {
31255
+
headers: {
31256
+
[name: string]: unknown;
31257
+
};
31258
+
content: {
31259
+
"application/octet-stream": unknown;
31260
+
};
31261
+
};
31262
+
/** @description File not found, path does not refer to a file, or input dataset(s) for job have been purged. */
/** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */
/** @description A key used to authenticate this request as acting on behalf or a job runner for the specified job. */
31343
+
job_key: string;
31344
+
};
31345
+
header?: {
31346
+
/** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */
31347
+
"run-as"?: string | null;
31348
+
};
31349
+
path: {
31350
+
/** @description Encoded id string of the job. */
31351
+
job_id: string;
31352
+
};
31353
+
cookie?: never;
31354
+
};
31355
+
requestBody?: never;
31356
+
responses: {
31357
+
/** @description Contents of file. */
31358
+
200: {
31359
+
headers: {
31360
+
[name: string]: unknown;
31361
+
};
31362
+
content: {
31363
+
"application/octet-stream": unknown;
31364
+
};
31365
+
};
31366
+
/** @description File not found, path does not refer to a file, or input dataset(s) for job have been purged. */
0 commit comments