Repository navigation
fix(signup): refuse a missing password confirmation; record the rate-limit store (#230) - #232
Merged
Merged
Conversation
Red: a sign-up without password_confirmation creates the account today (spec 004 AC-4.1; #218 ruling 5). A blank one is already refused; the examples pin both. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
) Registration checks an omitted confirmation as the empty one it is, so it gets a mismatch's error on the same field with 422 and no account (spec 004 AC-4.1, AC-4.3; #218 ruling 5). The form is unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… decision (#230) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
plainprogrammer
marked this pull request as ready for review
November 9, 2026 16:51
This was referenced Nov 9, 2026
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 #230. Refs #218 (rulings 4 and 5).
What changed
password_confirmationcreated the account:has_secure_passwordvalidates a confirmation withallow_nil: true, so it checks one only when it is sent.Registrationnow checks an omitted confirmation as the empty one it is, so it gets the mismatch's error ("Password confirmation doesn't match Password") on the same field, with 422 and no user or account (spec 004 AC-4.1, AC-4.3). The fix is one line inapp/models/registration.rb; the form's HTML and the copy are unchanged.docs/architecture/tenancy-and-accounts.mdreplaces the "no spec source" mark with a decision: the counters live inRails.cache(Solid Cache), and a reset on a cache clear or cache-database restore is accepted. No code change. The confirmation rule is stated there too, with Accounts and sessions: six behaviours no spec describes #218 and Sign-up refuses a missing password confirmation; record the rate-limit store as a rule #230 as sources.Tests: which example was red
password_confirmationfield absent (request spec and model spec), and anilconfirmation (model spec)."") confirmation. Rails' validator skips onlynil, so a blank one was already refused. The issue text said "missing or blank"; only "missing" was the gap. The examples pin both, and the mismatch and success examples stay green.docs/lessons/2026-11-09-check-the-validator-before-calling-a-test-red.md.Other password paths: checked, not affected
app/controllers/admin/users_controller.rb:55permits onlyname,email_addressandpassword. They have no confirmation by design (spec 004 AC-5.2, AC-5.3: "the admin's new-password field has no confirmation").app/models/user/command.rb:12setsuser.passworddirectly (collector:user,lib/tasks/collector.rake; spec 004 AC-5.7).Implementation review (Mode B, Opus, read-only, no spec so recorded here)
SPEC-ALIGNED. No blocking or major findings. Three minors: a Sources line still said "six" (fixed), the doc's "no confirmation by design" sentence now also cites AC-5.2 (fixed), and a note that a blank password with a blank confirmation shows both errors, which is unchanged behaviour. The area-doc change was reviewed separately (Fable, read-only): APPROVE, minors applied (the count dropped from the "no spec source" bullet to ease merging with #228 and #229).
Verification
bin/ciand the push was accepted (heada4459ec); the suite has 2838 examples (bin/rspec --dry-runcount). The hook prints nothing on a pass; GitHub CI on this head is the evidence of record.bin/rspec spec/requests/registrations_spec.rb spec/models/registration_spec.rb spec/models/user_spec.rb spec/requests/sessions_spec.rb spec/requests/admin114 examples, 0 failures (before the doc and lesson commits).Owed
main, once Sessions expire after 30 days unused, and stop storing IP address and user agent #228, Hold instance_settings to exactly one row #229 and Scanner area doc: record #219's rulings and measurement mode's local-only rule #231 land (coordinator's rule).🤖 Generated with Claude Code