fix(identity-webhook): map allowance rejects to 483/503 + publish 0.4.2#10
Conversation
Composite app_*_* token exchange was collapsing mint-gate HTTP 402 (trial_credits_exhausted) to webhook status 401, so gateways could not distinguish auth failure from exhausted funds. Forward 402 / 503 and bump to 0.4.2 for publish (0.4.1 already shipped).
go-livepeer authLivePayment only passthroughs webhook body status+reason. Align composite exchange allowance rejects with createBalanceGate: 483 insufficient_balance (not 402) and 503 billing_unavailable, preserving upstream error_description as reason for the gateway.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Extract JWKS resolver construction to reduce cognitive complexity, use typed argument errors, and simplify identity validation without changing behavior.
…xchange-allowance-wire-status
|



Summary
app_*_*exchange no longer collapses mint-gate HTTP 402 to webhook 401.authLivePayment— matchingcreateBalanceGate:402/trial_credits_exhausted→ webhook483insufficient_balancebilling_unavailable→ webhook503error_descriptionas webhookreason.Base:
feat/balance-gateTest plan
cd identity-webhook && npm test(83 passing)feat/balance-gate, then tagv0.4.2to publish/generate-live-paymentreturns HTTP 483 (not 401) when allowance is exhausted