Repository navigation
Add redeemer authorization webhook - #81
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the optional per-request redeemer authorization change.
No open issues 🎉
What changed in this PR
Adds optional per-request authorization to the standalone redeemer before ticket validation and storage, while keeping accepted tickets and transaction retries independent of webhook availability.
Changes:
- Sends caller headers and ticket fields to the webhook, excluding secret
recipient_rand, and blocks admission on denials or errors. - Shares webhook header configuration through
nodeconfig, preservessigner.Headers, and adds secret-file validation and authorization metrics. - Extends forwarding timeouts and adds tests, configuration examples, and documentation.
| File | Description |
|---|---|
signer/headers.go |
Preserves Headers as an alias to the shared type. |
redemption/http.go |
Adds the authorization hook and extends forwarding timeouts. |
redemption/http_test.go |
Tests authorization admission, concurrency, and forwarding budgets. |
redeemer/auth.go |
Implements webhook requests, decisions, and metrics. |
redeemer/auth_test.go |
Covers payload privacy, failures, replay prevention, and queued redemption. |
redeemer/app.go |
Configures, validates, and wires authorization into the service. |
redeemer/app_test.go |
Tests service integration, configuration, and secret protection. |
nodeconfig/headers.go |
Houses the shared header parser and serializer. |
nodeconfig/headers_test.go |
Moves header tests into the shared package. |
nodeconfig/config.go |
Updates the package comment to mention shared configuration types. |
docs/redeemer.md |
Documents webhook setup and caller identity precautions. |
docs/metrics.md |
Documents redeemer authorization metrics. |
docs/http-api.md |
Defines webhook payloads, decisions, and failure behavior. |
configs/redeemer/config.example.toml |
Adds optional webhook secret-file examples. |
cmd/livepeer/testdata/cli/redeemer-help.golden |
Updates expected help output for authorization settings. |
Review effort: Balanced
This branch was successfully deployed
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.
Adds optional per-request authorization to the standalone redeemer. The webhook receives caller headers and ticket fields, including
sigandrecipient_rand_hash, while omittingrecipient_rand. Denials and webhook errors prevent admission; accepted tickets and transaction retries continue independently.Shares header configuration through
nodeconfig, preserving thesigner.Headersalias. Includes secret-file validation, authorization metrics and docs, and forwarding timeouts that accommodate the webhook call.Validation:
go test ./nodeconfig ./signer ./redemption ./redeemer ./cmd/livepeeragainst an isolated PR snapshot, including pinned SDK fixtures.synctest.