-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Parent epic
Description
Implement the server-to-server batch sync endpoint for partners to bulk-write their UIDs against a list of EC hashes.
Scope: ec/sync_batch.rs, router update
Acceptance criteria
- Missing or invalid
Authorization: Bearer→401. Auth uses index-based lookup viafind_by_api_key_hash()with constant-time hash verification. - Auth KV lookup failure →
503 Service Unavailable. - API-key rate limit exceeded →
429with{ "error": "rate_limit_exceeded" }. - More than 1000 mappings →
400. - Per-mapping rejections:
invalid_ec_hash,ec_hash_not_found,consent_withdrawn,kv_unavailable. - KV write failure aborts remaining mappings with
kv_unavailable; partial results as207. - All accepted →
200. Any rejection →207. kv.upsert_partner_id()idempotent: duplicate timestamp counted as accepted.- Rate counter key:
batch:{partner_id}, 1-minute window. - Unit tests cover status code selection, all rejection reasons, API-key rate limit.
Spec ref
docs/internal/ssc_technical_spec.md §9
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels