Authentication: Authenticate Code Suggestions WebIDE to Model Gateway

Problem

WebIDE has to authenticate to Model Gateway. We decided to go with Option 2 from Code suggestions: Get a token and send it to mo... (#141 - closed).

The lock highlighted in #e9967a is part of this MR.

Solution

  1. Using the mediator command to get JWT token from code_suggestions/tokens GitLab v4 API
  2. Disable the code suggestions feature if the user isn't authorized to use it
  3. Use the JWT token to authenticate to Model Gateway
  4. Refresh the token when it expires.

References

  1. Discussion !147 (comment 1308585839)
Edited by Mon Ray