Skip to content

Add requirements.txt with third-party dependencies#1

Open
Tickip wants to merge 6 commits into
mainfrom
claude/code-review-ZPhS0
Open

Add requirements.txt with third-party dependencies#1
Tickip wants to merge 6 commits into
mainfrom
claude/code-review-ZPhS0

Conversation

@Tickip
Copy link
Copy Markdown
Owner

@Tickip Tickip commented May 26, 2026

boto3, msal, python-dateutil, and requests were all imported but
not declared anywhere, making fresh installs and reproducibility
impossible.

https://claude.ai/code/session_01Hwhkq2ASMSCrpudm5DkvcX

claude added 6 commits May 26, 2026 05:38
boto3, msal, python-dateutil, and requests were all imported but
not declared anywhere, making fresh installs and reproducibility
impossible.

https://claude.ai/code/session_01Hwhkq2ASMSCrpudm5DkvcX
b"%b" % pattern.encode() is a roundabout way of writing pattern.encode()
— replace with the direct form for clarity and to remove unnecessary
bytes formatting indirection.

https://claude.ai/code/session_01Hwhkq2ASMSCrpudm5DkvcX
Two bugs: env variables dict was written directly to a file (TypeError),
and no guard for Lambdas with no environment variables set (KeyError on
missing 'Environment' key in AWS response). Serialize with json.dumps
and use .get() with defaults to handle both cases.

https://claude.ai/code/session_01Hwhkq2ASMSCrpudm5DkvcX
File handles: replace bare json.load(open(...)) calls with proper
with-blocks across claws.py, secretvalidation.py, and parsing.py.
Also fix the bare open() in getAccounts().

Path traversal: add _is_valid_account_id() which enforces that profile
IDs match \d{12} (the AWS account ID format) before they are used in
filesystem paths. Applied in getAccounts() to filter accounts.txt
entries, and at the CLI entry point to reject an invalid --profile arg.

https://claude.ai/code/session_01Hwhkq2ASMSCrpudm5DkvcX
Container image Lambdas have no Code.Location — they return Code.ImageUri
and RepositoryType='ECR' instead. The previous code crashed with KeyError
on these.

Now: always capture environment variables regardless of package type
(get_function_configuration works for both), then for ECR functions log
the function name, version, and image URI to logs/ecr_functions.log and
skip the zip download. Zip-based Lambdas continue as before.

https://claude.ai/code/session_01Hwhkq2ASMSCrpudm5DkvcX
Layers: add downloadLayers() which reads the Layers list from the
function configuration, calls get_layer_version_by_arn for each,
and downloads the zip. Skips layers already on disk so shared layers
aren't downloaded once per function that uses them.

Presigned URL expiry: the URL returned by get_function expires in ~10
minutes. Under heavy threading the download can start after expiry and
get a 403. Now retries up to 3 times, re-calling get_function each time
to get a fresh URL, with exponential backoff (2s, 4s) between attempts.
Logs a failure if all attempts are exhausted.

https://claude.ai/code/session_01Hwhkq2ASMSCrpudm5DkvcX
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.

2 participants