Conversation
|
@pajgo & @belkinadasha - please take a look, as for me - LGTM |
|
@AVVS Restored plugin behavior and added additional checks. |
* skipFieldNames parameter * additional tests
25186e7 to
c5147e3
Compare
| ``` | ||
|
|
||
| ### forceCheckFieldNames __string[]__ | ||
| Allows to force Validation event if the Validator disabled: |
There was a problem hiding this comment.
if the Validator is disabled
| const validatorConfig = { | ||
| minStrength: 4, | ||
| skipFieldName: 'validate', // if `data.validate` eq true 'data.myfield' is skipped during validation | ||
| enabled:false, // Will validate the `data` object anyway |
There was a problem hiding this comment.
missing space after the semicolon
| minStrength: 4, | ||
| skipFieldName: 'validate', // if `data.validate` eq true 'data.myfield' is skipped during validation | ||
| enabled:false, // Will validate the `data` object anyway | ||
| forceCheckFieldNames: ['forceValidate'], // if `data.validate` not exists 'data.myfield' is skipped during validation |
There was a problem hiding this comment.
What does the comment mean?
|
|
||
| // Force validation | ||
| const data = { | ||
| myfield: 'fooBar', // in schema "myfield":{"password": true} keyword. |
There was a problem hiding this comment.
I suggest to rename myfield to camelCase everywhere for a neat look
| * Validation skipped if `Object[field]` set. | ||
| * Validation performed if `Object[field]` not exists. | ||
|
|
||
| Eg: |
| forceCheckFieldName: ['checkPassword'], // force enable password to check if the object field value set.. | ||
| inputFieldNames: [ // Linked fields list, allow filter case sensitive data in the password from the parent object. | ||
| skipCheckFieldNames: ['skipPassword'], // Force disable password to check if the object field value exists. | ||
| forceCheckFieldNames: ['checkPassword'], // Force enable password check if the object field value exists. |
There was a problem hiding this comment.
How about "forces password check <...>" and "disables password check <...>" (one line above)?
| inputFieldNames: [ // Linked fields list, allow filter case sensitive data in the password from the parent object. | ||
| skipCheckFieldNames: ['skipPassword'], // Force disable password to check if the object field value exists. | ||
| forceCheckFieldNames: ['checkPassword'], // Force enable password check if the object field value exists. | ||
| inputFieldNames: [ // Linked fields list, allow filter the sensitive data in the password from the parent object. |
There was a problem hiding this comment.
"allows to filter sensitive data <...>" or "allows sensitive data filtering <...>"
|
|
||
| ## OTP and Empty Password | ||
| The `password` field is not defined as `required` in current `schemas`. | ||
| Validation does not happen because This field does not exist in the OTP registration request. |
There was a problem hiding this comment.
Validation is not performed because this field <...>
| ## OTP and Empty Password | ||
| The `password` field is not defined as `required` in current `schemas`. | ||
| Validation does not happen because This field does not exist in the OTP registration request. | ||
| When the Service performs password generation, `skipPassword` property does not exist in the registration request, so validation not executing on generated passwords. |
There was a problem hiding this comment.
- double space before
skipPassword - <...> so the validator does not check these generated passwords.
| }); | ||
| }); | ||
|
|
||
|
|
There was a problem hiding this comment.
I think it could be nice to add a test that uses checkPassword field that forces validation so that forceCheckFieldNames feature could have its deserved test coverage :)
* doc typos * additional tests
|
@belkinadasha Fixed. Please re ^) |
|
🎉 This PR is included in version 11.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.