feat(cli): add tiger user:password — console password reset - #186
Merged
Conversation
The console had no way to reset a password. That left two real dead ends: an install whose email can't be delivered (a fresh or dev box with no MTA — the web reset silently no-ops, and by design gives no hint it did) and a lone locked-out admin with no second account to rescue them. `user:password` resolves the target with `Tiger_Model_User::findByIdentifier`, so `--user=` takes an email or a username, then writes through `Tiger_Model_UserCredential::setPassword` — the SAME model the web reset uses. That is the point of the command: it is a different door, not a shortcut. The pepper, the history archive, and reuse-prevention all still apply, and the old password stops working. The install's live `Tiger_Policy_Password` is enforced by default; `--force` overrides the POLICY only, never the hashing, so a locked-out admin can always get back in without a forced password ever being stored raw. Tests exercise the command's sequence (resolve -> policy -> setPassword), since `bin/tiger` is a procedural script: identifier resolution by both email and username, old-password revocation, the single-row idempotence of a reset, history archiving driving reuse-prevention, and that a forced password is still peppered and hashed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WXgMENcwa4Q8yCJaHpjHpf
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.
Why
The console had no password reset. That leaves two real dead ends:
Found this the hard way on dev-com:
mail.transportdefaulting to PHPmail(),php sendmail_pathpointing at/usr/sbin/sendmail, and that binary not existing.What
vendor/bin/tiger user:password [--user=<email|username>] [--password=] [--force]Tiger_Model_User::findByIdentifier, so--user=accepts an email or a username.Tiger_Model_UserCredential::setPassword— the same model the web reset uses.Tiger_Policy_Password(length / complexity / reuse).--password=keeps it non-interactive.This is a different door, not a shortcut. Going through the same model means the pepper, the history archive, and reuse-prevention all still apply, and the old password stops working.
--forceoverrides the policy only, never the hashing — so a locked-out admin can always get back in, and a forced password is still peppered and bcrypted rather than stored raw.Tests
bin/tigeris a procedural script, so the tests exercise the sequence the command performs (resolve → policy →setPassword) — which is where the guarantees actually live:nullfor an unknown one--forced password is never stored in plaintext and still verifies normallyFull suite: 2048 tests, 0 failures, 15 deprecations — the existing baseline (2043 + 5 new).