fix(aws): grant exact runtime capability actions - #1357
Open
aryasaatvik wants to merge 4 commits into
Open
Conversation
Link each affected binding to the authoritative AWS permission documentation and explain the deliberate version, missing-key, presigning, and KMS behavior in source JSDoc.
sam-goodwin
reviewed
Aug 25, 2026
Comment on lines
+56
to
+61
| Effect.provide(HeadObjectHttp), | ||
| Effect.provide(Credentials.mock), | ||
| Effect.provide(Region.of("us-east-1")), | ||
| Effect.provide(FetchHttpClient.layer), | ||
| Effect.provide(Layer.succeed(Self, host)), | ||
| Effect.provide(Layer.succeed(RuntimeContext, runtime)), |
Contributor
There was a problem hiding this comment.
Never do subsequent Effect.provide. You need to provide once, use Layer.* to build the layer
sam-goodwin
reviewed
Aug 25, 2026
Contributor
There was a problem hiding this comment.
These tests should be in fixtures that actually exercise the binding through a lambda function
Contributor
There was a problem hiding this comment.
Don't locally mock. Actually test it
Contributor
There was a problem hiding this comment.
We already have the pattern established, just add tests
Contributor
Author
There was a problem hiding this comment.
I removed the mocks and moved coverage into the existing Lambda fixtures, including HeadObject. Pushed in 46ebfa1; targeted tests pass
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.
Summary
Align runtime IAM policies with the exact AWS capabilities used by the S3 and Secrets Manager bindings.
Policy mapping
HeadObjectHttps3:GetObject,s3:GetObjectVersion, pluss3:ListBucketfor missing-key 404 semanticsPresignGetObjectHttps3:GetObjectGetSecretValueHttpsecretsmanager:GetSecretValueHeadObjectHttpsupports version-aware metadata reads, so both current-object and version-object read actions remain available.ListBucketis kept for AWS's documented404versus403behavior when a key is missing. The presigned binding signs an unversioned GET, andDescribeSecretis not needed because it returns metadata rather than secret contents. Customer-managed KMS permissions remain conditional on the configured key and are intentionally not added to the generic binding.Validation
mise exec bun@1.3.13 -- bun node_modules/alchemy-test/bin/alchemy-test.ts --sequential test/AWS/S3/HeadObjectHttp.test.ts test/AWS/S3/PresignGetObjectHttp.test.ts test/AWS/SecretsManager/GetSecretValueHttp.test.ts0 failed | 3 passedorigin/mainwith3 failed | 0 passed, covering all three policy regressions.Scope
This narrows generated runtime grants and keeps policy definitions inline with the existing binding implementations.