Commit graph

52 commits

Author SHA1 Message Date
Josh Soref
6ff355049c
Improve discovery of gh auth status 2024-03-18 12:09:27 -04:00
Sam Coe
80fc413592 Polish auth status timeout error message 2023-12-06 14:06:28 +01: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
Sam Coe
587007a562 Additional auth status tests 2023-12-06 14:06:28 +01:00
William Martin
15ba536317 Ensure subtests use the right t during setup 2023-12-06 14:06:28 +01:00
William Martin
c9a6b7cc00 Always mock the keyring in NewIsolatedTestConfig 2023-12-06 14:06:28 +01:00
Sam Coe
e806664ef7 New UX for auth status 2023-12-06 14:06:28 +01:00
Sam Coe
760dc91faa Include environment variable users in auth status output 2023-12-06 14:06:28 +01:00
William Martin
b2997cc7bd Handle multi account golden path in auth status 2023-12-06 14:06:28 +01:00
William Martin
e4ed4041cd Use auth config and only print stdout in status 2023-12-06 14:06:28 +01:00
William Martin
5d10beb60a Use config to look up user for status 2023-12-06 14:06:28 +01:00
William Martin
08c7bd1df2 Use real config and login in status tests 2023-12-06 14:06:28 +01:00
Mika
2f31607096
Add timeout error in gh auth status (#8337) 2023-11-29 08:54:55 +00:00
Sam Coe
7924878315
Fix git protocol and refactor Config interface (#8246) 2023-10-27 15:42:05 +02:00
William Martin
7d8c1af009 Fix GitProtocol signature and rework test descriptions 2023-10-19 12:49:38 +02:00
Kousik Mitra
6fc6b87484
Reword token invalid message (#7906) 2023-08-28 15:12:28 -05:00
rajhawaldar
b8302311fa
Added wantErrOut property 2023-06-15 09:08:06 +05:30
rajhawaldar
437b78a955 Resolve tests/lint errors 2023-06-07 09:21:50 +05:30
rajhawaldar
69c02b9b8a update gh auth status to write to stdout on success 2023-06-06 23:30:16 +05:30
Sam Coe
a33e12a21d
Refactor Config interface in preperation for encrypted token storage (#7033) 2023-02-28 10:51:12 +11:00
Ariel Deitcher
a5edd8f542
show token scopes on auth status (#6546)
- show path to config file
- display token prefix
- refine how missing scopes are shown

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-01-25 16:25:00 +01:00
Sam Coe
cacff4ad6d
Use go-gh config package (#5771) 2022-06-23 11:50:04 +00:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
nate smith
0a619d422a undo overzealous find/replace 2022-01-14 15:27:05 -06:00
nate smith
56522f9f14 formatting 2022-01-11 14:57:10 -06:00
nate smith
562f1b3d0d add GetOrDefault functionality to config 2022-01-11 14:56:58 -06: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ć
5a110c8e42 Add SSH key generation & uploading to gh auth login flow 2021-02-01 23:34:00 +01:00
Sam Coe
71fd2fa24c
Fix up test 2021-01-22 08:50:09 -08:00
Sam Coe
5e10638b0e
Merge branch 'trunk' into auth-status-fail 2021-01-22 08:46:24 -08:00
Mislav Marohnić
4a2cc8d2a4 Simplify ssh-key list
Do not require nor request `read:public_key` scope by default.
2021-01-20 20:23:57 +01:00
edualb
e26a1b98a1 add ssh-key command 2021-01-20 20:23:38 +01:00
Mislav Marohnić
75ebb863e3 Use testify assertions for error matching 2021-01-19 13:59:37 +01:00
Nilesh Singh
f3fcaf6c9c Fix error message text & add test case 2021-01-17 14:42:49 +05:30
Nilesh Singh
2f5ffbd60a Add fail message for non-existent hostname 2021-01-15 13:28:57 +05:30
Mislav Marohnić
c39dc28fa1 Rename auth/client to auth/shared 2020-12-07 17:08:42 +01:00
vilmibm
a2aa154794 port entirely to ColorScheme 2020-10-29 12:37:45 -07:00
Sam
edecb2e4f7
Merge pull request #2207 from cli/codespaces
[Codespaces] Support "integration" tokens
2020-10-27 15:37:02 +03:00
Mislav Marohnić
4bda6fceec auth status: fix reporting the token source 2020-10-16 17:11:14 +00:00
rista404
2bdfc10e0a
Add ability to print auth token 2020-10-11 12:55:34 +02: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
37322ec333 less spacing 2020-08-11 16:45:35 -05:00
vilmibm
6c64cb8d23 remove vestigial return from HasMinimumScopes 2020-08-11 16:33:13 -05:00
vilmibm
36b2d3f6a7 ensure that config is not written 2020-08-11 16:24:08 -05:00
vilmibm
ba2b8d50a1 minor 2020-08-11 16:20:03 -05:00
vilmibm
cd32303404 auth status formatting 2020-08-11 16:16:59 -05:00
vilmibm
3a33735da8 be more helpful 2020-08-11 15:58:00 -05:00