-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: public uploads #18295
feat: public uploads #18295
Conversation
try: | ||
file = request.data["file"] | ||
|
||
if file.size > (FOUR_MEGABYTES * 20): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arbitrary limit
@@ -125,11 +125,10 @@ def format_paginated_url(request: request.Request, offset: int, page_size: int, | |||
|
|||
def get_token(data, request) -> Optional[str]: | |||
token = None | |||
if request.method == "GET": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mobile SDK was passing the api_key
as a query param but in a POST request. Unsure if this "GET"
condition is necessary but we should consider removing it in future
# Throttle class that's very aggressive on a publicly accessible endpoint from the clients | ||
# Intended to block sustained bursts of requests, per team | ||
scope = "public_upload" | ||
rate = "6/hour" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arbitrary
📸 UI snapshots have been updated3 snapshot changes in total. 0 added, 3 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
Problem
To support the In-App Video Recording hackathon in Bologna we needed a way to allow attachments to be uploaded publicly.
We have no intention of merging this but leaving it here for the future traveller who might want to explore the approach in future. I will leave comments to discuss some difficulties / considerations faced along the way
Changes
UploadedMedia
object under the hoodNot considered
How did you test this code?
Some minor tests but would need a lot more