You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the feature or problem you’d like to solve
the current output of running gh auth status is
github.com
✓ Logged in to github.com as mntlty (oauth_token)
✓ Git operations for github.com configured to use ssh protocol.
✓ Token: *******************
it would be helpful to list the scopes the token has access to
Proposed solution
Running this command generates an api call to the graphql endpoint to query the current user. The oauth scopes are available as part of the x-oauth-scopes headers in the response.
Additional context
it is possible to add scopes to a token with gh auth login --scopes <scope-names> but as far as I can tell there's no way to view the scopes of a token from a cli command
Reacted by Natthakit Susanthitanon, jose-chaves-cko, Spenser Black and Edipo Vinicius da Silva
Note that if the token is a token of a different kind than PAT v1 or OAuth app token, scopes header will be empty. I wonder what we should print in that case.
that's a good question. we could not print anything like we do today, or print that scopes aren't available based on the token type (is there a way to tell the token type?) which tells the user that we tried and it's not broken.
Activity
mislav commentedon Oct 31, 2022
Good idea; thanks!
Note that if the token is a token of a different kind than PAT v1 or OAuth app token, scopes header will be empty. I wonder what we should print in that case.
mntlty commentedon Oct 31, 2022
that's a good question. we could not print anything like we do today, or print that scopes aren't available based on the token type (is there a way to tell the token type?) which tells the user that we tried and it's not broken.