Typing Issue with passwordPolicy validatorCallback
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- javascript, typescript
Research direction
Start with types/Options/index.d.ts at the passwordPolicy validatorCallback declaration, then compare it with the usage in spec/PasswordPolicy.spec.js and the callback invocation in src/RestWrite.js. Update the typing so the documented callback usage produces no TypeScript error, and verify the relevant password-policy checks still pass.
Written by the indexing model from the issue text.
Description
New Issue Checklist
- Report security issues confidentially.
- Any contribution is under this license.
- Before posting search existing issues.
Issue Description
Incorrect passwordPolicy Option validatorCallback typing.
The typing of the validatorCallback is () => void right now.
The spec uses this as () => bool
The rest prototype uses this as (password: string) => bool
Steps to reproduce
Add a passwordPolicy validatorCallback with correct typing:
const validatePassword = (password: string): boolean => {
console.log('Validating password security');
return password === 'badpw' ? false : true;
};
Actual Outcome
Type '(password: string) => boolean' is not assignable to type '() => void'.
Target signature provides too few arguments. Expected 1 or more, but got 0.ts(2322)
index.d.ts(229, 5): The expected type comes from property 'validatorCallback' which is declared here on type 'PasswordPolicyOptions'
Expected Outcome
No typescript error.
Environment
I am using 9.9.0, but this is also on the alpha branch at time of writing.
Server
- Parse Server version:
9.9.0 - Operating system:
N/A - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Local
Database
- System (MongoDB or Postgres):
N/A - Database version:
N/A - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
N/A
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
N/A - SDK version:
N/A
Happy to fill those out more if you think it will be helpful!
Logs
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 52
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from parse-community/parse-server
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
parse-community/parse-server#10720 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
parse-community/parse-server#10710 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
parse-community/parse-server#10699 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
parse-community/parse-server#10634 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
parse-community/parse-server#10631 · 1 comment ·
Maintainers usually reply within 1 day
All issues in parse-community/parse-server
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
daisy/a11y-meta-viewer#18 ·
-
good first issue status: needs triaging type: bug version: 2.0
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
medusajs/medusa#17094 · 2 comments ·
Maintainers usually reply within 1 day
-
browser: chrome package: @carbon/react package: styles
Difficulty 1/5 Under an hour Newbie friendliness 92/100
carbon-design-system/carbon#23567 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
clerk/javascript#10033 ·
Maintainers usually reply within 1 day
-
bug client p1
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vercel/eve#4173 · 2 comments ·
Maintainers usually reply within 1 day