-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Add support for regex string for password policy validatorPattern setting #3331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for regex string for password policy validatorPattern setting #3331
Conversation
@bhaskaryasa this looks good to me. one question, if you supply a bad regex string like say: what happens? I'd think that you'd want the server to not start and make sure that you get a decent error message or stack trace so it is obvious what is causing the failure? what do you think? |
@bhaskaryasa This is good! Particularly thorny issue if you are using the parse-server lib directly (i.e $ parse-server /path-to-config.json). It is basically impossible to supply either a validation callback or pure regex. this fixes the regex bit. still don't think you can pass a callback in the currently documented way. @acinader before this fix, if you submit a regex string it fails JSON validation with "unexpected token..." |
@livingstonef you can provide a 'js' config file as well, as it's loaded through a |
@acinader - I believe JSON parsing itself would fail if you passed something like '\xx'. That should cause the Parse Server startup failure with the exception logged. |
@flovilmart - I did not know that was possible!! Nice 👍 |
@bhaskaryasa yeah, that'd be my guess to. Can you please verify that the server doesn't start and that the error doesn't get eaten somehow? |
@acinader - Yes, tested. Startup fails with SyntaxError: Unexpected token x in JSON at position 202. |
@flovilmart could you please provide an example of js file that can be used for initialization of parse-server? |
|
@flovilmart thanks! |
fixes issue #3302