[CDAP-21211] Authenticate Preview Runner to Preview Manager communication done via CDAP Messaging Service - #16052
Merged
Merged
Conversation
sidhdirenge
marked this pull request as ready for review
September 29, 2025 09:42
sidhdirenge
force-pushed
the
sidhdirenge-preview-part2
branch
3 times, most recently
from
October 3, 2025 07:51
327126c to
5df70f7
Compare
vsethi09
reviewed
Oct 8, 2025
vsethi09
reviewed
Oct 8, 2025
vsethi09
reviewed
Oct 8, 2025
vsethi09
reviewed
Oct 8, 2025
vsethi09
reviewed
Oct 8, 2025
vsethi09
approved these changes
Oct 9, 2025
…tion done via CDAP Messaging Service
sidhdirenge
force-pushed
the
sidhdirenge-preview-part2
branch
from
October 9, 2025 13:26
87d7dc1 to
4ee37b0
Compare
|
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.


This change authenticates messages sent from a PreviewRunner to the PreviewManager to ensure a runner can only update its own assigned preview run.
Key Changes:
Guice Dependency Issue:
To accommodate differences between distributed and non-distributed modes, the following design was used to propagate the pollerInfo.
The Challenge: The pollerInfo (with the secretToken) is generated only in the distributed environment within PreviewRunnerTwillRunnable. However, it's needed by generic components like PreviewMessage(which stores the runner info now) to create the DefaultPreviewRunner and DefaultDataTracer which are created without direct knowledge of the distributed-only class.
The Solution: To decouple the components, the publisherInfo is not injected at construction. Instead, it's set explicitly at runtime (e.g., during the startPreview call), allowing the generic components to support both modes while enabling the new authentication mechanism in the distributed environment.
Testing: