Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

batches: Remote Mount #3 - HTTP API#40829

Merged
Piszmog merged 155 commits into
mainfrom
rc/remote-mount-httpapi
Sep 27, 2022
Merged

batches: Remote Mount #3 - HTTP API#40829
Piszmog merged 155 commits into
mainfrom
rc/remote-mount-httpapi

Conversation

@Piszmog

@Piszmog Piszmog commented Aug 25, 2022

Copy link
Copy Markdown
Contributor

Part of #31792.

Previous part: #40809

Add HTTP API endpoint to upload, retrieve, and check if files exist. Endpoints are included as part of the external services and the executor services.

Overview

The FileHandler has a single ServerHTTP function that handles GET (retrieval), HEAD (existence check), and POST (upload). The GET and HEAD are nothing unique. POST on the other hand receives a multipart/form-data as the request. POST also has a security check to ensure either a site admin or the creator of the batch spec is uploading the file (not sure if this should apply to all the methods 🤔 ).

POST limits the max size of the request to 10MB (I made this number up). In the future when not using Postgres to store the file content, this can be updated to stream the chunks (there is a comment with a link to an example repo).

Follow up

  • Will request a security review after team approval

Test plan

Add Go Unit Tests

@Piszmog Piszmog requested a review from a team August 25, 2022 00:51
@cla-bot cla-bot Bot added the cla-signed label Aug 25, 2022
@Piszmog Piszmog requested review from LawnGnome and eseliger and removed request for a team August 25, 2022 00:51
# Conflicts:
#	internal/database/migration/shared/upgradedata/stitched-migration-graph.json
Comment thread enterprise/cmd/frontend/internal/batches/httpapi/file_handler.go
Base automatically changed from rc/remote-mount-graphql to main September 27, 2022 14:56
@Piszmog Piszmog merged commit 869853f into main Sep 27, 2022
@Piszmog Piszmog deleted the rc/remote-mount-httpapi branch September 27, 2022 16:23
sashaostrikov pushed a commit that referenced this pull request Sep 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants