Repository navigation
Issue 32-character password reset codes - #1552
w3irdrobot wants to merge 2 commits into
Conversation
|
this builds on #1550. we should allow our frontends to be updated for a while before starting to dole our 32 character codes |
AnthonyRonning
left a comment
There was a problem hiding this comment.
on hold for a few weeks at least
Raise emailed password reset codes (user and platform) from 8 to 32 uppercase alphanumeric characters. Move the generator out of AppState since it never used self, and add a unit test for length and charset. The Maple reset email showed the code with large, widely spaced type that a 32-character code would overflow. Render it at 18px with break-all wrapping instead, and drop the now-unused .code-lg rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reset codes are looked up by the exact string submitted, so a code retyped in lowercase or pasted with stray whitespace missed and spent one of the reset request's attempts. Only the Research form cleaned the code up; other SDK clients sent it as typed. Strip whitespace and ASCII-uppercase the submitted code before lookup on both the user and platform paths. Issued codes are uppercase A-Z0-9, so they are unchanged by this and codes already issued stay valid. Refs #1580 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
50c2ce3 to
dbf482d
Compare
|
Heads up: this branch was force-pushed. It is rebased onto current master, and it now carries a second commit.
It sits here because it is an enclave change and this PR already needs an EIF build and PCR approval. The Research form half of #1580 is in a separate frontend PR. Issued codes are uppercase Validation on the rebased tree, in
Not run: an end-to-end reset in a local stack, or an EIF build. The "deploy only after #1550 is live" note in the description is out of date: #1470 replaced that form, and the form on master already accepts 8 to 32 characters (any non-empty code once #1598 merges). |
Summary
[A-Z0-9]).generate_alphanumeric_codemoves out ofAppStateinto a free function, since it never usedself. The newnormalize_password_reset_codesits next to it, and both are unit-tested..code-lg), so a 32-character code would overflow the email. It now renders at 18px monospace withword-break: break-all, and the unused.code-lgrules are gone.Email verification codes are unchanged. They are already UUIDv4s (32 hex digits).
Behavior to be aware of
Rollout
patternfrom Accept 32-character password reset codes in Research #1550 with an 8 to 32 character check, and Loosen the Research reset-code check to non-empty input #1598 loosens it to any non-empty code. No frontend change has to land before this deploys.Validation
In
services/opensecretthrough the pinned Nix shell, on the current head (rebased onto master):cargo fmt --all -- --check: passcargo clippy --locked --all-targets --all-features -- -D warnings: passcargo test --locked --all-features: 1197 passed, 0 failed, 106 ignoreddisposable_db_tests.sh): 102 passed, none skipped, including a/password-reset/v2/optionsroute test that submits lowercase and spaced codesNot run: an end-to-end reset in a local stack, an EIF build, or rendering the email in a real mail client.
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.