Commit graph

41 commits

Author SHA1 Message Date
Kynan Ware
d68a4daa8c
docs: OAuth doc link moves to newline
Co-authored-by: Andy Feller <andyfeller@github.com>
2025-02-24 14:12:19 -07:00
Kynan Ware
736447cca4 docs: warn about process revoking all tokens 2025-02-23 18:24:28 +00:00
Kynan Ware
e2f382c44d docs: document how to revoke gh OAuth tokens
This documents how to revoke OAuth tokens generated by `gh`. This also
adjusts some language to match the language used by GitHub.com:
"invalidate" is now "revoke".
2025-02-23 18:12:06 +00:00
William Martin
1d38230675
Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
Sam Coe
024cb939af Rename authCfg.Token to authCfg.ActiveToken and authCfg.SetToken to authCfg.SetActiveToken 2023-12-06 14:06:28 +01:00
Sam Coe
1a3392a379 Rename authCfg.User to authCfg.ActiveUser 2023-12-06 14:06:28 +01:00
Sam Coe
8cdbc1a8ca Refactor authCfg.UsersForHost to not return an error 2023-12-06 14:06:28 +01:00
William Martin
ab5103f061 Don't set user level git protocol and don't switch 2023-12-06 14:06:28 +01:00
William Martin
c165d5ccc0 Use isolated config in logout cmd tests 2023-12-06 14:06:28 +01:00
Sam Coe
eca5f72328 UX polish and standardization of language 2023-12-06 14:06:28 +01:00
William Martin
7667fbdb5a Handle logout having no candidates 2023-12-06 14:06:28 +01:00
William Martin
df274d4f3a Implement auth switch 2023-12-06 14:06:28 +01:00
Sam Coe
2fc6dbd851 Add user flag to auth logout command 2023-12-06 14:06:28 +01:00
William Martin
72d5550407 Implemented auth logout for multiaccount 2023-12-06 14:06:28 +01:00
Sam Coe
68e30beac4 Logout removes token from keyring using username 2023-12-06 14:06:28 +01:00
Sam Coe
d8084f5f6d Hide all keyring package implementation inside internal keyring package 2023-12-06 14:06:28 +01:00
Yukai Chou
17d336e005 Wrap cli flags in backticks uniformly 2023-11-16 22:54:27 +08:00
Sam Coe
df83dc2d58
Add ability to store tokens in encrypted storage (#7043) 2023-02-28 00:04:53 +00:00
Sam Coe
a33e12a21d
Refactor Config interface in preperation for encrypted token storage (#7033) 2023-02-28 10:51:12 +11:00
vilmibm
198c57a4c6 fix typo 2022-09-20 12:11:36 -07:00
vilmibm
8f3032af36 use Prompter in auth commands 2022-09-13 13:22:50 -07:00
vilmibm
41385477c3 fix linting 2022-07-27 14:15:27 -05:00
vilmibm
d5334f4115 Revert "update linter checks"
This reverts commit 40ecb8c188.
2022-07-27 13:30:41 -05:00
vilmibm
40ecb8c188 update linter checks 2022-07-26 16:06:52 -05:00
Sam Coe
cacff4ad6d
Use go-gh config package (#5771) 2022-06-23 11:50:04 +00:00
Jonathan Fenwick
2abe1b3294
Remove auth logout confirmation prompt (#5751) 2022-06-07 15:26:53 +00:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Naïm Favier
8dbd07212c
Stop auth commands from modifying global config file (#5378) 2022-04-11 17:26:18 +02:00
Mislav Marohnić
e43cb2b880 Port more legacy stubs to the new ask stubber 2022-01-14 19:34:15 +01:00
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Mislav Marohnić
c598a1edc2 Fix detecting cases when cfg.Hosts() is empty 2021-07-20 15:50:58 +02:00
Mislav Marohnić
c9407b2629 More descriptive error when aborting auth due to environment variables
Old message:

    read-only token in GH_TOKEN cannot be modified

This message was vague and some users did not understand that this
refers to the value that is read from environment variables.

New message:

    $ GH_TOKEN=123 ghd auth login -h github.com
    The value of the GH_TOKEN environment variable is being used for authentication.
    To have GitHub CLI store credentials instead, first clear the value from the environment.
2021-01-20 18:27:35 +01:00
Mislav Marohnić
75ebb863e3 Use testify assertions for error matching 2021-01-19 13:59:37 +01:00
vilmibm
a2aa154794 port entirely to ColorScheme 2020-10-29 12:37:45 -07:00
vilmibm
1073c97409 review feedback 2020-09-11 11:36:24 -05:00
vilmibm
c0fc31f7d5 use CanPrompt in commands 2020-09-10 12:13:48 -05:00
Mislav Marohnić
c80292c2e8 Extend Config object with GITHUB_TOKEN support
Adding GITHUB_TOKEN & GITHUB_ENTERPRISE_TOKEN support orthogonal to
Config was getting out of hand, especially in `auth` commands that
adjust their messaging and error status based on the presence of these
environment variables.

The new approach builds in support for tokens from environment straight
into Config object by composition. Thus, commands need not ever be
concerned with any specific environment variables.
2020-09-07 21:33:26 +02:00
vilmibm
f7ee39dfeb bonus: logout error if GITHUB_TOKEN is set 2020-08-12 12:05:56 -05:00
vilmibm
f1c0d04bc0 gh auth refresh 2020-08-12 12:05:27 -05:00
vilmibm
9da7539500 gh auth logout 2020-08-06 12:50:01 -05:00