Skip to content

refactor: Move getHeaders out of AuthProvider

Paul Slaughter requested to merge ps-refactor-get-headers-from-auth-provider into main

Issue: #310 (closed)

Description

  • The config contains the information needed to determine what kind of header needs to be used with the token.
  • Let's introduce some helpful methods for transforming an AuthProvider into an AuthHeadersProvider that can be used when creating the GitLabClient
  • This will help us implement AuthProvider in the extension so that we don't have to worry about implementing headers

How to test

No changes expected. Just test around:

  1. Start Web IDE example app with yarn run start:example.
  2. Visit Web IDE example app at localhost:8000.
  3. Set Authentication Type to None and start the Web IDE. Click on some files in the file tree. Files should open with their content.
  4. Set Authentication Type to OAuth or Token and start the Web IDE. Files should open, changes and commits can be made.

Screenshots

No changes. Everything should still work:

web_ide_headers_refactor_works

I also tested this in integration and everything works:

Screenshot_2024-04-03_at_2.42.07_PM

Edited by Paul Slaughter

Merge request reports