Draft: Add oauth to Web IDE
-
gitlab-web-ide
Spike MR for OAuth- Part 1 - refactor: Add AuthType to support OAuth (!247 - merged)
- Part 2 - refactor: Set up OAuthClient and oauthCallback ... (!250 - merged)
- Pre-Part 3 - feat: Add utils-crypto package (!252 - merged)
- Part 3 - feat: Implementing OAuthClient (!251 - merged)
- In Parallel:
- Logging - chore: Add minLogLevel to config (!257)
- Secret Storage Provider - feat: Add secretStorageProvider to workbench op... (!263 - merged)
- Broadcasting - feat: Add broadcaster to OAuth (!264 - merged)
- Extra - chore: Add logger package (!248 - merged)
gitlab
Spike MR
Description
This is the draft MR of adding oauth to the Web IDE. It will be split up into smaller MR's.
What all is going on here?
- Adds
Authentication Type
field to the example app which corresponds toauth.type
in the main config. - Adds
oauth-client
package to manage initializing and refreshing the oauth token. - Adds
secretStorageProvider
to the VSCode workbench options to expose theauth_headers
to GitLab VSCode extensions. This can be accessed usingcontext.secrets.get('auth_headers')
. - In the
gitlab-api-client
, theauthHeaders
option is replaced with anauthProvider
. TheauthProvider
is called every time we need headers. If we're using oauth, this means we can choose to refresh if needed. - Adds a decorator for broadcasting oauth changes to other tabs.
How to test?
Follow the instructions in this documentation:
Screenshots
Description | Screenshot |
---|---|
Demo | 20231001_web_ide_example_demo |
New Authentication Type field in example app config |
![]() |
OAuth handshake screen in example app | ![]() |
Edited by Paul Slaughter