Skip to content

Misleading auth errors: CLOUDFLARE_PROFILE ignored, a missing --profile reported as "No authentication token found", a wrong account id as "Authentication error" #101

Description

@joeblew999

cf version: 1.0.0-beta.5, macOS

Three auth and config mistakes produce errors that point the wrong way:

  1. CLOUDFLARE_PROFILE is ignored. CLOUDFLARE_PROFILE=nosuchprofile cf workers list --per-page 1 succeeds with the default credentials. It neither uses nor rejects the profile.
  2. A missing profile reads like a missing login. cf workers list --profile nosuchprofile gives No authentication token found. instead of "profile nosuchprofile not found (available: ...)".
  3. A wrong account id reads like a bad token. CLOUDFLARE_ACCOUNT_ID=00000000000000000000000000000000 cf workers list gives [10000] Authentication error (403). The token is fine; the account id isn't one the token can access.

Expected:

  • honour CLOUDFLARE_PROFILE, or document that it isn't supported;
  • name the missing profile;
  • for a 403 on an /accounts/{id} path, suggest checking the account id (e.g. against cf auth whoami).

Related: #37 (document supported environment variables).

Found while evaluating cf for a dev workflow: https://github.com/joeblew999/cf-cli-test (FINDINGS.md, findings/).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    not-in-wrangler

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions