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
- The client (Desktop extension will call SM instance API call /api/v4/code_suggestions/tokens with SM user PAT
- SM user will be authenticated/authorized on SM instance
- If SM user can use code_suggestions, we will proxy the call using Workhorse send_url to SaaS with preconfigured SM admin token
- SM admin token will be authenticated/authorized on SaaS
- 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