Introduce validators for entry, keys, siwe, message report, relationship and search responders and tests, most of which are taken from real requests that I've logged. I decided to not split it in multiple diffs because it's mostly just 1-2 validators per responder type and each change is localized to the responder.
Details
Details
- Reviewers
kamil tomek - Commits
- rCOMM412d852d37f0: [keyserver] Introduce responder validators
yarn jest
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
keyserver/src/responders/entry-responders.js | ||
---|---|---|
131–135 ↗ | (On Diff #25930) | export type FetchEntryInfosBase = { +rawEntryInfos: $ReadOnlyArray<RawEntryInfo>, }; export type FetchEntryInfosResponse = { ...FetchEntryInfosBase, +userInfos: { [id: string]: AccountUserInfo }, }; |
154–157 ↗ | (On Diff #25930) | export type FetchEntryRevisionInfosResult = { +result: $ReadOnlyArray<HistoryRevisionInfo>, }; |
179–184 ↗ | (On Diff #25930) | export type SaveEntryResponse = { +entryID: string, +newMessageInfos: $ReadOnlyArray<RawMessageInfo>, +updatesResult: ServerCreateUpdatesResponse, }; |
221–227 ↗ | (On Diff #25930) | export type DeleteEntryResponse = { +newMessageInfos: $ReadOnlyArray<RawMessageInfo>, +threadID: string, +updatesResult: ServerCreateUpdatesResponse, }; |
244–248 ↗ | (On Diff #25930) | export type RestoreEntryResponse = { +newMessageInfos: $ReadOnlyArray<RawMessageInfo>, +updatesResult: ServerCreateUpdatesResponse, }; |
259–264 ↗ | (On Diff #25930) | export type DeltaEntryInfosResult = { +rawEntryInfos: $ReadOnlyArray<RawEntryInfo>, +deletedEntryIDs: $ReadOnlyArray<string>, +userInfos: $ReadOnlyArray<AccountUserInfo>, }; |
keyserver/src/responders/message-report-responder.js | ||
20–21 ↗ | (On Diff #25930) | export type MessageReportCreationResult = { +messageInfo: RawMessageInfo, }; |
keyserver/src/responders/relationship-responders.js | ||
21–27 ↗ | (On Diff #25930) | export type RelationshipErrors = $Shape<{ invalid_user: string[], already_friends: string[], user_blocked: string[], }>; |
keyserver/src/responders/search-responders.js | ||
20–23 ↗ | (On Diff #25930) | export type UserSearchResult = { userInfos: $ReadOnlyArray<GlobalAccountUserInfo>, }; |
keyserver/src/responders/siwe-nonce-responders.js | ||
11–12 ↗ | (On Diff #25930) | export type SIWENonceResponse = { +nonce: string, }; |
keyserver/src/responders/relationship-responders.js | ||
---|---|---|
21–27 ↗ | (On Diff #25930) | I don't exactly remember why we chose to use underscores here, but I know it's been like this since it was implemented |