HomePhabricator
Diffusion Comm 7492050ea7d9

[keyserver] Move validators to endpoint array

Description

[keyserver] Move validators to endpoint array

Summary:
(ENG-3879)[https://linear.app/comm/issue/ENG-3879/move-output-and-input-validators-outside-of-the-responders]

Followup to the id schema work. Moving all the validation to the endpoint array makes it less likely for the devs to forgot to add it (which already happened a few times). Additionaly it moves the validation logic outside of the responder and now they are fully focused on the business logic.

An additional change that needed to be made was exporting the input validators, so they could be imported in the endpoints.js.

I choose to not split it into multiple diffs, because I'm doing the same thing everywhere, but if it's hard to review I can split into more diffs.

Test Plan:

  • run yarn flow-all (note: for some reason flow allows wrong output responders, even they are correctly typed with generics)
  • play around the app and check if everything works correctly (in particular I tested log in, register and siwe flows)

Reviewers: kamil, tomek

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D8661

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Jul 28 2023, 10:02 AM
Reviewer
tomek
Differential Revision
D8661: [keyserver] Move validators to endpoint array
Parents
rCOMMf5fdef760d4e: [desktop] Add context menu
Branches
Unknown
Tags
Unknown

Event Timeline