feat: HMAC recipientHash with Key Vault key version - #100
Conversation
Replace unsalted SHA-256 recipient digests with HMAC-SHA256 keyed from Key Vault secret recipient-hash-hmac-key, embedding a key-version id so operators can distinguish rotations without offline address correlation. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Review limit reachedNext included review available in 46 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (18)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai full review |
|
|
@coderabbitai full review |
|
Summary
recipientHashwith HMAC-SHA256 using Key Vault secretrecipient-hash-hmac-key(via App Configuration), emitting{keyVersionId}.{digest16}so key rotations are visible in telemetryRECIPIENT_HASH_HMAC_KEY_VERSIONon KV reference resolve; seed/deploy assert the new secret name (no secret values in git)Closes #89
Test plan
pnpm --filter @singleton-sd/post-kit-api test(236 pass)recipient-hash-hmac-keybefore deploy (value never pasted in GitHub)recipientHashmatches^[a-f0-9]{8}\.[a-f0-9]{16}$and never contains raw addressesMade with Cursor
Greptile Summary
The PR replaces deterministic unsalted recipient hashes with versioned HMAC-SHA256 identifiers backed by an Azure Key Vault secret.
Confidence Score: 5/5
The PR appears safe to merge with the new secret provisioned as required by the deployment workflow.
The key and version are resolved together on the supported deployment path, hashing fails closed without key material, and telemetry validation and operational guidance consistently use the new versioned format.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Deploy as Deployment participant AppConfig as App Configuration participant KV as Key Vault participant API as Send API participant Logs as Application Insights Deploy->>KV: Verify recipient-hash-hmac-key exists Deploy->>AppConfig: Seed Key Vault reference API->>AppConfig: Load secret reference API->>KV: Resolve key and version KV-->>API: Secret value and version API->>API: Normalize recipient and compute HMAC-SHA256 API->>Logs: Emit keyVersionId.digest16Reviews (1): Last reviewed commit: "feat(api): HMAC recipientHash with Key V..." | Re-trigger Greptile