Privacy-first travel risk-scoring API that produces a deterministic 0–100 risk score and action (allow/review/hold) from non-PII signals. Built to demonstrate platform/API product thinking: OAuth2 Client Credentials, idempotency keys, HMAC-signed webhooks with retries, audit logging, SLOs + dashboards, and IaC + CI.
Live docs / Pages: https://benkola.github.io/Project1/
Repo: https://github.com/Benkola/Project1
Demo (≤3 min): (add Loom link)
/v1), error model, rate-limit headersAPI Gateway (REST)
→ Lambda (Python)
→ DynamoDB (events, webhook_outbox)
→ CloudWatch + X-Ray (logs/metrics/traces)
→ (Optional) EventBridge schedule for webhook retries
→ S3 (artefacts/screenshots)
Diagram:
docs/architecture.png(add a diagram screenshot)
POST /v1/score — idempotent scoring request (requires Idempotency-Key)GET /v1/events/{id} — fetch event + audit trailPOST /v1/webhooks/test — fire signed webhook testGET /v1/health — health checkOpenAPI: api/openapi.yaml
Postman collection: postman/TTSR.postman_collection.json
docs/dpia_lite.mdSignals (examples):
delay (0..1)weather (0..1)geo (0..1)payment_anomaly (0 or 1)Output:
score (0..100)action = allow (<30), review (30–59), hold (≥60)score_version = v0_rulesPOST /v1/score requires:
Idempotency-Key: <uuid>Behaviour:
Implementation notes:
Outgoing webhook headers:
TTSR-Signature: t=<unix>,v1=<hmac_sha256(timestamp+"."+body)>Reliability:
webhook_outbox firstCode:
webhooks/lib/signer.pywebhooks/worker/worker.pySLO targets (demo):
Dashboards/alerts:
docs/slo_dashboard.md)trace_id correlationRunbook:
docs/runbook.md (rollback, incident playbooks, secret rotation)```bash
export TOKEN=$(curl -s -X POST “$TOKEN_URL”
-H “Content-Type: application/x-www-form-urlencoded”
-d “grant_type=client_credentials&client_id=demo-app&client_secret=demo-secret&scope=score:write%20events:read%20webhooks:write”
| jq -r .access_token)