Commit graph

649 commits

Author SHA1 Message Date
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
af8bcd3ed2 Print useful error when switch fails outside user control 2023-12-06 14:06:28 +01:00
William Martin
4e04b98f6f Add user flag to auth token command 2023-12-06 14:06:28 +01:00
William Martin
7106129f65 Restore previous happy state on Switch failure 2023-12-06 14:06:28 +01:00
William Martin
ecfb226d5d Fix linting errors 2023-12-06 14:06:28 +01:00
William Martin
8d53c9e55e Only migrate oauth token under new user 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
553b89f30c Add tests for AuthConfig TokenForUser 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
William Martin
8e89af96e8 Write tests for SwitchUser 2023-12-06 14:06:28 +01:00
William Martin
a0e5e4c709 Use NewIsolatedTestConfig in AuthConfig tests 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
e4ed4041cd Use auth config and only print stdout in status 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
df274d4f3a Implement auth switch 2023-12-06 14:06:28 +01:00
William Martin
72d5550407 Implemented auth logout for multiaccount 2023-12-06 14:06:28 +01:00
William Martin
1bf6023164 Display message when logging into existing account 2023-12-06 14:06:28 +01:00
William Martin
a9acece7dd Split Login into adding a user and switching
It makes clear the steps that should be needed to "switch" which should be
shared between Login (add user and switch to it), Logout (remove user and switch
to another), and Switch (no modification and switch to a user)
2023-12-06 14:06:28 +01:00
William Martin
209aed30b4 Fix typo on migration comment 2023-12-06 14:06:28 +01:00
William Martin
a00294eff9 Fix double negatives in migration errors 2023-12-06 14:06:28 +01:00
William Martin
06c36a74c2 Remove host entries without valid tokens during migration 2023-12-06 14:06:28 +01:00
Sam Coe
4f33d88c5f Set user level config values automatically when setting host level config values 2023-12-06 14:06:28 +01:00
Sam Coe
38b73e3f85 Set host level git_protocol on login 2023-12-06 14:06:28 +01:00
Sam Coe
eb771aecc9 Address PR comments 2023-12-06 14:06:28 +01:00
Sam Coe
d2ff55737c Enable multi-account migration 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
2ca8b1ea94 Login sets token in 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
Sam Coe
e0ebbc9e88 Add auth token migration to multi account migration 2023-12-06 14:06:28 +01:00
William Martin
9efa7248a9 Initial multi-account migration work 2023-12-06 14:06:28 +01:00
David Gardiner
d22c6f33e9 Update comment 2023-10-31 13:12:25 -07:00
David Gardiner
d04a9d941f Lock the Close func 2023-10-31 13:11:28 -07:00
David Gardiner
1bcf92438a Defer the mutex unlock 2023-10-31 13:08:34 -07:00
David Gardiner
b566ea670c Add mutex for connect 2023-10-31 13:01:24 -07:00
David Gardiner
581b6652e2 Resolve race condition in codespaces connection 2023-10-31 12:19:14 -07:00
David Gardiner
500f359592
Don't poll for addition codespace permissions if user chooses to create without them (#8267) 2023-10-30 13:22:38 -05:00
Sam Coe
7924878315
Fix git protocol and refactor Config interface (#8246) 2023-10-27 15:42:05 +02:00
Sam Coe
20baccfa85
Add default configuration back from go-gh (#8244) 2023-10-24 13:23:31 +02:00
Sam Coe
5023b61909
Remove uses of FuzzyAgoAbbr in tables (#8222) 2023-10-22 17:33:49 +02:00
Heath Stewart
7738b6187c
Add headers to all tables (#8157) 2023-10-20 11:20:02 +02:00
William Martin
4fc1999847 Add link to token source issue 2023-10-19 15:39:10 +02:00
William Martin
6dc04bb1e2 Remove GetOrDefault uses in favour of GitProtocol 2023-10-19 12:57:19 +02:00
William Martin
7d8c1af009 Fix GitProtocol signature and rework test descriptions 2023-10-19 12:49:38 +02:00
William Martin
b9cbee0462 Remove incorrect comment about HasEnvToken 2023-10-19 12:39:31 +02:00
William Martin
3c3fbcdb66 Remove Login branch that handles empty username 2023-10-19 12:35:43 +02:00
William Martin
aa8848471f Remove Logout branch that handles empty hostname 2023-10-19 12:33:15 +02:00
William Martin
c430da7329 Ensure all AuthConfig tests are isolated on disk 2023-10-19 12:31:41 +02:00
William Martin
c9de817865 Avoid using keyring unnecessarily in AuthConfig tests
This is to avoid the impression that the keyring matters, when the test
is actually about general auth behaviour
2023-10-19 12:26:52 +02:00