Repository navigation
Add a Nexus serialization context sample - #425
Open
litlep-nibbyt wants to merge 10 commits into
Open
litlep-nibbyt wants to merge 10 commits into
litlep-nibbyt wants to merge 10 commits into
Conversation
This reverts commit 5a3b790.
Pass through payload formats handled by the ordinary converter while continuing to check the expected key and authenticate AES-GCM payloads. Show how to adapt the sample and explain the example's endpoint key reuse.
litlep-nibbyt
marked this pull request as ready for review
November 20, 2026 00:04
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the standalone Nexus serialization sample.
No open issues 🎉
What changed in this PR
Adds a standalone Python sample to the Nexus examples, demonstrating endpoint-specific encryption and optional compression for synchronous and workflow-backed asynchronous operations.
Changes:
- Adds four endpoints served by two handler workers, with separate encryption settings for caller and backing-workflow payloads.
- Provides a local walkthrough, codec tests, and an end-to-end workflow test.
- Isolates Python 3.11+ dependencies and integrates the sample into CI without changing root Python support.
| File | Description |
|---|---|
README.md |
Adds the sample to the Nexus examples index. |
pyproject.toml |
Excludes the standalone sample from root packaging. |
nexus_serialization_context/workflows.py |
Defines echo and caller workflows for eight concurrent operations. |
nexus_serialization_context/worker.py |
Configures caller and handler workers by role. |
nexus_serialization_context/uv.lock |
Locks standalone sample dependencies. |
nexus_serialization_context/tests/test_workflow.py |
Checks operation results, propagated context, and workflow encryption metadata. |
nexus_serialization_context/tests/test_codec.py |
Tests key selection, compression, context isolation, and ciphertext validation. |
nexus_serialization_context/starter.py |
Starts the caller workflow and prints endpoint results. |
nexus_serialization_context/service.py |
Defines endpoints, namespaces, service contracts, and result structure. |
nexus_serialization_context/README.md |
Documents serialization behavior, local setup, expected output, and testing. |
nexus_serialization_context/pyproject.toml |
Defines Python requirements, dependencies, and development tasks. |
nexus_serialization_context/handler.py |
Implements synchronous and workflow-backed asynchronous echo handlers. |
nexus_serialization_context/config.py |
Configures endpoint and workflow encryption keys and converters. |
nexus_serialization_context/codec.py |
Implements context-based codec selection, AES-GCM encryption, and optional compression. |
.github/workflows/ci.yml |
Includes the standalone sample in CI, excluding Python 3.10. |
Review effort: Balanced
JoshuaFrenchwood
approved these changes
Nov 20, 2026
litlep-nibbyt
enabled auto-merge (squash)
November 20, 2026 20:41
litlep-nibbyt
disabled auto-merge
November 20, 2026 20:46
litlep-nibbyt
enabled auto-merge (squash)
November 20, 2026 20:46
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 Nexus serialization context sample with synchronous and workflow-backed asynchronous operations through four endpoints.
Two handler workers each serve two endpoints with distinct AES-GCM keys. One compresses before encrypting; the other encrypts only. The caller uses a separate key for its workflow input and final result. Backing workflow inputs use the handler's key 1, while async results use the endpoint's key and compression.
The README follows the Java walkthrough and shows the expected output. The sample is a standalone uv project because SDK 1.36.0 requires Python 3.11 or newer, while the root project supports Python 3.10.
Validation: 22 sample cases pass; root build/lint pass; the root suite has 240 passes and two skips. The README walkthrough and Java interoperability in both directions pass.
Java counterpart: merged Java sample (PR #815).