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
Mislav Marohnić
38ea595ce2
Fix refresh test
2020-12-07 20:07:20 +01:00
Mislav Marohnić
3c76eb15a4
Add tests for auth git-credential command
2020-12-07 20:01:53 +01:00
Mislav Marohnić
381e83e6e5
Extend git credential prompt to auth refresh
2020-12-07 20:01:16 +01:00
Mislav Marohnić
c39dc28fa1
Rename auth/client to auth/shared
2020-12-07 17:08:42 +01:00
Mislav Marohnić
d56d92c908
If git credential helper is non-defined, set gh as credential helper
2020-11-23 20:20:05 +01:00
Mislav Marohnić
e36c9029d3
Fix broken tests
2020-11-20 20:33:08 +01:00
Mislav Marohnić
91d2adc134
Avoid re-requesting username if we already have it
2020-11-20 19:36:26 +01:00
Mislav Marohnić
67672fa88c
Prime user's git HTTPS credentials on auth login
2020-11-20 19:36:04 +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ć
460d55f723
Move HostnameValidator to ghinstance
2020-10-21 16:31:20 +00:00
wilso199
3ecb9de1a7
Adding a hostname flag option for use with gh api
2020-10-21 16:31:20 +00:00
Sam
f8fd61cc6c
Merge pull request #2157 from rista404/print-auth-token-1514
...
Add ability to print auth token
2020-10-20 08:46:45 +02:00
Mislav Marohnić
4bda6fceec
auth status: fix reporting the token source
2020-10-16 17:11:14 +00:00
Ryan Nystrom
02883a89e3
add tests
2020-10-16 15:59:41 +00:00
Ryan Nystrom
93bc389269
Add scopes flag to login
2020-10-15 22:04:18 +00:00
rista404
2bdfc10e0a
Add ability to print auth token
2020-10-11 12:55:34 +02:00
Mislav Marohnić
49909b5123
Tweak gh auth login examples
2020-10-01 19:56:56 +02:00
Mislav Marohnić
cc2b86f3a6
Specify minimum required token scopes in gh help auth login
2020-10-01 19:56:33 +02:00
Martín Montes
cacf0157b3
Using ghinstance.OverridableDefault() instead of a harcoded hostname
2020-09-22 18:22:29 +02:00
Martín Montes
793e866850
Using assert.Regexp for testing stderr's content
2020-09-22 17:50:57 +02:00
Martín Montes
81caade918
Access token tip message using hostname
2020-09-22 12:32:37 +02:00
vilmibm
68a019cc3c
review feedback
2020-09-14 10:16:50 -05:00
vilmibm
2345f49ccb
support auth login --web
2020-09-11 13:07:39 -05:00
vilmibm
3a492b892a
Merge branch 'disable-prompts' of github.com:cli/cli into disable-prompts
2020-09-11 11:42:20 -05:00
vilmibm
1073c97409
review feedback
2020-09-11 11:36:24 -05:00
vilmibm
4d3e26e927
prompts disabled test for auth refresh
...
the behavior for nontty vs. prompts disabled is pretty different so i
opted for a new test, here
2020-09-10 13:19:43 -05:00
vilmibm
c0fc31f7d5
use CanPrompt in commands
2020-09-10 12:13:48 -05:00
vilmibm
15bfb5447b
split auth flow code into new internal package
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
Mislav Marohnić
48a827ee34
Tweak gh config set -h output format on auth login
2020-09-01 13:19:30 +02:00
Mislav Marohnić
0de3f678bc
Only validate --hostname when flag was provided
2020-09-01 13:19:19 +02:00
Mislav Marohnić
b029397d32
Validate the --hostname flag value
2020-09-01 13:06:13 +02:00
Mislav Marohnić
1a051e9c44
Validate hostname as entered in the auth prompt
2020-09-01 12:59:58 +02:00
vilmibm
b08255a720
bonus: GitHub Enterprise Server wording
2020-08-19 10:32:00 -05:00
vilmibm
cba401deb0
check parent annotatiosn for auth skip
2020-08-19 10:21:19 -05:00
vilmibm
850a7ef243
print nice login message when no auth detected
2020-08-18 17:57:52 -05:00
vilmibm
1efd3ebb51
rebase strife
2020-08-12 12:07:36 -05:00
vilmibm
2f1e9ecc7a
review feedback
2020-08-12 12:06:14 -05:00
vilmibm
f7ee39dfeb
bonus: logout error if GITHUB_TOKEN is set
2020-08-12 12:05:56 -05:00
vilmibm
e6ae0a122b
accept additional scopes in auth flow
2020-08-12 12:05:54 -05:00
vilmibm
f1c0d04bc0
gh auth refresh
2020-08-12 12:05:27 -05:00
Mislav Marohnić
aa774c4993
Merge remote-tracking branch 'origin' into issue-commands-isolate
2020-08-12 12:11:01 +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