Skip to content

Draft: Add oauth to Web IDE

Paul Slaughter requested to merge ps-oauth into main

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 to auth.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 the auth_headers to GitLab VSCode extensions. This can be accessed using context.secrets.get('auth_headers').
  • In the gitlab-api-client, the authHeaders option is replaced with an authProvider. The authProvider 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:

https://gitlab.com/gitlab-org/gitlab-web-ide/-/blob/7ff05919a11822ddb52b4aac204c963608f77cf8/docs/dev/development_environment_setup.md#setup-example-app-with-oauth-to-local-gdk

Screenshots

Description Screenshot
Demo 20231001_web_ide_example_demo
New Authentication Type field in example app config Screenshot_2023-09-29_at_2.53.55_PM
OAuth handshake screen in example app Screenshot_2023-09-29_at_2.55.38_PM
Edited by Paul Slaughter

Merge request reports