feat: webhook dispatch, disputes pages, security danger zone, and public verify page - #1216
Conversation
|
@Nimatstar is attempting to deploy a commit to the Mftee's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Nimatstar 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! 🚀 |
mftee
left a comment
There was a problem hiding this comment.
Reviewed. Solid work overall:
contract/src/webhook.rs(CT-38): fire-and-forget dispatch viatokio::spawn, correct hand-rolled HMAC-SHA256 signing, wired into submit/verify/revoke/transfer, with real unit + mock-server tests.- Disputes list/detail pages and the public
/verify/[hash]page: proper loading/error/empty states, client-side hash validation before hitting the API, dev-mode mock-data fallback clearly surfaced to the user via the status message.
One thing that needs a fast follow-up before this reaches real users: the new 'Danger Zone' → 'Delete account' flow on the security settings page shows a real, scary confirmation ('This action cannot be undone... permanently deleted') but handleDelete is currently a stub — it just waits 800ms and redirects to /login without calling any delete endpoint (there's a // Replace with: await api.delete('/users/me') TODO in the code). Right now a user who clicks through that confirmation is told their account was deleted when it wasn't. Not blocking this merge since it's clearly WIP, but this should not ship to production behind that confirmation copy until the real call is wired in.
Approving.
Resolve conflicts in contract/src/lib.rs between the webhook dispatch (PR CodeGirlsInc#1216) and the audit-event log (PR CodeGirlsInc#1217): both are additive and independent, so both calls run at each of the four write sites (transfer, verify, submit, revoke).
Merging per repo maintainer review. Resolved a real conflict in contract/src/lib.rs against PR #1216 (webhook dispatch): both the audit-event write and the webhook dispatch are additive, so both now run at each of the four write sites (transfer/verify/submit/revoke). Pre-existing CI failures predate this PR.
Resolve conflicts in contract/src/lib.rs and contract/src/main.rs between the rate limiter (PR CodeGirlsInc#1218) and the webhook fields (PR CodeGirlsInc#1216): both are additive AppState fields, so both are kept. Also fixes a compile break in the test suite left by PR CodeGirlsInc#1216: two pre-existing AppState test fixtures (contract/src/health.rs, contract/src/tests/integration.rs) were never updated for the webhook_urls/webhook_secret fields it added, so 'cargo test' has not compiled since that PR merged. Backfilled those fixtures plus this PR's own new fixtures (rate_limit.rs, revoke.rs) with the new fields, using permissive rate-limiter values so existing tests are unaffected.
…-942 Merging per repo maintainer review. Resolved a real conflict in contract/src/lib.rs and contract/src/main.rs against PR #1216 (webhook fields): both the rate limiter and webhook fields are additive AppState fields, so both are kept. Also backfilled two pre-existing test fixtures (health.rs, tests/integration.rs) that PR #1216 left broken by not updating them for the new webhook_urls/webhook_secret fields — cargo test has not compiled since #1216 merged; this restores that. Pre-existing CI failures otherwise predate these PRs.
Summary
contract/src/webhook.rs: webhook events are now POSTed to the configuredWEBHOOK_URLS(HMAC-SHA256 signed via theX-Signatureheader) on successful verify, submit, revoke and transfer. Delivery is fire-and-forget and failures are only logged./disputes(list + file-a-new-dispute form) and/disputes/:id(detail with classified reason, description and status timeline) pages, with an empty state./verify/:hashpage (no login) that validates the hash client-side, calls the public verify endpoint, shows verified/not-verified status with Stellar transaction details, includes a copyable shareable URL, and explains what verified on Stellar means.Closes #943
Closes #931
Closes #930
Closes #927