-
Notifications
You must be signed in to change notification settings - Fork 880
fix: properly construct concurrency key #7504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: properly construct concurrency key #7504
Conversation
Signed-off-by: pyranota <[email protected]>
|
Claude finished @pyranota's task in 2m 3s —— View job PR Review: Enforce Workspace Isolation in Custom Concurrency Keys (Cloud Mode)
SummaryThis PR adds workspace isolation for custom concurrency keys in cloud mode. When running on cloud infrastructure, if a user specifies a custom concurrency key that doesn't include What ChangedIn
Review FeedbackPositive:
Suggestions (see inline comments):
No Major Issues FoundThe implementation is correct and addresses the security concern appropriately. The only suggestion is a minor optimization to avoid an unnecessary string clone. Testing InstructionsTo verify this change works correctly on cloud deployments: Navigate to any script or flow settings and configure a custom concurrency key (under Advanced > Concurrency settings). Set a key like |
| let concurrency_key = custom_concurrency_key | ||
| .map(|x| interpolate_args(x, args, workspace_id)) | ||
| .map(|x| { | ||
| let interpolated = interpolate_args(x.clone(), args, workspace_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor optimization: The x.clone() here creates an unnecessary allocation. Since interpolate_args takes ownership of the string, we could avoid the clone by checking the condition first.
| let interpolated = interpolate_args(x.clone(), args, workspace_id); | |
| let has_workspace = x.contains("$workspace"); | |
| let interpolated = interpolate_args(x, args, workspace_id); |
Then update line 5366 to use has_workspace instead of x.contains("$workspace").
Deploying windmill with
|
| Latest commit: |
e39fca5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9dd5761a.windmill.pages.dev |
| Branch Preview URL: | https://pyra-win-1656-enforce-worksp.windmill.pages.dev |
| #[cfg(feature = "cloud")] | ||
| { | ||
| if !x.contains("$workspace") { | ||
| format!("{}/{}", workspace_id, interpolated) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency: This format "{workspace_id}/{interpolated}" is consistent with how fullpath_with_workspace constructs keys (line 3357), which uses "{workspace_id}/{type}/{path}". Good choice for consistency in the key namespace.
No description provided.