fix(router): resolve S3 storage credentials from the environment - #1071
Open
Meemaw wants to merge 2 commits into
Open
fix(router): resolve S3 storage credentials from the environment#1071Meemaw wants to merge 2 commits into
Meemaw wants to merge 2 commits into
Conversation
The S3 storage backend built its client with `AmazonS3Builder::new()`, which ignores the standard `AWS_*` environment variables. As a result it did not work out of the box in Kubernetes/EKS and credentials could not be supplied via the environment. Build from `AmazonS3Builder::from_env()` instead, so EKS IRSA works automatically (the pod identity webhook injects `AWS_WEB_IDENTITY_TOKEN_FILE`/`AWS_ROLE_ARN`) and static credentials can be provided via `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`. Explicit config values are applied afterwards and continue to take precedence. Adds e2e coverage for env-supplied credentials and config-over-env precedence using the in-process S3 mock. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the S3 storage backend to resolve credentials from standard AWS_* environment variables by default when no explicit credentials are provided. It also adds integration tests to verify this behavior and ensure explicit configuration takes precedence. Feedback on the changes highlights a potential issue where unconditionally using AmazonS3Builder::from_env() can cause credential pollution or conflicts when explicit credentials are configured, and suggests conditionally initializing the builder only when configuration credentials are absent.
…gured Addresses review feedback: seeding the builder with `from_env()` unconditionally could mix environment-derived credentials into explicitly configured ones — a stray `AWS_SESSION_TOKEN` attaching to configured static keys, or env static keys taking object_store's internal precedence over a configured `web_identity` role. Only seed from `from_env()` when no credentials are configured. When credentials are set explicitly, start from a clean builder and use solely the configured credentials; non-credential env vars (region, endpoint) still apply as a fallback. Strengthen the precedence e2e test to cover the `AWS_SESSION_TOKEN` pollution case. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Meemaw
marked this pull request as ready for review
June 13, 2026 21:09
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.
The S3 storage backend built its client with
AmazonS3Builder::new(), which ignores the standardAWS_*environment variables. As a result it did not work out of the box in Kubernetes/EKS and credentials could not be supplied via the environment.Build from
AmazonS3Builder::from_env()instead, so EKS IRSA works automatically (the pod identity webhook injectsAWS_WEB_IDENTITY_TOKEN_FILE/AWS_ROLE_ARN) and static credentials can be provided viaAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY. Explicit config values are applied afterwards and continue to take precedence.Adds e2e coverage for env-supplied credentials and config-over-env precedence using the in-process S3 mock.