Tyler Leonhardt
ac27273e48
Try to revoke tokens that are getting deleted
...
Best effort.
Fixes https://github.com/microsoft/vscode/issues/152055
2023-07-17 14:12:10 -07:00
Tyler James Leonhardt
013132a5cd
Re-work auth flows into separate file ( #186939 )
...
The flows are crucial to the extension and I wanted to be able to declare which can be used when in a declarative way. This reworks the flows into that model.
Additionally, it pulls in the Client ID and secret from a config which will allow us to not rely on the vscode.dev proxy on Desktop (because we can make a distro change that includes the secret... which isn't a real secret, says GitHub)... unfortunately we still need to rely on it for Web due to CORS but we're in a position where it will be easy to rip the proxy out when GH supports it.
2023-07-03 15:06:42 -07:00
Tyler James Leonhardt
f9b4b4c6a3
Pass session down so we can avoid a network call ( #181570 )
...
We don't need to fetch the user details when the Auth Session already has the info we need. This PR removes that extraneous web request.
I've also changed the `User-Agent` that we pass to be more specific so we can narrow down any future issues with spamming web requests.
Fixes #173645
2023-05-04 11:59:25 -07:00
Tyler James Leonhardt
342a1f4f52
Don't run the local server option if we are running in remote ( #169076 )
...
Additionally improve the conditional for device code flow.
ref #168338
2022-12-13 17:18:25 -08:00
Tyler James Leonhardt
b9b93f2b45
Depend on platform implementations for common features ( #165950 )
...
* don't depend on externals
* remove unneeded externals
2022-11-09 14:29:21 -08:00
Logan Ramos
bf1697d98c
Consume proposed telemetry API ( #165862 )
...
* Consume proposed telemetry API
* Update webpack
2022-11-08 21:58:28 -05:00
Tyler James Leonhardt
9b3e147d6d
GitHub Enterprise Auth improvements ( #165082 )
...
1. Namespace secrets based on the value of github-enterprise.uri to support "multiple separate GHES instances"
2. If the setting value disappears, continue using last set value. Fixes https://github.com/microsoft/vscode-pull-request-github/issues/3992
3. Mark github-enterprise.uri as requires trust
3. Refactoring like:
* UriHandler is handled in extension.ts and passed down everywhere since we can only have 1 instance of it
* misc style (`private` usage, better `disposable` handling)
2022-10-31 12:18:54 -07:00
Tyler James Leonhardt
6684350a58
Onboard GitHub & Microsoft auth extensions to l10n ( #163662 )
...
* onboard github-auth completely to l10n
* onboard microsoft-authentication entirely on to l10n
2022-10-14 08:41:21 -07:00
Tyler James Leonhardt
fc1ef74eb0
GHES oauth flow support ( #160679 )
...
* GHES oauth flow support
* update server number
* delete testing line
2022-09-14 11:26:02 -07:00
Tyler James Leonhardt
15253f1528
add a comment for session.scopes ( #151050 )
2022-06-01 20:02:05 -07:00
Tyler James Leonhardt
0715386207
Return scope array that was given to us so that account icon number goes away ( #151027 )
2022-06-01 14:16:24 -07:00
Tyler James Leonhardt
847629239b
add owner and comment to some telemetry events ( #148752 )
2022-05-05 17:30:51 -04:00
Tyler Leonhardt
ed6d360182
add fallback auth server for github auth and better fallback logic
2022-04-15 15:48:29 -07:00
Tyler Leonhardt
46452a2dbf
ensure GitHub Edu telemetry fires only per account not per session
2022-04-11 11:04:53 -07:00
Tyler Leonhardt
b1fb11e18c
have code-oss use device code flow
2022-03-28 09:05:28 -07:00
Johannes Rieken
4a130c40ed
enable @typescript-eslint/member-delimiter-style, https://github.com/microsoft/vscode/issues/140391
2022-02-02 14:35:33 +01:00
Logan Ramos
c047af40b2
Fix compilation
2022-01-19 16:18:14 -05:00
Tyler Leonhardt
e8a26d3ebf
ensure we treat scopes sorted and we only return a single session since GH only supports a single log in
2021-12-20 17:12:53 -05:00
Tyler James Leonhardt
f67a8b753f
Use device flow over PAT when we are running in a server full environment but not in a supported uri ( #139255 )
...
* initial attempt
* use github-authentication instead
* rework error handling
* update copy
* explain why Workspace
2021-12-15 22:07:49 -05:00
Tyler Leonhardt
4d496f61bc
remove keytar fallback in keychain and add a ton more logging to microsoft auth. ref #133201
2021-10-25 11:16:37 -07:00
Tyler Leonhardt
ab184912e6
make sure we splice the sessions if they have the same set of scopes for github authentication
2021-09-23 16:46:31 -07:00
Tyler Leonhardt
520fa49e68
refactor github auth to be a bit simpler. Remove PAT for GitHub auth since Settings Sync doesn't allow for it and add timeout so that GitHub Auth is not stuck.
2021-08-16 16:34:21 -07:00
Tyler Leonhardt
a8332b75e4
delete extra afterTokenLoad
2021-08-03 16:24:28 -07:00
Tyler Leonhardt
37a8fe959c
no longer call /user to verify tokens
2021-08-03 14:50:07 -07:00
Tyler Leonhardt
c7e45c4fa4
Add a bunch of logging to github-authentication
...
Co-authored-by: Eric Amodio <eamodio@users.noreply.github.com >
2021-07-23 15:28:06 -07:00
Tyler Leonhardt
c1b4cf00b9
update auth extensions to use packageJSON property instead
2021-07-23 11:48:39 -07:00
Tyler Leonhardt
a8134002cd
lazily load experimentation service in github-authentication
2021-07-23 09:07:41 -07:00
Tyler Leonhardt
54a2e15f6b
remove unused variable
2021-07-22 17:40:13 -07:00
Tyler Leonhardt
3ed425bef9
Rework github authentication extension to make less HTTP requests.
...
Co-authored-by: Eric Amodio <eamodio@users.noreply.github.com >
2021-07-22 17:25:59 -07:00
VocalTrance
715798221b
Fix typo in github-authentication/github.ts ( #129100 )
2021-07-21 06:30:45 -07:00
Tyler James Leonhardt
87d692b7bf
Add scopes property to login telemetry ( #128261 )
...
* Add scopes property to login telemetry
2021-07-08 21:48:44 -07:00
Tyler Leonhardt
1d1b9961d7
sort scopes on filter for getSessions in the github auth provider. Fixes https://github.com/github/codespaces/issues/3109
2021-06-30 10:15:24 -07:00
Tyler Leonhardt
4a011b5297
add additional logging around github auth
2021-06-28 16:27:52 -07:00
Oleg Demchenko
61f34055fa
Auth session API fix ( #125792 )
...
* Adjust "provider is not registered" exception behavior
* Process cancellation in GH auth provider
`e.message` is always `undefined`
2021-06-10 20:14:08 +00:00
Matvii Hodovaniuk
67561036cf
Replace map with forEach ( #115378 )
...
The callback provided to the map call on this array should return a value, otherwise map will always return an array of undefined values. If the desired behaviour is to just iterate through all elements, then consider using forEach or a for-of loop instead.
2021-06-07 11:01:10 -07:00
Tyler Leonhardt
e0c8a76b7a
don't sort scope list. Fixes Microsoft/vscode-pull-request-github#2751
2021-05-27 16:45:59 -07:00
Kevin Abel
4978a1891e
Implement GitHub Enterprise authn provider ( #115940 )
2021-05-07 14:13:11 -07:00
Rachel Macfarlane
94589129a2
Add experimentation service to github auth extension
2021-04-20 09:25:01 -07:00
Rachel Macfarlane
2f277cb41e
Add github session telemetry event
2021-02-12 15:39:04 -08:00
Rachel Macfarlane
14669c2e45
Make scopes parameter optional to getSessions and remove getAllSessions
2021-02-12 09:13:11 -08:00
Rachel Macfarlane
eceff53351
Rename login/logout to createSession/removeSession
2021-02-11 16:46:47 -08:00
Rachel Macfarlane
650906c369
Pass scopes through to authentication providers
2021-02-11 14:15:36 -08:00
Rachel Macfarlane
9118a3461c
Make onDidChangeSessions event for auth providers fire complete session
2021-02-11 10:14:28 -08:00
Rachel Macfarlane
ced3bb4bb9
Secrets API feedback
2021-01-05 10:17:05 -08:00
Rachel Macfarlane
998e5e2ea6
onDidChangePassword -> onDidChange in secrets API
2021-01-04 22:20:07 -08:00
Rachel Macfarlane
7db413d4c1
Move secrets API to extension context
2021-01-04 22:04:40 -08:00
Rachel Macfarlane
03c38e6702
Add more logging to github auth provider
2020-11-06 15:10:09 -08:00
Rachel Macfarlane
928e79f838
Verify GitHub tokens on auth provider start, fixes #108680
2020-10-26 16:01:58 -07:00
Rachel Macfarlane
31419adc34
Polish onDidChangePassword changes
2020-10-12 10:31:16 -07:00
Rachel Macfarlane
4c0811c9c2
Removing polling from auth extensions, fixes #107480
2020-10-09 16:33:53 -07:00