Skip to content

feat(routes-f): implement password strength checker endpoint#599

Open
Nacho1499 wants to merge 2 commits intoStreamFi-x:devfrom
Nacho1499:feat/password-strength-checker-endpoint
Open

feat(routes-f): implement password strength checker endpoint#599
Nacho1499 wants to merge 2 commits intoStreamFi-x:devfrom
Nacho1499:feat/password-strength-checker-endpoint

Conversation

@Nacho1499
Copy link
Copy Markdown

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

@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.

@Nacho1499
Copy link
Copy Markdown
Author

sem2 sem

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 24, 2026

@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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(routes-f): password strength checker endpoint

1 participant