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, Dec 17, 6:57 AM
Unknown Object (File)
Sun, Dec 15, 9:36 PM
Unknown Object (File)
Sun, Dec 15, 9:36 PM
Unknown Object (File)
Sun, Dec 15, 9:36 PM
Unknown Object (File)
Sun, Dec 15, 9:35 PM
Unknown Object (File)
Sun, Dec 15, 9:17 PM
Unknown Object (File)
Tue, Dec 10, 6:46 PM
Unknown Object (File)
Fri, Dec 6, 4:25 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