feat(routes-f): implement password strength checker endpoint#599
Open
Nacho1499 wants to merge 2 commits intoStreamFi-x:devfrom
Open
feat(routes-f): implement password strength checker endpoint#599Nacho1499 wants to merge 2 commits intoStreamFi-x:devfrom
Nacho1499 wants to merge 2 commits intoStreamFi-x:devfrom
Conversation
|
@Nacho1499 is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
@Nacho1499 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


closes #564
PR Description:
implemented a self-contained password strength analysis API at /api/routes-f/password-strength. The solution provides a deterministic 0–4 score, human-readable crack time estimates, and actionable security feedback, all while maintaining zero dependencies on global utilities to ensure independent mergeability.
What were you told to do?
Implement a password strength checker endpoint at that returns a score from 0–4, feedback suggestions, and an estimated crack time. The entire implementation must be strictly scoped within the directory with no external dependencies.app/api/routes-f/password-strength/route.tsapp/api/routes-f/
What did you do?
-I developed a fully self-contained module within the directory to ensure zero dependencies on global project folders.app/api/routes-f/
-Created route.ts: Implemented a POST handler that processes passwords without logging sensitive data.
-Created _lib/helpers.ts: Built a deterministic scoring engine using regex for variety checks and a localized blacklist of 50+ common passwords.
-Created _lib/types.ts: Defined internal interfaces for strict TypeScript compliance.
-Created tests/route.test.ts: Wrote unit tests covering all 5 score tiers (0-4) and blacklist overrides.
-Verification: All 5 tests passed successfully using the project's Jest runner.
Final Files Created:
-app/api/routes-f/password-strength/route.ts
-app/api/routes-f/password-strength/_lib/helpers.ts
-app/api/routes-f/password-strength/_lib/types.ts
-app/api/routes-f/password-strength/tests/route.test.ts
Check List (Check all the applicable boxes)
[x] My code follows the code style of this project.
[x] This PR does not contain plagiarized content.
[x] The title and description of the PR is clear and explains the approach.
[x] I am making a pull request against the main branch (left side).
[x] My commit messages styles matches our requested structure.
[x] My code additions will fail neither code linting checks nor unit test.
[x] I am only making changes to files I was requested to.
Local Test Execution:
-npm run test app/api/routes-f/password-strength/
result:
PASS app/api/routes-f/password-strength/tests/route.test.ts
Password Strength Utility
√ Score 0: Known bad password (3 ms)
√ Score 1: Short but unique (1 ms)
√ Score 2: Long but low variety
√ Score 3: Good variety, medium length
√ Score 4: Excellent variety and length (1 ms)
Test Suites: 1 passed, 1 total
Tests: 5 passed, 5 total
Time: 2.936 s