You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rfcs/password_validation_limits.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,13 @@ A possible solution is to use existing password-strength checking solution like
19
19
Enabling password validator is Breaking change and disabled by default.
20
20
In the nearest future, when everything will be ready, a validator must be enabled.
21
21
22
+
## OTP and Empty Password
23
+
The `password` field is not defined as `required` in current `schemas`.
24
+
Validation does not happen because This field does not exist in the OTP registration request.
25
+
When the Service performs password generation, `skipPassword` property does not exist in the registration request, so validation not executing on generated passwords.
26
+
27
+
**NOTE:** Added additional test suites just to be sure.
28
+
22
29
## Validator Keyword
23
30
Service validation algorithm based on the AJV validator and all validation requirements are inside schemas. All incoming requests checked. We can add additional custom validator `password` keyword for the `password` field, which performs required checks.
24
31
@@ -56,15 +63,20 @@ When executed:
56
63
- calls `zxcvbn` to obtain a complexity of passwords and returns whether the given password matches policy
57
64
58
65
Also, we can pass user-provided data into `zxcvbn` to check whether some sensitive data used in the password.
66
+
59
67
### Sample config
60
-
`forceCheckFieldName` and `inputFieldNames` values point to parent object field
68
+
`skipCheckFieldName` - Allows skipping password check if any field exists.
69
+
`forceCheckFieldName` - Allows forcing password check if any field exists.
70
+
`inputFieldNames` - values point to parent object fields that passed into `zxcvbn`.
71
+
61
72
`enabled` - disable/enable validator. Default value is false.
62
73
```js
63
74
constconfig= {
64
75
enabled:false,
65
76
minStrength:3, // Desired strength
66
-
forceCheckFieldName: ['checkPassword'], // force enable password to check if the object field value set..
67
-
inputFieldNames: [ // Linked fields list, allow filter case sensitive data in the password from the parent object.
77
+
skipCheckFieldNames: ['skipPassword'], // Force disable password to check if the object field value exists.
78
+
forceCheckFieldNames: ['checkPassword'], // Force enable password check if the object field value exists.
79
+
inputFieldNames: [ // Linked fields list, allow filter the sensitive data in the password from the parent object.
0 commit comments