github-metrics-aggregator

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2023 License: Apache-2.0

README

GitHub Metrics Aggregator

HTTP server to ingest GitHub webhook event payloads. This service will post all requests to a PubSub topic for ingestion and aggregation into BigQuery.

Testing

Creating GitHub HMAC Signature
echo -n `cat testdata/issues.json` | openssl sha256 -hmac "test-secret"

# Output:
08a88fe31f89ab81a944e51e51f55ebf9733cb958dd83276040fd496e5be396a

Use this value in the X-Hub-Signature-256 request header as follows:

X-Hub-Signature-256: sha256=08a88fe31f89ab81a944e51e51f55ebf9733cb958dd83276040fd496e5be396a
Example Request
PAYLOAD=$(echo -n `cat testdata/issues.json`)
WEBHOOK_SECRET="test-secret"

curl \
  -H "Content-Type: application/json" \
  -H "X-Github-Delivery: $(uuidgen)" \
  -H "X-Github-Event: issues" \
  -H "X-Hub-Signature-256: sha256=$(echo -n $PAYLOAD | openssl sha256 -hmac $WEBHOOK_SECRET)" \
  -d $PAYLOAD \
  http://localhost:8080/webhook

# Output
Ok

Directories

Path Synopsis
cmd
github-metrics-aggregator
Package main is the main entrypoint to the application.
Package main is the main entrypoint to the application.
pkg
server
Package server is the base server for the github metrics ingestion.
Package server is the base server for the github metrics ingestion.
Package protos contains versioned protos for the github-metrics-aggregator.
Package protos contains versioned protos for the github-metrics-aggregator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL