Skip to content

Proxy CodeSuggestions Tokens API for Self Managed users to SaaS

In !120892 (merged) we introduced an API to create a JWT access token for Code Suggestions. This token will be used by the client, i.e. Desktop Gitlab Workflow extension to request access to generate code suggestions.

  • Pre-requisite steps:
    • SM admin needs to create an account on GitLab.com
    • SM admin needs to create a PaT which will be configured with all needed permissions
    • SM admin token will be set using ENV variable for Self-managed instance

Proposal

  1. The client (Desktop extension will call SM instance API call /api/v4/code_suggestions/tokens with SM user PAT
  2. SM user will be authenticated/authorized on SM instance
  3. If SM user can use code_suggestions, we will proxy the call using Workhorse send_url to SaaS with preconfigured SM admin token
  4. SM admin token will be authenticated/authorized on SaaS
  5. If SM admin is eligible to use code_suggestions, it will create and return back a JWT access token for Code Suggestions.
Edited by Nikola Milojevic