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

🚀 Feature Request: [API tokens] describe the current permissions in wrangler whoami #1371

Closed
petebacondarwin opened this issue Jun 29, 2022 · 2 comments
Labels
blocked Blocked on other work enhancement New feature or request internal Requires support from the Cloudflare Platform

Comments

@petebacondarwin
Copy link
Contributor

Describe the solution

When running wrangler whoami we should display a list of allowed permissions for the current authenticated user (or API token). This will help with scenarios where other commands fail with authorisation errors from the backend API.

@petebacondarwin petebacondarwin added the enhancement New feature or request label Jun 29, 2022
@petebacondarwin petebacondarwin moved this to Untriaged in workers-sdk Jun 29, 2022
@petebacondarwin petebacondarwin moved this from Untriaged to Selected for development in workers-sdk Jun 29, 2022
@GregBrimble GregBrimble changed the title 🚀 Feature Request: describe the current permissions in wrangler whoami 🚀 Feature Request: [API tokens] describe the current permissions in wrangler whoami Jul 25, 2022
cameron-robey added a commit that referenced this issue Jul 27, 2022
Often users experience issues due to tokens not having the correct permissions associated with them (often due to new scopes being created for new products). With this, we print out a list of permissions associated with OAuth tokens with the wrangler whoami command to help them debug for OAuth tokens. We cannot access the permissions on an API key, so we direct the user to the location in the dashboard to achieve this.
We also cache the scopes of OAuth tokens alongside the access and refresh tokens in the .wrangler/config file to achieve this.

Currently unable to implement #1371 - instead directs the user to the dashboard.
Resolves #1540
@cameron-robey cameron-robey added the blocked Blocked on other work label Aug 11, 2022
@lrapoport-cf lrapoport-cf added the internal Requires support from the Cloudflare Platform label Sep 7, 2022
@lrapoport-cf
Copy link
Contributor

lrapoport-cf commented Sep 7, 2022

this requires change to internal permissions on API tokens, which isn't currently being pursued. but we may want to update messaging/logging to be more helpful

@lrapoport-cf lrapoport-cf moved this from Selected for Development to Backlog in workers-sdk Sep 7, 2022
@penalosa
Copy link
Contributor

As far as I know, this is implemented. Running wrangler whoami gives a list of scopes for the current token, and their permission level.
Screenshot 2023-01-23 at 16 24 00

@github-project-automation github-project-automation bot moved this from Backlog to Done in workers-sdk Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on other work enhancement New feature or request internal Requires support from the Cloudflare Platform
Projects
None yet
Development

No branches or pull requests

4 participants