Page MenuHomePhabricator

[keyserver] Implement endpoint to upload external blob metadata
ClosedPublic

Authored by bartek on Apr 25 2023, 11:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 3:21 AM
Unknown Object (File)
Wed, Apr 3, 8:22 PM
Unknown Object (File)
Wed, Apr 3, 8:22 PM
Unknown Object (File)
Wed, Apr 3, 8:22 PM
Unknown Object (File)
Wed, Apr 3, 8:22 PM
Unknown Object (File)
Wed, Apr 3, 8:22 PM
Unknown Object (File)
Wed, Apr 3, 8:21 PM
Unknown Object (File)
Wed, Apr 3, 8:14 PM
Subscribers

Details

Summary

For Blob service hosted multimedia, we don't store their content in the uploads table, but still need to store their metadata (dimensions, encryption key etc). This diff implements the endpoint code to upload this metadata. In contrast to the upload_multimedia, both input and output are JSON so we can use tcomb instead of manual validation.

The endpoint will be exposed in the next diff.

Depends on D7618

Test Plan

This is tested in the next diff in the stack.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Apr 25 2023, 11:46 AM

Rebase. Adjusted to changes in parent diff

atul added inline comments.
keyserver/src/uploads/uploads.js
111 ↗(On Diff #25808)

Extremely minor nit, but we typically do const request in the rest of the codebase:

908629.png (1×844 px, 344 KB)

125 ↗(On Diff #25808)

We could destructure all of the fields of req above, might make things more readable?

Again, defer to you it's not a big deal

lib/types/media-types.js
117–118 ↗(On Diff #25808)

We have a Dimensions type (lib/types/media-types) that could be used here?

Up to you, you have more context

This revision is now accepted and ready to land.May 3 2023, 10:01 AM
lib/types/media-types.js
117–118 ↗(On Diff #25808)

The reason is that I wanted to keep the payload message flat.
I can possibly do ...Dimensions to avoid redefining width and height