fix(lambda-python): escape Docker bundling command arguments - #38583
fix(lambda-python): escape Docker bundling command arguments#38583kumsmrit wants to merge 2 commits into
Conversation
|
👋 It looks like your PR description follows the template but is missing a valid issue number in the first section. PRs without a linked issue will receive lower priority for review and merging. Please update the description to include a reference like |
| } | ||
|
|
||
| function posixShellEscape(arg: string): string { | ||
| return "'" + arg.replace(/'/g, "'\\''") + "'"; |
There was a problem hiding this comment.
What if it's already escaped? We should also probably skip the transformation in case arg is unresolved.
There was a problem hiding this comment.
For "already escaped": this helper is intentionally a literal-value escaper; callers pass the raw argument value, and the function emits shell syntax that preserves it as one shell word. It is being applied at the point where these values become shell syntax, so there should not be any prior escaping to collide with.
For unresolved tokens: the values here are used for local synth-time bundling and not deploy-time. inputDir is the framework /asset-input constant; outputDir is based on /asset-output; and user-supplied inputs like assetExcludes / outputPathSuffix are plain string inputs consumed by the local bundling command. Even if someone forced an encoded token string into one of those fields, skipping escaping would not make it usable since the Docker/local bundling command runs before token resolution.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Merge Queue Status
This pull request spent 1 minute 50 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #38583 has been dequeued Queue conditions are not satisfied:
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter fails with the following errors:
❌ Fixes must contain a change to an integration test file and the resulting snapshot.
If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.
mrgrain
left a comment
There was a problem hiding this comment.
The code for this should be centralized and aligned with NodeJS bundling.
Issue # (if applicable)
Closes #.
Reason for this change
Description of changes
Describe any new or updated permissions being added
Description of how you validated changes
aws-lambda-python-alphatest expectations to reflect standardized argument escaping.aws-lambda-python-alphaunit tests pass and aws-cdk-lib builds successfullyChecklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license