Next: , Previous: , Up: API   [Contents]


5.2 Authentication

Command: ghub-create-token

This command creates a new token using the values it reads from the user and then stores it according to the variable auth-sources. It can also be called non-interactively, but you shouldn’t do that yourself.

This is useful if you want to fully setup things before attempting to make the initial request, if you want to provide fewer than the requested scopes or customize auth-sources first, or if something has gone wrong when using the wizard that is used when making a request without doing this first. (Note that instead of using this command you can also just repeat the initial request after making the desired adjustments — that is easier.)

This command reads, in order, the HOST (Github instance), the USERNAME, the PACKAGE, and the SCOPES in the minibuffer, providing reasonable default choices. SCOPES defaults to the scopes that PACKAGE requests using the variable PACKAGE-github-token-scopes.

Command: ghub-token-scopes

Users are free to give a token access to fewer scopes than what the respective package requested. That can, of course, lead to issues, and package maintainers have to be able to quickly determine if such a (mis-)configuration is the root cause when users report issues.

This command reads the required values in the minibuffer and then shows a message containing these values along with the scopes of the respective token. It also returns the scopes (only) when called non-interactively. Also see Using Ghub in a Package.