refactor: Move getHeaders out of AuthProvider
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:
- Start Web IDE example app with
yarn run start:example
. - Visit Web IDE example app at
localhost:8000
. - Set Authentication Type to
None
and start the Web IDE. Click on some files in the file tree. Files should open with their content. - Set Authentication Type to
OAuth
orToken
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:
Edited by Paul Slaughter