Repository navigation
Conversation
Propagate an end-user JWT from a client, through a caller Workflow, to a Nexus Operation handler without exposing it in history or headers. Each credential header is encrypted with Tink HPKE to the receiving hop and bound to the hop's context and to a digest of the exact argument ciphertexts it accompanies, so no sender-side key can decrypt or repurpose it and no input needs deterministic serialization. The handler validates the JWT, authorizes the input against a client-sealed intent, derives the backing Workflow ID from the principal and business identity, and signs its operation tokens. Includes end-to-end tests against the test server, covering start-path, continue-as-new, replay, substitution, and authorization cases, plus unit tests of the cryptographic components.
bergundy
requested review from
a team,
antmendoza and
tsurdilo
as code owners
October 13, 2026 16:54
bergundy
marked this pull request as draft
October 13, 2026 16:55
Public HPKE keys need not be secret: they only let a holder seal a header around a token they already have. Document that sender authentication requires a signature, and that the client-sealed intent does not replace server-side authorization.
VerifyCredentialBinding reads a Workflow history and, for each credential header, recomputes the args digest from the event's input ciphertexts (or uses firstExecutionRunId for continue-as-new headers), opens the header with that context, and confirms that a context with one bit changed is rejected and that the digest is not present in the header bytes. It prints only the credential's subject and issuer and exits non-zero on failure.
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.
What changed?
Adds
core/src/main/java/io/temporal/samples/nexussecurecredentialpropagation, a sample that propagates an end-user JWT from a client, through a caller Workflow, to a Nexus Operation handler without the JWT appearing in plaintext in history, Temporal headers, or Nexus headers.firstExecutionRunId(the Java SDK builds that header before encoding arguments). Child Workflows never receive the credential.PayloadValidationErrorso the handler reportsBAD_REQUESTinstead of retrying.com.google.crypto.tink:tink:1.23.0tocore.The README documents the threat model, wire formats, key distribution, replay cases, steering alternatives, and the access-layer boundary for replayed cancels.
Why?
To show a replay-safe way to carry end-user identity across a Nexus call where neither history readers nor holders of sender-side keys can read or repurpose the credential.
Breaking changes?
None.
Testing
SecureCredentialPropagationTest(20 end-to-end tests against the test server): start / signal-with-start / update-with-start, continue-as-new to another type plus retry, child Workflows, cancellation, argument reorder/duplicate/truncate/substitute, copied continue-as-new header, key-less attacker replaying captured Nexus input and headers (exact replay, input swap, endpoint move, missing credential), intent and subject checks, wrong audience, and a misordered interceptor.CryptoComponentsTest(18 unit tests): framing, header contexts and parsing, args digest, codec context binding, JWT validation, intent policy, resource IDs, operation tokens.:core:testpasses.