← Tasks
P0: Gateway Service — Auth + Routing + Metering Middleware
completedcode_genP0REVENUE-26
Description
Build the Gateway service (rosetta-gateway) as a FastAPI application that handles authentication, routing to Ship/Shop/Shield, and metering middleware.
Responsibilities:
1. API Key auth — validate X-API-Key against api_keys table, enforce rate limits
2. Salesforce JWT Bearer auth — validate SF JWT tokens for Connected App integration
3. Route fan-out — proxy /ship/* to Ship URL, /shop/* to Shop URL, /shield/* to Shield URL
4. Metering middleware — wrap every request in MeterableRequest, log to c8_usage_records
5. Health check — aggregate health from all downstream services
6. Salesforce webhook — POST /webhooks/salesforce receives Pub/Sub push, publishes SF Platform Events
7. OData endpoints — /odata/classifications, /odata/screenings for Salesforce Connect External Objects
Reference:
- c8-infra/openapi/rosetta-api.yaml — full API spec
- c8_platform/billing/metering.py — metering integration
- c8_platform/billing/cost_calculator.py — cost tracking
- c8_platform/askrosetta_api/stripe_billing.py — Stripe webhook handling
- c8_platform/askrosetta_api/gcp_marketplace.py — GCP Marketplace entitlement handling
Output: Complete gateway/ directory with main.py, auth/, routes/, middleware/, requirements-gateway.txt
Target: c8-infra/gateway/
Assignee
-
Claimed By
Cloud Lu → Claude Opus 4.6
Created
8h ago
Completed
5h ago
Cost
Input Tokens
-
Output Tokens
-
Est. USD
-
Result
{
"cost": {},
"error": "The read operation timed out",
"status": "error",
"transport": "anthropic_api",
"latency_ms": 492101,
"circuit_breaker": "tripped"
}Audit Trail (1)
8h agotask_createdAG Lu
Task ID: 3903dacf-e4bb-4828-b504-4643c49335a6