gitlab-cloud-connector (Ruby)
Ruby gem containing shared code for Cloud Connector token issuers (GitLab, CustomersDot).
Usage
We expect Bundler is used to manage dependencies. To add the dependency, add it to Gemfile
:
gem "gitlab-cloud-connector", "~> 1.0.0", require: 'gitlab/cloud_connector'
Data Storage
Cloud Connector uses YAML files stored in the project's /config
directory. The data is organized by model type:
name: ai_gateway
description: "AI Gateway"
jwt_aud: gitlab-ai-gateway
name: duo_pro
description: "Duo Pro"
name: duo_chat
description: "Duo Chat"
backend_services:
- ai_gateway
add_ons:
- duo_pro
- duo_enterprise
Working with DataModels
DataModels
are the core data structures in the Cloud Connector. Each model inherits from DataModel::Base
. The data is loaded from YAML files into memory at runtime, making it efficient for read operations and relationship traversal.
require 'gitlab/cloud_connector'
duo_chat = Gitlab::CloudConnector::DataModels::UnitPrimitive.find_by_name(:duo_chat)
duo_chat.description
duo_chat.cut_off_date
duo_chat.add_ons
duo_chat.license_types
duo_chat.backend_services
duo_chat.backend_services.map(&:jwt_aud)
Release Process
See Release Process
Once the new gem version is visible on RubyGems.org,
it is recommended to update GitLab's Gemfile
and Customers Dot's Gemfile
to bump the gitlab-cloud-connector
Ruby gem to the new version also. See Usage for how to do this.