Skip to main content

drt serve

Start an HTTP endpoint that triggers drt syncs on demand.

A trigger is answered with 202 and a run id; poll GET /runs/<id> for the outcome, or pass ?wait=true to block for the result. Same-sync triggers coalesce; different syncs run concurrently.

Example:

drt serve --port 8080 --token-env DRT_WEBHOOK_TOKEN

curl -X POST http://localhost:8080/sync/my_sync \
-H "Authorization: Bearer $DRT_WEBHOOK_TOKEN"

Usage​

drt serve [OPTIONS]

Options​

OptionTypeDefaultDescription
--hostTEXT127.0.0.1Host to bind.
--port, -pINTEGER8080Port to bind.
--token-envTEXTDRT_WEBHOOK_TOKENEnv var holding bearer token for auth. Empty/unset = no auth.
--authTEXTautoAuth scheme: auto (bearer if token env set, else none), none, bearer, hmac (HMAC-SHA256 body signature), or oidc (Google-signed OIDC JWT — Pub/Sub push's own scheme).
--hmac-secret-envTEXTDRT_WEBHOOK_HMAC_SECRETEnv var holding the HMAC signing secret (for --auth hmac).
--hmac-headerTEXT``Header carrying the HMAC signature (for --auth hmac). Defaults to X-Hub-Signature-256, or Stripe-Signature under --hmac-scheme stripe.
--hmac-schemeTEXTgenericSignature shape for --auth hmac: generic (HMAC of the body — GitHub, Shopify, bare hex) or stripe (timestamped t=...,v1=...).
--hmac-toleranceINTEGER300Replay window in seconds for --hmac-scheme stripe. Stripe's own libraries default to 300.
--oidc-audienceTEXT``Required for --auth oidc: the URL Pub/Sub's push subscription was configured with (the aud claim Google's JWT must carry).
--oidc-emailTEXT``Required for --auth oidc: the one service account's email allowed to call this endpoint (e.g. the Pub/Sub subscription's own push service account). A valid signature and audience alone do not prove authorization -- Google will mint a token with any audience for any Google Cloud principal.