Repository navigation
feat: add custom password policy deny lists - #14499
Conversation
🟢 Tier S · Ready to merge
Adds optional custom deny lists to the project password dictionary and personal-data policies, exposes the configured entries in policy responses, and enforces them across password-setting and recovery flows. It also documents the policy behavior and adds validator, integration, and E2E coverage. The latest commit updates the SDK parameter-order lock for the new optional Latest changes: The new commit appends
Note @Indra55 does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve. 📂 Walkthrough · 11
Reviewed the commits since |
Meldiron
left a comment
There was a problem hiding this comment.
Overall looks very good!
One open question is if we should apply rules during sign-up or sign-up, if it should be param, and if so, if we need param in more policies
Thanks for reviewing! Currently, the rules apply whenever a password is set or changed, including sign-up and recovery. Existing passwords still work for sign-in. Should I update this PR to make sign-in enforcement optional and add the same setting to the other relevant password policies? |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
I am going forward as is. This decision is hard to make, so I am taking safe route of adding feature a bit less strict, and based on feedback, we add more configuration in future. Mostly worrying because adding configuration here will make other password policies need the same thing. |
What does this PR do?
Adds an optional
denyListstring array toupdatePasswordDictionaryPolicy()andupdatePasswordPersonalDataPolicy()so developers can block passwords and terms specific to their application.AcmeDefault123!blocks that password, but allowsMyAcmeDefault123!.appwriteblocksMyAppWrite2026!.Each list applies only while its policy is enabled. Omitting
denyListor passingnullpreserves the current list, an array replaces it, and[]clears it. Both policy GET and list responses include the configured values.Validation applies when setting passwords through account creation, password updates, first-password setup, user administration, and recovery. Existing passwords still work for sign-in and password confirmation. Custom deny lists are not applied to imported password hashes.
A few details worth highlighting:
strtolower()behavior rather than Unicode case folding.Test Plan
Added unit tests for exact and substring matching, case handling, disabled policies, empty lists, and existing validator behavior.
Added E2E and integration coverage for policy persistence, replacement and clearing, GET/list responses, legacy routes, input validation, scopes, storage limits, and project isolation. Password-flow tests cover creation, updates, first-password setup, recovery, existing-password confirmation, and imported hashes.
Latest local checks:
Swoole\Timer.git diff --checkpassed.To run the focused tests with the development stack running:
Related PRs and Issues
Implements the two assigned custom password deny-list tasks. No linked issue.
Checklist
Endpoint metadata, response models, and recovery reference docs are updated. Generated API specs and SDK examples are not included in this PR.