Add scope support to access tokens
- What I did
Add support for token scopes. Access Tokens created in the web interface can take a single scope value but this isn't available in hub-tool. This change lets the user create tokens with a specific scope.
- How I did it
Two user-facing changes:
- Added a
--scopeparameter totoken create. - Added a SCOPE column to
token ls
- How to verify it
The following calls add tokens with the specified scopes:
$ hub-tool token create --scope public_read --format json | jq -c '.Scopes'
[ "repo:public_read" ]
$ hub-tool token create --scope read --format json | jq -c '.Scopes'
[ "repo:read" ]
$ hub-tool token create --description test-cli-scope-5 --scope write --format json | jq -c '.Scopes'
[ "repo:write" ]
$ hub-tool token create --description test-cli-scope-5 --scope admin --format json | jq -c '.Scopes'
[ "repo:admin" ]
Showing the added column in token ls:
$ hub-tool token ls
DESCRIPTION UUID LAST USED CREATED ACTIVE SCOPE
[...]
- Description for the changelog
Add scope support to access tokens
- A picture of a cute animal (not mandatory)
can anyone merge this
Is there new update here? Or code review required? regards, Jayesh
Hi @converge, I observed that you mentioned this PR in your fix #203 , but we do not find the mention in your PR. Could you please confirm if the changes in this PR are included in your PR?