You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Centralized bcrypt hashing and verification policy.
Added a bounded BCRYPT_COST configuration with a default of 12.
Added transparent rehashing after successful login when an existing bcrypt hash uses a lower cost.
Added a host benchmark command to select a suitable production work factor.
Documented the production configuration in .env.example.
Why
Password hashing was already using bcrypt, but the work factor was hard-coded at 10 in multiple paths. This change makes the work factor centrally managed and supports gradual upgrades without forcing password resets.
Compatibility
Existing bcrypt hashes remain valid. They are upgraded only after a successful login and are never downgraded when their current cost is higher than the configured value.
Validation planned
TypeScript typecheck
Lint
Password hashing benchmark on the deployment host
Security and Acceptance Gate, Docker Acceptance Gate, HURC1 IRONCLAD CI/CD PIPELINE, and CodeQL Advanced after merge to main
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d7ac45e3-8404-4214-a7f7-f060359b71a6
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
🔍 Trigger review
✨ Finishing Touches🧪 Generate unit tests (beta)
Create PR with unit tests
Commit unit tests in branch agent/harden-password-hashing
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The failing Changed-file design boundary gate was caused by src/lib/services/user-service.ts reaching 411 lines, not by twofa-service.ts. The branch has been refactored so user-service.ts is now below the 300-line boundary, while password management and role/password-reset administration were moved into focused modules:
src/lib/services/user-password-service.ts
src/lib/services/user-access-service.ts
user-service.ts re-exports the moved functions, preserving existing import paths. The GitHub Actions workflows have restarted on the new head commit.
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
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.
What changed
BCRYPT_COSTconfiguration with a default of 12..env.example.Why
Password hashing was already using bcrypt, but the work factor was hard-coded at 10 in multiple paths. This change makes the work factor centrally managed and supports gradual upgrades without forcing password resets.
Compatibility
Existing bcrypt hashes remain valid. They are upgraded only after a successful login and are never downgraded when their current cost is higher than the configured value.
Validation planned
main