feat: self-contained identity webhook + collector price oracle and metering fixes#36
Merged
Conversation
4 tasks
eliteprox
force-pushed
the
feat/deploy-stack-go-bootstrap
branch
4 times, most recently
from
June 18, 2026 22:16
f45f9be to
f176e2e
Compare
eliteprox
force-pushed
the
feat/identity-webhook
branch
3 times, most recently
from
June 18, 2026 22:33
3deb669 to
5b683d8
Compare
This was referenced Jun 23, 2026
This was referenced Jun 23, 2026
Collaborator
Author
|
@rickstaa This PR is now ready for review |
Collaborator
Author
|
Need to bump to 0.5.0 |
- Updated the README to reflect changes in the OpenMeter collector's environment variables, replacing `ETH_USD_PRICE` with `PRICE_ORACLE_URL` and `PRICE_ORACLE_REFRESH`. - Enhanced the collector's configuration to fetch ETH/USD prices from the specified oracle URL, with improved error handling and caching mechanisms. - Clarified the parsing of `auth_id` to accommodate new usage semantics, ensuring compatibility with existing systems while normalizing CloudEvents emitted by the collector.
…ation Updated the collector.yaml file to set the default interval for price refresh to 5 minutes, ensuring proper functionality of the price oracle refresh mechanism.
Adds the Node.js identity webhook for remote signer authentication using builder-sdk's API-key provider (@pymthouse/builder-sdk@0.5.0), wires the remote-signer to depend on it via REMOTE_SIGNER_WEBHOOK_URL, and adds the Docker Compose stack for runtime services. Squashed from 15 commits on feat/identity-webhook (PR #36). Closes #2, #4. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Brings in OpenMeter collector price-oracle config (PRICE_ORACLE_URL/REFRESH) and auth_id parsing updates for local testing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> # Conflicts: # README.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Expanded the identity contract section to clarify the roles of `client_id` and `usage_subject` across three layers: go-livepeer, Clearinghouse, and OpenMeter/Konnect. - Updated the description of how `auth_id` is parsed and emitted in CloudEvents, including a new example egress event for better understanding. - Ensured consistency in terminology and provided additional context for the compound `auth_id` format to aid developers in implementation.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Updated the identity webhook to utilize a single verifier based on the new `IDENTITY_AUTH_MODE` environment variable, eliminating the previous fallback mechanism between OIDC and API key verifiers. - Enhanced the README to clarify the configuration of identity and authentication, including the new `IDENTITY_AUTH_MODE` setting and its implications for verifier selection. - Simplified the server implementation by removing redundant functions and improving logging for the identity webhook's operational modes. - Added tests to ensure correct behavior of the new verifier logic, validating both API key and OIDC modes independently.
- Renamed `OPENMETER_INGEST_URL` to `OPENMETER_URL` in `.env.example` and updated related documentation to reflect this change. - Modified `collector.yaml` to use the new `OPENMETER_URL` for event ingestion, ensuring consistency across configurations. - Enhanced `entrypoint.sh` to validate the `OPENMETER_URL` and append the appropriate events path based on the URL format. - Updated README to clarify the new configuration for OpenMeter and its integration with the collector.
- Eliminated the empty interval field in the price_warm generation configuration within collector.yaml, ensuring cleaner and more accurate configuration.
9 tasks
…r handling - Introduced a maximum payload size limit of 64KB in the identity webhook server to prevent excessive data processing. - Enhanced the readBody function to reject requests exceeding the size limit with a 413 status code. - Updated OIDC verification error handling to log warnings instead of exposing error messages, improving security. - Renamed a test case for clarity regarding OIDC verification behavior when required scopes are missing.
eliteprox
added a commit
that referenced
this pull request
Jul 1, 2026
Adds the Node.js identity webhook for remote signer authentication using builder-sdk's API-key provider (@pymthouse/builder-sdk@0.5.0), wires the remote-signer to depend on it via REMOTE_SIGNER_WEBHOOK_URL, and adds the Docker Compose stack for runtime services. Squashed from 15 commits on feat/identity-webhook (PR #36). Closes #2, #4. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Four related changes to the clearinghouse stack:
/authorizewire protocol in-repo, with API-key and OIDC (JWT/JWKS viajose) verifiers. No external SDK dependency.ETH_USD_PRICEwith a fetched-and-cached oracle price.subjectfor Konnect customer attribution,billable_usd_microspassthrough, and a Benthos pipeline bugfix that silently dropped all events..env(from.env.example) for all Compose services; per-service.env.examplefiles removed.1. Identity webhook
identity-webhook/— Node service at repo root. Implements the go-livepeer remote-signer webhook protocol (protocol.mjs) and pluggable end-user verifiers (verifiers.mjs): API keys (sk_*fromDEMO_API_KEY/DEMO_API_KEYS) and optional OIDC JWTs (JWKS viajose).IDENTITY_AUTH_MODE(api_key|oidc) selects exactly one verifier — no fallback. Stateless — no local identity DB. 32 unit tests.remote-signerdepends_onkafka(healthcheck-gated) only;identity-webhookstarts independently. This supports signer-only alive checks (docker compose up kafka remote-signerwithREMOTE_SIGNER_WEBHOOK_URLunset). When the webhook is used, setREMOTE_SIGNER_WEBHOOK_URL=http://identity-webhook:8090/authorize(default in.env.example).Authorization: Bearer sk_…(API key mode) orAuthorization: Bearer <jwt>(OIDC mode) to the signer; the webhook resolves credentials toauth_id = "{client_id}:{usage_subject}".127.0.0.1:8081by default; use a Compose override to bind0.0.0.0only when the webhook is configured.Note: leave
REMOTE_SIGNER_WEBHOOK_URLempty for local alive checks only (inherited frommain). Production deployments must setREMOTE_SIGNER_WEBHOOK_URLandWEBHOOK_SECRET.2. ETH/USD price oracle (collector)
PRICE_ORACLE_URL(default Coinbase spot) andPRICE_ORACLE_REFRESH(default5m) replace staticETH_USD_PRICE.sequenceinput that blocks Kafka consumption until the cache is populated, then refreshed on the configured interval. Refresh errors keep the last cached value; runtime events read from cache only (cache miss throws).{"price":…},{"ethereum":{"usd":…}}(CoinGecko),{"data":{"amount":"…"}}(Coinbase).3. Collector CloudEvents fixes
subjectmatch; customers are keyed byclient_id:usage_subject. The collector now emitssubject = auth_id(compound) instead of bareusage_subject, withdata.client_id/data.usage_subjectfor per-tenant/user meter dimensions. Verified against live Konnect.billable_usd_micros: emitted as interim passthrough equal tonetwork_fee_usd_microsso the billable meter validates and accumulates; phase-2 markup rules come later.branchusedroot = @, overwriting the entire message body with the metadata map. Downstream mapping then read an emptythis.data, parsed an emptyauth_id, and silently dropped everycreate_signed_ticket— so no events reached OpenMeter/Konnect. Droppingroot = @leaves the original event intact.auth_idare dropped (protects against pre-0.8.11 go-livepeer builds that omit the field).4. Unified configuration
.env.exampleat repo root; all Compose services read from.envviaenv_fileor volume mount..env.examplefiles (kafka/,remote-signer/,openmeter-collector/,identity-webhook/).Stack
Quick start
Signer-only alive check (no identity webhook):
# In .env: REMOTE_SIGNER_WEBHOOK_URL= docker compose up -d --build kafka remote-signerValidate webhook authentication response:
Test plan
cp .env.example .env→docker compose upsucceedskafkahealthy;identity-webhookhealthy (when started);remote-signerUp/authorizecurl returnsauth_id: demo-client:demo-userremote-signerlogs showUsing remote signer webhook URL http://identity-webhook:8090/authorize127.0.0.1:8081published; CLI port 4935 not publishedcd identity-webhook && npm testpasses (32 tests)output_sent > 0,output_error = 0)billable_usd_microsandnetwork_fee_usd_microsmeters accumulate on live KonnectCloses #2
Closes #4