Page MenuHomePhabricator

[keyserver] Convert upload responders
ClosedPublic

Authored by michal on May 15 2023, 3:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 16, 8:42 AM
Unknown Object (File)
Tue, Jul 16, 2:33 AM
Unknown Object (File)
Sun, Jul 14, 5:16 PM
Unknown Object (File)
Mon, Jul 8, 4:42 PM
Unknown Object (File)
Wed, Jul 3, 5:06 AM
Unknown Object (File)
Mon, Jul 1, 1:18 PM
Unknown Object (File)
Fri, Jun 28, 8:25 AM
Unknown Object (File)
Wed, Jun 26, 12:59 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