Extract JsonWebToken type into library

Problem

We currently maintain two independent implementations of what a Cloud Connector JWT is:

They ultimately serve the same purpose: building and signing a JSON Web Token given a key. There is no need for us to maintain two types, and if we want to later reconcile token issuance in general, all token issuers should work off of the same implementation.

Moreover the CDot type is currently shared with other CDot use cases, which can lead to friction.

Proposal

  • Create a new JsonWebToken type in the gitlab-cloud-connector Ruby library.
  • Replace SelfIssuedToken in gitlab-rails with this type entirely.
  • Make Cloud Connector code paths use the new type in CDot. Retain existing type for CDot-specific use cases.
Edited by Matthias Käppler