Repository navigation
Demonstrate Nexus serialization context with per-endpoint encryption - #574
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 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
marked this pull request as ready for review
November 17, 2026 01:38
JoshuaFrenchwood
approved these changes
Nov 18, 2026
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.
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.v1.9.3-nexus-serialization-contextreturned all eight results each. Workflow histories confirmed that Nexus context was preserved and that async results used the endpoint keys.Java counterpart (PR #815).