Skip to content

add client provided aws secret support - #11

Merged
ethancedwards8 merged 1 commit into
mainfrom
devin/1788392252-forward-aws-credentials
Sep 3, 2026
Merged

ethancedwards8 merged 1 commit into
mainfrom
devin/1788392252-forward-aws-credentials

Conversation

@ethancedwards8

Copy link
Copy Markdown
Member

Motivation

The daemon resolves AWS credentials for s3:// substituters as root, so per-user credential sources (IAM Identity Center / SSO profiles in ~/.aws/config) are invisible to it. This lets a trusted client resolve the credentials itself and hand them to the daemon, so the Exa S3 cache works with SSO without giving root long-lived keys.

Context

New setting forward-aws-credentials (default false).

  • Client (RemoteStore::setOptions): for every s3:// substituter, resolve credentials for its profile via the existing CRT provider chain, JSON-encode {profile: {accessKeyId, secretAccessKey, sessionToken?}}, and send it as a reserved forwarded-aws-credentials override alongside the other SetOptions overrides.
  • Daemon (ClientSettings::apply): if the client is trusted, decode and install into the process-global AwsCredentialProvider, which serves them for matching profiles ahead of the provider chain. The daemon forks one process per connection, so this never leaks between clients. Untrusted clients get the usual "not a trusted user" warning; a daemon built without AWS support warns and ignores it. Decode errors never echo the payload.

Verified against s3://exa-nix-cache with a locally built daemon (no AWS env/config, IMDS disabled): 403 without the setting, successful substitution with it, ignored with a warning for an untrusted client.

Link to Devin session: https://app.devin.ai/sessions/ffb6189ecd7347dd93cbd827fca01872
Open in Devin Desktop: https://app.devin.ai/desktop/session/ffb6189ecd7347dd93cbd827fca01872?variant=devin
Requested by: @ethancedwards8

The daemon resolves AWS credentials for `s3://` substituters as root, so
per-user credential sources such as IAM Identity Center (SSO) profiles
in `~/.aws/config` are invisible to it.

With `forward-aws-credentials = true`, `RemoteStore::setOptions` resolves
credentials for every AWS profile referenced by an `s3://` substituter in
the client process (where the user's `HOME`, SSO cache and config are
available) and sends them to the daemon as a reserved
`forwarded-aws-credentials` entry alongside the other overrides. The
daemon installs them into its `AwsCredentialProvider`, which serves them
for matching profiles ahead of the CRT provider chain. The daemon forks
one process per connection, so the state never leaks to other clients.

Only trusted clients are honoured; untrusted clients get the same
"you are not a trusted user" warning as for other restricted settings.
A daemon built without AWS support warns and ignores the payload.
Decoding errors never echo the (secret) input.

Assisted-by: Devin:claude-opus-4.6
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@ethancedwards8
ethancedwards8 merged commit 4b2293d into main Sep 3, 2026
5 checks passed
ethancedwards8 added a commit that referenced this pull request Sep 7, 2026
…aws-credentials

Revert "libstore: Add `forward-aws-credentials` setting" (#11)
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.

1 participant