Skip to content

Comments

Support Internal Nexus Callback Routing #8308

Merged
chaptersix merged 54 commits intomainfrom
alex/nexus_ootb
Sep 29, 2025
Merged

Support Internal Nexus Callback Routing #8308
chaptersix merged 54 commits intomainfrom
alex/nexus_ootb

Conversation

@chaptersix
Copy link
Contributor

@chaptersix chaptersix commented Sep 9, 2025

What changed?

This PR introduces two key features to enable out-of-the-box Nexus functionality with zero configuration:

  1. Always allow temporal://system callback URLs: The component.callbacks.allowedAddresses configuration now automatically allows temporal://system URLs regardless of configured address rules. This special scheme+host combination bypasses normal URL validation and is always permitted.

  2. New UseSystemCallbackURL toggle: Added component.nexusoperations.useSystemCallbackURL dynamic config that controls callback URL generation for worker targets:

    • When false (default): Uses the existing callback URL template approach
    • When true: Worker targets automatically get temporal://system
    • External targets continue to use template-generated URLs regardless of this setting
    • NOTE: if this toggle is true HTTPCallerProvider must be able to route internal requests based on theSource and Token headers. It should also override the path to /nexus/callback. See the HTTPCallerProvider code changes here.
  3. Callback URL Validation has been refactored. The AddressMatchRules struct now includes a Validate method that handles the special temporal://system case and applies configured rules for other URLs.

  4. Callback Source Header: will no longer be populated for external Targets.

Why?

Once component.nexusoperations.useSystemCallbackURL is enabled by default in a future release, these changes will allow Self-Hosted Temporal Servers to support Nexus with zero dynamic configuration
See this issue: #8298

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Copy link
Contributor

@pdoerner pdoerner left a comment

Choose a reason for hiding this comment

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

I don't think you need to worry about whether to allow insecure connections for temporal://system since those internally-routed requests will always use our internal local frontend client which should have already been configured with the correct secure/insecure setting.

@chaptersix chaptersix marked this pull request as ready for review September 11, 2025 17:59
@chaptersix chaptersix requested a review from a team as a code owner September 11, 2025 17:59
@chaptersix chaptersix requested a review from bergundy September 11, 2025 18:24
Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

We also discussed setting temporal://system only for worker targets in nexusoperations/executors.go, external targets would still require a URL to be configured.

Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

Overall LGTM, there's a couple of minor blocking comments.

Note that any comment that is marked as not blocking or nit is up for you to consider. These are typically based on my personal experience and preference.

@chaptersix chaptersix requested a review from bergundy September 26, 2025 17:04
Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

Had some comments, I still need to review the test but wanted to go ahead and submit.

Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

In general it looks like we are missing functional test coverage for the new /nexus/callback route. Correct me if I'm wrong.

@chaptersix
Copy link
Contributor Author

In general it looks like we are missing functional test coverage for the new /nexus/callback route. Correct me if I'm wrong.

explicitly yes but any test with a worker target for the callback exercises that new endpoint. I'll add a few tests to explicitly test the new endpoint.

@chaptersix chaptersix requested a review from bergundy September 29, 2025 14:10
Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

Approved with one blocking suggestion. I'm just going to apply it myself.

@chaptersix chaptersix enabled auto-merge (squash) September 29, 2025 21:00
@chaptersix chaptersix merged commit 8abc2d2 into main Sep 29, 2025
93 of 96 checks passed
@chaptersix chaptersix deleted the alex/nexus_ootb branch September 29, 2025 21:15
chaptersix added a commit to temporalio/cli that referenced this pull request Feb 2, 2026
## What was changed
- enabled routing of nexus callback via system url 

## Why?
temporalio/temporal#8308

## Checklist
<!--- add/delete as needed --->

1. Closes <!-- add issue number here -->

2. How was this tested:
<!--- Please describe how you tested your changes/how we can test them
-->

3. Any docs updates needed?
<!--- update README if applicable
      or point out where to update docs.temporal.io -->

---------

Co-authored-by: Roey Berman <[email protected]>
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