Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unintuitive behavior APOLLO_KEY supersedes --profile. #2074

Open
drts01 opened this issue Aug 25, 2024 · 1 comment
Open

Unintuitive behavior APOLLO_KEY supersedes --profile. #2074

drts01 opened this issue Aug 25, 2024 · 1 comment
Labels
bug 🐞 triage issues and PRs that need to be triaged

Comments

@drts01
Copy link

drts01 commented Aug 25, 2024

Description

Unintuitive behavior, where environment variables supersede the CLI flags. Specifically, APOLLO_KEY supersedes --profile.

Steps to reproduce

  1. Create a profile with rover.
  2. Set an API key, APOLLO_KEY.
  3. Check auth with rover config whoami --profile PROFILE

Expected result

The profile flag should be used, not the environment variable APOLLO_KEY.

Actual result

❯ rover --skip-update-check config whoami --profile PROFILE --format json --log debug | jq .
  DEBUG rover::utils::env: $APOLLO_KEY = serv**************************************************fpGQ
    at src/utils/env.rs:36
...
  DEBUG houston::profile: using API key serv**************************************************fpGQ
    at crates/houston/src/profile/mod.rs:88

Checking identity of your API key against the registry.
  DEBUG rover_client::blocking::studio_client: self.version: "0.26.0"
    at crates/rover-client/src/blocking/studio_client.rs:87
...
  DEBUG houston::profile: using API key serv**************************************************fpGQ
    at crates/houston/src/profile/mod.rs:88

{
  "data": {
    "api_key": "serv**************************************************fpGQ",
    "graph_id": "Supergraph",
    "graph_title": "Supergraph",
    "key_type": "Graph",
    "origin": "$APOLLO_KEY",
    "success": true,
    "user_id": null
  },
  "error": null,
  "json_version": "1"
}

Environment

❯ rover info
Rover Info:
Version: 0.26.0
Install Location: /Users/<REDACTED>/.local/bin/rover
OS: Mac OS 14.6.1 [64-bit]
Shell: /bin/zsh
@drts01 drts01 added bug 🐞 triage issues and PRs that need to be triaged labels Aug 25, 2024
@LongLiveCHIEF
Copy link
Contributor

related proposal #2047

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 triage issues and PRs that need to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants