Skip to content

test(invoices): pin endpoint A contract for server-side encryption (DEV-202)#11

Merged
vergil-dv merged 1 commit into
mainfrom
vladimir/dev-202-13-migrate-privara-sdk-to-the-server-side-endpoint-11
Jun 11, 2026
Merged

test(invoices): pin endpoint A contract for server-side encryption (DEV-202)#11
vergil-dv merged 1 commit into
mainfrom
vladimir/dev-202-13-migrate-privara-sdk-to-the-server-side-endpoint-11

Conversation

@0xkkkn

@0xkkkn 0xkkkn commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

DEV-202 — point non-browser callers at the server-side encrypt endpoint (endpoint A).

The privara SDK is a thin REST client with zero crypto: invoices.create() already calls POST /api/v1/invoices. Moving FHE encryption into the backend Lambda (PR #64, FHE_MODE=local) is transparent to the SDK — no consumer-facing change. This PR adds a regression test that pins the create() path + request contract so the migration can't silently break SDK consumers.

Agent-payments

On main, CreateAgentPayment creates invoices through the SDK → the same POST /api/v1/invoices endpoint → the now-containerized CreateInvoice Lambda. So agent-payments inherit in-Lambda encryption automatically once #64 is deployed with FHE_MODE=local; no change needed here.

Converting the CreateAgentPayment Lambda itself to a container (for in-process FHE) only applies after the feat/agent-payment-direct-domain-call refactor lands (it calls CreateInvoiceZerodevUsecase directly instead of via the SDK). That conversion — plus retiring the fix/agent-payment-fhe-worker-url band-aid — belongs with that branch to avoid conflicts.

Verification

  • vitest (invoices: 5/5, full suite green), tsc --noEmit

Part of Cost optimisation (DEV-198).

…EV-202)

The privara SDK is a thin REST client with no crypto, so moving FHE encryption
into the backend Lambda (server-side endpoint A) needs no SDK change. Add a
regression test pinning create() to POST /api/v1/invoices with the request
contract unchanged, so SDK consumers are unaffected by the migration.

Agent-payments inherit in-Lambda encryption transparently via the CreateInvoice
container (they call this same endpoint through the SDK). Containerizing the
CreateAgentPayment Lambda for in-process FHE belongs with the
agent-payment-direct-domain-call refactor.
@0xkkkn
0xkkkn requested a review from a team as a code owner June 6, 2026 17:41
@vergil-dv
vergil-dv merged commit cfb3082 into main Jun 11, 2026
1 check passed
@vergil-dv vergil-dv mentioned this pull request Jun 11, 2026
vergil-dv added a commit that referenced this pull request Jun 11, 2026
Patch release marking the DEV-202 server-side FHE encryption migration.
No public API or behavior change: the SDK is a thin REST client with no
crypto, so moving encryption into the backend Lambda is transparent to
consumers. Bundles the create() contract regression test added in #11.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants