Skip to content

Demonstrate Nexus serialization context with per-endpoint encryption - #574

Merged
litlep-nibbyt merged 8 commits into
mainfrom
codex/go-nexus-serialization
Nov 18, 2026
Merged

litlep-nibbyt merged 8 commits into
mainfrom
codex/go-nexus-serialization

Conversation

@litlep-nibbyt

@litlep-nibbyt litlep-nibbyt commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Add a Go sample that uses Nexus serialization context to select an AES-GCM key per endpoint. Two handler workers serve two endpoints each. One compresses payloads with zlib before encrypting them. The caller runs one synchronous operation and one workflow-backed asynchronous operation per endpoint.

A call through endpoint 2 returns a result encrypted with key 2. That works for async calls too, even when the workflow that produces the result uses key 1 for its input.

Validation

  • go test -race ./nexus-serialization-context/... passed. The tests cover key selection, context isolation, damaged ciphertext, and all eight caller operations.
  • Two runs with CLI v1.9.3-nexus-serialization-context returned all eight results each. Workflow histories confirmed that Nexus context was preserved and that async results used the endpoint keys.

Java counterpart (PR #815).

@litlep-nibbyt litlep-nibbyt changed the title Demonstrate per-endpoint Nexus encryption and compression Demonstrate Nexus serialization context with per-endpoint encryption Nov 17, 2026
@litlep-nibbyt
litlep-nibbyt requested a balanced review from Copilot November 17, 2026 01:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the endpoint-specific Nexus encryption sample.

No open issues 🎉

What changed in this PR

Adds a Go sample showing how native Nexus serialization context selects endpoint-specific encryption for synchronous and workflow-backed asynchronous operations, alongside the repository’s existing Nexus samples.

Changes:

  • Configures four endpoint keys, optional compression, and a separate caller workflow key.
  • Adds two handler workers and a caller that starts eight operations across three namespaces.
  • Documents setup and encryption boundaries, with tests for converter configuration and caller orchestration.
File Description
README.md Adds the sample to the repository index.
nexus-per-endpoint-encryption/​service/​api.go Defines shared endpoint names, task queues, and payload types.
nexus-per-endpoint-encryption/​README.md Documents key mappings, serialization flows, prerequisites, and setup.
nexus-per-endpoint-encryption/​handler/​encrypted-worker/​main.go Starts the encryption-only handler worker.
nexus-per-endpoint-encryption/​handler/​compressed-encrypted-worker/​main.go Starts the compression-and-encryption handler worker.
nexus-per-endpoint-encryption/​handler/​app.go Implements synchronous and workflow-backed echo operations.
nexus-per-endpoint-encryption/​encryption/​converter.go Selects endpoint codecs and ordinary workflow defaults.
nexus-per-endpoint-encryption/​encryption/​converter_test.go Tests round trips, compression, defaults, and unknown endpoints.
nexus-per-endpoint-encryption/​encryption/​aes.go Implements AES-GCM payload encoding and decoding.
nexus-per-endpoint-encryption/​caller/​workflow.go Starts eight operations and collects their replies.
nexus-per-endpoint-encryption/​caller/​workflow_test.go Tests caller orchestration and returned results.
nexus-per-endpoint-encryption/​caller/​worker/​main.go Registers the caller workflow with its data converter.
nexus-per-endpoint-encryption/​caller/​starter/​main.go Starts the caller workflow and prints endpoint replies.

Review effort: Balanced

@litlep-nibbyt
litlep-nibbyt marked this pull request as ready for review November 17, 2026 01:38
@litlep-nibbyt
litlep-nibbyt requested review from a team as code owners November 17, 2026 01:38
Comment thread nexus-serialization-context/README.md Resolved
Comment thread nexus-serialization-context/README.md Resolved
@litlep-nibbyt
litlep-nibbyt merged commit 00024cc into main Nov 18, 2026
4 checks passed
@litlep-nibbyt
litlep-nibbyt deleted the codex/go-nexus-serialization branch November 18, 2026 20:16
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.

3 participants