Page MenuHomePhabricator

[keyserver] Convert upload responders
ClosedPublic

Authored by michal on May 15 2023, 3:57 AM.
Tags
None
Referenced Files
F1652439: D7808.diff
Wed, Apr 24, 8:20 AM
Unknown Object (File)
Fri, Apr 5, 4:22 AM
Unknown Object (File)
Fri, Apr 5, 4:22 AM
Unknown Object (File)
Fri, Apr 5, 4:22 AM
Unknown Object (File)
Fri, Apr 5, 4:21 AM
Unknown Object (File)
Fri, Apr 5, 4:15 AM
Unknown Object (File)
Feb 19 2024, 4:41 PM
Unknown Object (File)
Feb 19 2024, 4:01 PM
Subscribers

Details

Summary

Adds validators for upload responders.

Depends on D7807

Test Plan

Try sending a photo and a video, check if there are any errors.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek added inline comments.
keyserver/src/uploads/uploads.js
223 ↗(On Diff #26448)

Why the original type was concrete instead of any / mixed? Do we have to replace it with mixed?

This revision is now accepted and ready to land.May 16 2023, 3:32 AM
keyserver/src/uploads/uploads.js
223 ↗(On Diff #26448)

@tomek Not sure, I think it was just a mistake, I can't find any additional input validation for this responder in particular.
I also tested it just now and was able to send anything to this responder and it only tripped on the newly added validateInput.

Rebase, validate uploadMediaMetadataResponder, fix bug with uploadDownloadResponder

michal added inline comments.
keyserver/src/uploads/uploads.js
158 ↗(On Diff #26592)

These are not converted because they come from the upload URI. We could convert them here but then on the output side we would need to convert them by adding a new tURI and then have the conversion function parse the URL and convert only the id inside it but I don't think that's needed.
These URIs already have the Comm keyserver hardcoded, so it will require even more changes anyway when we are adding multi keyserver support. And if in the future all uploads will be handled by blob service, this endpoint won't be even needed.

This revision is now accepted and ready to land.May 19 2023, 12:58 AM