verifier-ts: streaming E2EE decryption + full field coverage#78
Merged
Conversation
Add `openChunk` to decrypt streamed SSE chunks (chat `delta.content` / `delta.reasoning_content`, completion `text`), and extend `seal`/`open` to every field the gateway encrypts: request `prompt`/`input` for the completions and embeddings endpoints, and response `message.audio.data`, completion `text`, and embedding vectors — alongside the existing chat content. Indexes follow the entry's `index` member (§7.2). All Web Crypto, no new dependencies. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the E2EE channel (PR #75). Completes the client-side field coverage from the tracking list.
Streaming
openChunk(chunk)decrypts one streamed SSE chunk: chatchoices.{i}.delta.content/delta.reasoning_content, and completionchoices.{i}.text. The caller parses SSE data events (a generic concern) and callsopenChunkper event.Full field coverage
Every field the gateway encrypts (spec §7.2) is now handled:
seal) — chatmessages.{m}.content(whole, universal for any modality);/v1/completionsprompt/prompt.{i};/v1/embeddingsinput/input.{i}.open, buffered) — chatmessage.{content,reasoning_content,audio.data}; completiontext; embedding vectors (compact-JSON, restored viaJSON.parse).Indexes follow the entry's
indexmember with array-position fallback (§7.2). All Web Crypto, no new dependencies.Not included (still whole-content covers it, per §7.2): per-part multimodal request encryption (
image_url.url/input_audio.data) — whole-content encryption already protects those end to end, so it stays an optional optimization.Verification
verifier-ts 50/50 (7 channel tests incl. streaming, audio, completions, embeddings, prompt/input round-trips),
tscclean. Diff is 3 files, verifier-ts only.🤖 Generated with Claude Code