Skip to content

Commit

Permalink
[Sanitization] Fine-tune input parsers (#192)
Browse files Browse the repository at this point in the history
Add tests for various input parsers. Fixed the following bugs:

* `searchCardsParamsValidator.cardIDs` checks for csv mongo IDs.
* `addCardParamsValidator.tags` and `partialCardValidator.tags` check for csv.
* `partialCardValidator.id` is required.
* `partialCardValidator.urgency` checks for finite non-negative numbers.
* `partialCardValidator` drops `metadataIndex` and `createdById` as these are read-only.
* `partialCardValidator.lastReviewed` parses the value into a `Date` object.
* `partialCardValidator` checks that `numChildren`, `numTimesMarkedAsDuplicate`, and `numTimesMarkedForReview` are non-negative finite integers.
* `userSettingsParamsValidator.cardsAreByDefaultPrivate` checks for the `on` literal.
* `userSettingsParamsValidator.dailyTarget` is now optional.
* User names must be alphanumeric and at least 3 chars long.
* Passwords must be at least 8 chars long.
  • Loading branch information
dchege711 authored Jul 14, 2024
1 parent 70d3ef8 commit 3233494
Show file tree
Hide file tree
Showing 2 changed files with 1,293 additions and 31 deletions.
Loading

0 comments on commit 3233494

Please sign in to comment.