Skip to content

signer: Add auth webhook callback#3897

Open
j0sh wants to merge 2 commits intomasterfrom
ja/signer-auth
Open

signer: Add auth webhook callback#3897
j0sh wants to merge 2 commits intomasterfrom
ja/signer-auth

Conversation

@j0sh
Copy link
Copy Markdown
Collaborator

@j0sh j0sh commented Apr 7, 2026

Optionally add an auth callback to remote payment requests so operators
can enforce policy checks before the remote signer sends down payments.

When configured, the handler POSTs a JSON body containing the incoming
request headers and the current signer state to the webhook URL right
before encoding and signing. Configured auth headers are attached to the
outbound request. Non-200 responses are propagated back to the caller
through the existing API error envelope, preserving the upstream status
code.

Allow the auth webhook to return an expiry field (Unix seconds) in
its 200 response. The value is persisted in the signer's state and
checked on subsequent requests. If the expiry hasn't yet passed, the
webhook call is skipped. Once expired (or absent), auth resumes.

New CLI flags:
-remoteSignerWebhookUrl Webhook endpoint to call
-remoteSignerWebhookHeaders Outbound auth headers (key:val,key2:val2)

Omit -remoteSignerWebhookUrl to keep the existing behavior unchanged.

j0sh added 2 commits April 7, 2026 15:09
Optionally add an auth callback to remote payment requests so operators
can enforce policy checks before the remote signer sends down payments.

When configured, the handler POSTs a JSON body containing the incoming
request headers and the current signer state to the webhook URL right
before encoding and signing. Configured auth headers are attached to the
outbound request. Non-200 responses are propagated back to the caller
through the existing API error envelope, preserving the upstream status
code.

New CLI flags:
  -remoteSignerWebhookUrl       Webhook endpoint to call
  -remoteSignerWebhookHeaders   Outbound auth headers (key:val,key2:val2)

Omit -remoteSignerWebhookUrl to keep the existing behavior unchanged.
Allow the auth webhook to return an `expiry` field (Unix seconds) in
its 200 response. The value is persisted in the signer's state and
checked on subsequent requests. If the expiry hasn't yet passed, the
webhook call is skipped. Once expired (or absent), auth resumes.
@j0sh j0sh requested review from eliteprox, leszko and seanhanca April 7, 2026 22:12
@github-actions github-actions bot added go Pull requests that update Go code docs labels Apr 7, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 67.18750% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.21937%. Comparing base (9e68815) to head (660d5fd).

Files with missing lines Patch % Lines
server/remote_signer.go 68.42105% 6 Missing and 6 partials ⚠️
cmd/livepeer/starter/starter.go 62.50000% 9 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3897         +/-   ##
===================================================
+ Coverage   32.87450%   33.21937%   +0.34487%     
===================================================
  Files            171         171                 
  Lines          42063       42117         +54     
===================================================
+ Hits           13828       13991        +163     
+ Misses         27194       27078        -116     
- Partials        1041        1048          +7     
Files with missing lines Coverage Δ
cmd/livepeer/starter/flags.go 87.21805% <100.00000%> (+87.21805%) ⬆️
core/livepeernode.go 75.16779% <ø> (ø)
cmd/livepeer/starter/starter.go 22.32620% <62.50000%> (+0.53133%) ⬆️
server/remote_signer.go 59.59079% <68.42105%> (+0.95056%) ⬆️

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e68815...660d5fd. Read the comment docs.

Files with missing lines Coverage Δ
cmd/livepeer/starter/flags.go 87.21805% <100.00000%> (+87.21805%) ⬆️
core/livepeernode.go 75.16779% <ø> (ø)
cmd/livepeer/starter/starter.go 22.32620% <62.50000%> (+0.53133%) ⬆️
server/remote_signer.go 59.59079% <68.42105%> (+0.95056%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs go Pull requests that update Go code

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant