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)
Wed, Dec 11, 7:47 PM
Unknown Object (File)
Thu, Dec 5, 2:34 AM
Unknown Object (File)
Thu, Dec 5, 12:25 AM
Unknown Object (File)
Sun, Dec 1, 6:35 PM
Unknown Object (File)
Sat, Nov 30, 6:44 AM
Unknown Object (File)
Sat, Nov 30, 6:14 AM
Unknown Object (File)
Fri, Nov 29, 2:31 PM
Unknown Object (File)
Nov 27 2024, 8:58 AM
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