feat(api): forgot-password, email change, gas-tank status, payment-links authz matrix - #387
Merged
Emmyt24 merged 7 commits intoSep 28, 2026
Conversation
There was no dedicated read endpoint for a wallet's gas-tank status, forcing a dashboard to either lack this data or infer it awkwardly from other responses. Adds a focused GET route returning the tank's account, provisioning state, and today's budget spend.
payment_links.rs mixes owner-authenticated and fully-public routes with no consolidated authorization regression test, unlike other route groups already covered by authz_matrix_tests.rs. Extends the same matrix pattern to this file.
There was no recovery path for a user locked out of their account. Adds a request/confirm password-reset pair reusing the existing OTP infrastructure, with the same account-enumeration protection already established for login/signup.
There was no way to change a user's login email. Adds a two-step request/confirm flow that verifies control of the new address via OTP before applying the change, so a typo or attacker-supplied address can't silently take over the account's login identity.
…very-gas-tank-authz-matrix
…api/auth-recovery-gas-tank-authz-matrix
|
@aishatumba5-svg 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! 🚀 |
…-recovery-gas-tank-authz-matrix # Conflicts: # crates/api/src/auth.rs # crates/api/tests/api_tests.rs # crates/email/src/templates.rs # crates/store/src/lib.rs # crates/store/tests/store_tests.rs # docs/openapi.yaml
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.
Summary
POST /v1/auth/request-password-reset(identical response and timing whether or not the account exists) andPOST /v1/auth/confirm-password-reset. A successful reset revokes every existing session via a per-usersession_epochcarried in the JWT.POST /v1/auth/change-email(requires current password, sends an OTP bound to the new address) andPOST /v1/auth/change-email/confirm. Never applied on the request step alone; audit-logged; the old address is notified.GET /v1/wallets/:id/gas-tank: public tank account, provisioned state, and today's reserved spend against budget. No sealed-seed fields; a wallet without a tank returns a cleanprovisioned: false.authz_matrix_tests.rs.Security hardening found along the way
Notes
0021(session epoch,password_resetOTP purpose) and0022(email_changepurpose).Store::revoke_token/is_token_revokedreference a non-existent column and look like dead code.Test plan
cargo test -p octo-apinew suites:password_reset_tests,email_change_tests,authz_matrix_tests, gas-tank tests inapi_testsauth_tests,session_revocation_tests,store_tests(regression)cargo fmt --check,cargo clippy -D warningsCloses #323
Closes #324
Closes #325
Closes #326