Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

wrangler config should test for valid credentials #439

Closed
EverlastingBugstopper opened this issue Aug 14, 2019 · 2 comments Β· Fixed by #842
Closed

wrangler config should test for valid credentials #439

EverlastingBugstopper opened this issue Aug 14, 2019 · 2 comments Β· Fixed by #842
Assignees
Labels
bug Something isn't working regression Something is broken, but works in previous releases
Milestone

Comments

@EverlastingBugstopper
Copy link
Contributor

πŸ› Bug Report

Environment

  • operating system:
  • output of rustc -V: rustc 1.35.0 (3c235d560 2019-05-20)
  • output of node -v: v12.4.0
  • output of wrangler -V: πŸ‘· ✨ wrangler 1.1.1

Steps to reproduce

Leave email + api key fields blank when running wrangler config

❯ wrangler whoami
πŸ’β€  πŸ‘‹  You are logged with the email 'me@cloudflare.com'.
❯ wrangler config
Enter email: 

Enter api key: 

✨   Successfully configured. You can find your configuration file at: /Users/me/.wrangler/config/default.toml
❯ wrangler whoami
πŸ’β€  πŸ‘‹  You are logged with the email ''.
❯ rm /Users/me/.wrangler/config/default.toml 
❯ wrangler whoami
Error: ⚠️  Your global config has an error, run `wrangler config`: missing field `email`

What did you expect to see?

I either expect to see wrangler config return an error when I pass it invalid credentials, and for wrangler whoami to error when there are invalid credentials in their .wrangler/config/default.toml

What did you see instead?

No errors and wrangler whoami saying that I am successfully logged in as email ''.

Other cases

It's not just empty credentials that can be successfully configured, completely fake ones work just fine as well.

❯ wrangler config
Enter email: 
a@cloudflare.com
Enter api key: 
1234
✨   Successfully configured. You can find your configuration file at: /Users/me/.wrangler/config/default.toml
❯ wrangler whoami
πŸ’β€  πŸ‘‹  You are logged with the email 'a@cloudflare.com'.
@ashleymichal
Copy link
Contributor

one of the bigger issues here is that some of the error messages that wrangler gives for bad credentials are garbage. we should at least improve those. forcing valid credentials may be out of scope for this release (1.3.0).

@gabbifish gabbifish modified the milestones: 1.3.0, 1.4.0 Aug 30, 2019
@EverlastingBugstopper EverlastingBugstopper modified the milestones: 1.4.0, 1.5.0 Sep 24, 2019
@ashleygwilliams ashleygwilliams modified the milestones: 1.5.0, 1.6.0 Oct 21, 2019
@ashleymichal ashleymichal added the regression Something is broken, but works in previous releases label Oct 29, 2019
@gabbifish
Copy link
Contributor

If /user is not ready for use with API tokens, we can use the /user/tokens/verify endpoint as mentioned in https://blog.cloudflare.com/api-tokens-general-availability

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working regression Something is broken, but works in previous releases
Projects
None yet
4 participants