-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(mrf): attachment v2 #7281
Merged
Merged
fix(mrf): attachment v2 #7281
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…hment encryption to submission level
@justynoh LGTM for the admin changes! I couldn't approve this PR myself |
justynoh
approved these changes
May 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm'ed by ken
kathleenkhy
added a commit
that referenced
this pull request
May 6, 2024
* fix(deps): bump zod from 3.23.4 to 3.23.5 in /shared (#7301) Bumps [zod](https://github.com/colinhacks/zod) from 3.23.4 to 3.23.5. - [Release notes](https://github.com/colinhacks/zod/releases) - [Changelog](https://github.com/colinhacks/zod/blob/master/CHANGELOG.md) - [Commits](colinhacks/zod@v3.23.4...v3.23.5) --- updated-dependencies: - dependency-name: zod dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(deps): bump type-fest from 4.18.0 to 4.18.1 in /shared (#7303) Bumps [type-fest](https://github.com/sindresorhus/type-fest) from 4.18.0 to 4.18.1. - [Release notes](https://github.com/sindresorhus/type-fest/releases) - [Commits](sindresorhus/type-fest@v4.18.0...v4.18.1) --- updated-dependencies: - dependency-name: type-fest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(deps): bump ejs from 3.1.8 to 3.1.10 (#7304) Bumps [ejs](https://github.com/mde/ejs) from 3.1.8 to 3.1.10. - [Release notes](https://github.com/mde/ejs/releases) - [Commits](mde/ejs@v3.1.8...v3.1.10) --- updated-dependencies: - dependency-name: ejs dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(mrf): attachment v2 (#7281) * fix: add localhost domain into cors, used by attachment uploads * fix: remove attachment contents out of encrypted fields, update attachment encryption to submission level * chore: fix typo on throw -> throws * feat: handle attachments for admin flow, backward compatibility * chore: update chromium version for production Dockerfile * chore: update error --------- Co-authored-by: Justyn Oh <justynoh@gmail.com> * chore: bump version to v6.119.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Justyn Oh <justynoh@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Encrypted content of MRF with attachments is huge as it contains the attachments contents.
Solution
Overview
First, we introduce a new backward-compatibility key
mrfVersion
in the multirespondent submission object. This is initialized as 1 for all new MRF submissions. Here are the differences between the two values.Old version:
mrfVersion === undefined
New version:
mrfVersion === 1
Changelog
Therefore, this PR does the following changes.
encryptedContent
mrfVersion === 1
check)MultirespondentSubmissionDtoWithAttachments
is created to allow for rehydration of the encrypted attachmentsgetMultirespondentSubmissionById
. (This will slow down the initial load, but provides compatibility quickly. If the UX is slow, it might make sense for us to provide a loading screen to handle this.)useEffect
inPublicFormProvider
, via thepreviousAttachments
variable, based on whethermrfVersion === 1
mrfVersion === 1
responses, since attachments are now encrypted with a different keyBreaking Changes
mrfVersion: 1
on the encryptedContent.Tests
Before deployment tests
Prepare for backward compatibility tests
After deployment tests
Backward compatibility tests
For the submission that was made earlier,
End-to-end tests for the new protocol
Ensure that attachments up to 20MB are supported
(note: this is not testable on staging as a result of infra-level limitations. test this on production as a manual test once the new version is released)