Skip to content

[CDTOOL-1332] Honor --profile when resolving the API token#1792

Open
jedisct1 wants to merge 1 commit into
mainfrom
fdenis/profilo
Open

[CDTOOL-1332] Honor --profile when resolving the API token#1792
jedisct1 wants to merge 1 commit into
mainfrom
fdenis/profilo

Conversation

@jedisct1
Copy link
Copy Markdown
Contributor

Change summary

The deprecated --profile/-o flag was parsed into Data.Flags.Profile but never consulted during token lookup, so commands silently ran against the default token instead of the profile the user named on the command line.

Token resolution now consults --profile after --token and before FASTLY_API_TOKEN.

An unknown profile name is treated as a hard error rather than a silent fallback, so the wrong token can no longer slip through under --quiet.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Core Features:

  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

User Impact

Users who pass --profile <name> (or -o <name>) will now have the command run against the named profile's token, as the help text already promised.

Users who pass an unknown profile name will see a clear remediation error instead of the command silently using the wrong token.

Are there any considerations that need to be addressed for release?

No breaking changes to documented behavior.

Scripts that relied on --profile <bogus> silently being ignored will now exit with an error.

The deprecated `--profile` flag (`-o`) was silently ignored during
token lookup, so commands ran against the default token regardless
of the profile the user named on the command line.

Token resolution now consults `--profile` after `--token` and
before the environment variable, the manifest profile, and the
default token.

An unknown profile name is a hard error rather than a silent
fallback, so the wrong token can no longer slip through under
`--quiet`.
@jedisct1 jedisct1 requested a review from a team as a code owner May 12, 2026 11:18
@jedisct1 jedisct1 requested a review from philippschulte May 12, 2026 11:18
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