Conversation
The cache key was the role ARN alone, and both environments default to `_default`, so a staging login overwrote the prod entry (and `creds` would silently serve/refresh staging credentials for a prod profile). Key entries by `<proxy host>/<role>` and let `creds` take `--proxy-url` / `SOURCE_PROXY_URL` to select the environment. BREAKING CHANGE: existing cached logins are no longer found; run `source-coop login` once after upgrading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Existing prod caches (keyed by role ARN alone) stay readable, so upgrading needs no re-login. Only non-production proxies get the host prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
Cached credentials were keyed only by role ARN (
source-coop-cli/_defaultin the keychain). Staging and prod both use_default, so logging into one overwrote the other. Worse,source-coop credsin a prod profile would then quietly return (and refresh) staging credentials.Change
data.source.coop) keeps the bare role ARN as its cache key (_default), so existing caches stay readable and no re-login is needed.<host>/<role>, e.g.data.staging.source.coop/_default. The same key is used for the keychain entry, the fallback file and the refresh lock.credsaccepts--proxy-url/SOURCE_PROXY_URL(defaults to the build's proxy) to choose the environment.The special case matches the production host itself, not the build's default proxy URL. That keeps a staging build and a prod build from both writing to
_default. As a result, a staging-build user with a login cached under_defaultneeds to log in again once.Testing
cargo test: 22 passed, includingkey_separates_environments, which covers both the prod and staging keyscargo clippy --all-targets: cleancargo check --no-default-features --features staging: builds🤖 Generated with Claude Code