feat(mock): add mock services for local webhook and ingest testing#50
Draft
eliteprox wants to merge 22 commits into
Draft
feat(mock): add mock services for local webhook and ingest testing#50eliteprox wants to merge 22 commits into
eliteprox wants to merge 22 commits into
Conversation
Kafka, remote signer, and OpenMeter collector with local compose targets.
Changed the volume binding for the signer service to use a configurable data directory. Updated the entrypoint script to correct the remote signer webhook header format for compatibility.
Drop AUTH0_PUBLIC_CLIENT_ID from deploy env/README now that the stacked identity-webhook uses API-key auth. Remove PR delivery notes from README.
…ntation Refactor the entrypoint script to use a more concise argument passing method and correct the format of the `WEBHOOK_SECRET` in the README to include the required syntax for the Authorization header.
…dpanda integration Replaced references to Apache Kafka with Redpanda in both the README and docker-compose.yml. Clarified the architecture and identity validation process for the remote signer container.
…cript Included comments in the entrypoint.sh to clarify the usage of Redpanda in development mode, highlighting the lack of security and persistence features, and linking to the relevant issue for tracking.
Updated comments in docker-compose.yml to specify that the keystore and .eth-password should be copied into deploy/data before the first run. Revised README to streamline the description of the bootstrap process for meters and features.
Updated docker-compose.yml and collector.yaml to ensure ETH_USD_PRICE is a required environment variable, removing the default value. Revised README to reflect this change, indicating that the ETH/USD rate must be provided explicitly.
…etup Added KAFKA_ADVERTISED_ADDR and KAFKA_BROKERS to the .env.example file for better Kafka integration. Updated docker-compose.yml to utilize these environment variables, simplifying the configuration for the Kafka and signer services. Revised README to document the new environment variables and their purposes.
Introduced SIGNER_ETH_KEYSTORE_PATH in docker-compose.yml to allow specifying an optional keystore directory or keyfile path. Updated entrypoint.sh to pass this new environment variable to the signer service. Revised README to document the new variable and its purpose.
Introduced SIGNER_DATA_DIR in .env.example to specify the host directory for signer state and keystore. Updated README to document this new variable and added details for SIGNER_REMOTE_DISCOVERY and ORCH_WEBHOOK_URL, enhancing clarity on their usage.
Revised .env.example to clarify OpenMeter URLs for Konnect and self-hosted setups. Updated docker-compose.yml to remove the deprecated OPENMETER_URL. Updated README to provide clearer instructions for setting up the environment.
Introduced a new `mock-services` profile in docker-compose.yml to facilitate local testing with a mock HTTP server. Added Dockerfile and Go application for handling authorize callbacks and ingest events. Updated README to include instructions for using the mock profile and environment variable configurations.
…cker Compose setup for clearinghouse stack Added a new docker-compose.yml file to define the services for the clearinghouse stack, including Redpanda, go-livepeer remote signer, and OpenMeter collector. Introduced a .gitignore file to exclude sensitive environment files and created example .env files for each service to facilitate configuration. Updated README to outline the components and setup instructions for the stack.
Enhanced the README to clarify the identity and authorization process for the remote signer, including instructions for local alive checks without a webhook. Updated .env.example to indicate that leaving REMOTE_SIGNER_WEBHOOK_URL empty allows starting the signer without webhook authorization, while emphasizing the necessity of this variable in production.
Combine loopback-only signer port binding from main with mock-services profile and mock smoketest docs from this branch.
…pdate Docker configuration Removed the old deploy directory and its associated docker-compose.yml and go.mod files. Introduced a new Dockerfile and Go application for mock services directly in the root directory, allowing for easier local testing. Updated docker-compose.yml to reference the new Dockerfile location for the mock services, ensuring a streamlined setup for development and testing.
- /authorize now returns auth_id ("client_id:usage_subject"), mirroring the
identity webhook contract so go-livepeer stamps identity onto Kafka events
- Add GET /prices Coinbase-shaped stub so the price-oracle collector can warm
its ETH/USD cache offline (set PRICE_ORACLE_URL=http://mock-services:8080/prices)
- Surface MOCK_AUTH_ID / MOCK_ETH_USD on the mock-services compose service
- Document the three mock endpoints and the normalized egress fields in README
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
9 tasks
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
mock-servicesGo service (Compose profilemock) that stubs the identity webhook (/authorize) and OpenMeter ingest (/events) endpoints for local developmentdocker-compose.ymlwith themock-servicesservice behind themockprofile so it is opt-in onlydocker compose --profile mock up, sample Kafka event, and verificationWhat it does
The mock server accepts:
POST /authorize— validatesAuthorization: Bearer <WEBHOOK_SECRET>and returns{"status":200}, mimicking the identity webhookPOST /events— accepts CloudEvents ingest payloads and logs them, mimicking the OpenMeter ingest APIThis lets contributors run the full Kafka → signer → collector pipeline locally without external OpenMeter/Konnect credentials.
Test plan
docker compose --profile mock build mock-servicessucceedsdocker compose --profile mock up -d kafka mock-services openmeter-collectorstarts all threecreate_signed_ticketevent viarpk topic produce; confirmmock-serviceslogs the ingest payloaddocker compose downtears down cleanlydocker compose up(no--profile mock) does not startmock-services