Skip to content

feat(mock): add mock services for local webhook and ingest testing#50

Draft
eliteprox wants to merge 22 commits into
mainfrom
feat/webhook-mock-service
Draft

feat(mock): add mock services for local webhook and ingest testing#50
eliteprox wants to merge 22 commits into
mainfrom
feat/webhook-mock-service

Conversation

@eliteprox

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a mock-services Go service (Compose profile mock) that stubs the identity webhook (/authorize) and OpenMeter ingest (/events) endpoints for local development
  • Extends docker-compose.yml with the mock-services service behind the mock profile so it is opt-in only
  • Documents the mock profile workflow in the README: env setup, docker compose --profile mock up, sample Kafka event, and verification

What it does

The mock server accepts:

  • POST /authorize — validates Authorization: Bearer <WEBHOOK_SECRET> and returns {"status":200}, mimicking the identity webhook
  • POST /events — accepts CloudEvents ingest payloads and logs them, mimicking the OpenMeter ingest API

This lets contributors run the full Kafka → signer → collector pipeline locally without external OpenMeter/Konnect credentials.

Test plan

  • docker compose --profile mock build mock-services succeeds
  • docker compose --profile mock up -d kafka mock-services openmeter-collector starts all three
  • Produce a sample create_signed_ticket event via rpk topic produce; confirm mock-services logs the ingest payload
  • docker compose down tears down cleanly
  • Default docker compose up (no --profile mock) does not start mock-services

eliteprox and others added 22 commits June 18, 2026 18:16
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant