Redeem refuses a target the completion did not record #10

Merged
heimdall merged 2 commits from heimdall/redeem-refuse-unexpected-target into main 2026-11-09 12:13:54 +00:00
Member

Redeem compared targets only when the completion recorded one, so a caller naming a target against a completion minted with none got a 201. The comparison is now symmetric: any difference between pending.targetId and request.body.targetId refuses with 403 completion_target_mismatch, without consuming the code.

Test first (commit 1 fails on main: got 201, wanted 403; commit 2 fixes). sign_in and no-target redeems still pass (both sides undefined); tests/link-binding.test.ts 11/11. Full suite: the same 30 failures with and without the change (entrypoint/idunn/etc. environmental), none new.

🤖 Generated with Claude Code

Redeem compared targets only when the completion recorded one, so a caller naming a target against a completion minted with none got a 201. The comparison is now symmetric: any difference between pending.targetId and request.body.targetId refuses with 403 completion_target_mismatch, without consuming the code. Test first (commit 1 fails on main: got 201, wanted 403; commit 2 fixes). sign_in and no-target redeems still pass (both sides undefined); tests/link-binding.test.ts 11/11. Full suite: the same 30 failures with and without the change (entrypoint/idunn/etc. environmental), none new. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Heimdall!10
No description provided.