-
Notifications
You must be signed in to change notification settings - Fork 925
Make Wrangler warn more loudly if you're missing auth scopes #9734
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
Conversation
🦋 Changeset detectedLatest commit: 704756e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
YES 🐐 🐐 🐐 🐐 |
how does wrangler know what is missing? asking because IIRC no way to get this back directly from the Cloudflare API? |
logger.log( | ||
`🔓 Token Permissions: If scopes are missing, you may need to logout and re-login.` | ||
); | ||
logger.log(`🔓 Token Permissions:`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the order of these two logs be reversed, now that we're listing the missing token scopes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I "think" it is OK?
It decides based on what scopes it would request if it performed a |
de2f5d8
to
bb9c382
Compare
bb9c382
to
704756e
Compare
Previously, when an authentication error was thrown, Wrangler would print out your Oauth token scopes with the passive message "If scopes are missing, you may need to logout and re-login." However, it was hard for users to know if scopes were missing, because users don't necessarily know what the right set of scopes are.
As it turns out, Wrangler does know what the set of scopes should be, so now we print out a much more actionable warning:
Additionally, this fixes an issue where auth errors from Containers & Cloudchamber were not handled the same as other auth errors, because of the custom API client that those code paths use.