Skip to content

feat(merkleservice): forward CallbackToken to merkle-service /watch#131

Merged
galt-tr merged 1 commit into
mainfrom
fix/forward-callback-token-to-merkle
May 3, 2026
Merged

feat(merkleservice): forward CallbackToken to merkle-service /watch#131
galt-tr merged 1 commit into
mainfrom
fix/forward-callback-token-to-merkle

Conversation

@galt-tr
Copy link
Copy Markdown
Contributor

@galt-tr galt-tr commented May 3, 2026

Summary

  • merkleservice.Client.Register / RegisterBatch now accept and forward arcade's configured cfg.CallbackToken in the /watch request body.
  • The propagator passes p.cfg.CallbackToken through to every Register call.
  • Empty tokens omit the field (omitempty) so back-compat is preserved.

Closes the arcade half of the broken callback-auth loop:

Test plan

  • go build ./...
  • go vet ./...
  • go test ./merkleservice/... ./services/propagation/... -race
  • New Register test asserts the request body contains callbackToken when set, omits it when empty
  • Reviewer to confirm propagator's Register call site is the only outbound site

Coordination

This PR is harmless on its own - merkle-service silently ignores unknown JSON fields, so behaviour is unchanged until the merkle-service PR also lands. Recommend merging both within the same window; on rollout the arcade-v2 testnet and teratestnet flux configmaps need a callback_token added (mainnet already has one). See plan in /home/dylan/.claude/plans/in-this-directory-we-serene-star.md for the flux diff.

…tration

Arcade's /api/v1/merkle-service/callback requires bearer-token auth via
cfg.CallbackToken (PR #112 / F-018), but the /watch registration to
merkle-service didn't tell merkle-service what token to send back.
Result: merkle-service calls arcade with no Authorization header and
gets 401.

Register/RegisterBatch now accept a callback-token argument and emit
it in the watchRequest JSON. The propagator passes cfg.CallbackToken
through. Empty tokens omit the field so older deployments without a
configured token continue to work as today (with the same 401 they
already get from the inbound check, which is the correct fail-closed
behaviour).

Pairs with merkle-service PR <leave-placeholder> which makes the
receiving end actually store and forward the token on outbound
delivery. Both PRs must merge before authenticated callbacks work.
@galt-tr galt-tr requested a review from mrz1836 as a code owner May 3, 2026 15:18
@github-actions github-actions Bot added size/M Medium change (51–200 lines) bug-P3 Lowest rated bug, affects nearly none or low-impact feature Any new significant addition labels May 3, 2026
@galt-tr galt-tr merged commit 8fc2e42 into main May 3, 2026
45 checks passed
@galt-tr galt-tr deleted the fix/forward-callback-token-to-merkle branch May 3, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-P3 Lowest rated bug, affects nearly none or low-impact feature Any new significant addition size/M Medium change (51–200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants