Skip to content

Draft: WIP: Fetch and use JWT for code suggestions

Matthias Käppler requested to merge mk-cs-jwt-poc into main

Not to be merged.

This is just a POC where I try to hack in support for using a JWT obtained from a self-managed instance which is then used to fetch code suggestions from the model gateway. This is to unblock my team to have an end-to-end integrated solution for &10528 (closed)

The IDE team will provider a proper/clean solution to this some time around June/July as part of the extension integration effort.

Problems we need to solve in any of these solutions:

  • The user provides a PAT, which then needs to be used to obtain a JWT from the connected GitLab instance.
  • Both tokens are required: the JWT is only used to fetch suggestions from the code suggest model gateway for now. This is necessary because it is operated by GitLab Inc. The PAT is used for all other requests to the connected GitLab instance (SM or SaaS).
  • The JWT expires every 1 hour, which means we need to refresh it in case the model gateway returns a 401. This should happen transparently and not require additional user input.
Edited by Matthias Käppler

Merge request reports