Welcome to mirror list, hosted at ThFree Co, Russian Federation.

configuration.rb « bulk_imports « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3b263ed03402d75eec8863bb6068cc0e58288262 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

# Stores the authentication data required to access another GitLab instance on
# behalf of a user, to import Groups and Projects directly from that instance.
class BulkImports::Configuration < ApplicationRecord
  self.table_name = 'bulk_import_configurations'

  belongs_to :bulk_import, inverse_of: :configuration, optional: false

  validates :url, :access_token, length: { maximum: 255 }, presence: true
  validates :url, public_url: { schemes: %w[http https], enforce_sanitization: true, ascii_only: true },
                  allow_nil: true

  attr_encrypted :url,
    key: Settings.attr_encrypted_db_key_base_32,
    mode: :per_attribute_iv,
    algorithm: 'aes-256-gcm'
  attr_encrypted :access_token,
    key: Settings.attr_encrypted_db_key_base_32,
    mode: :per_attribute_iv,
    algorithm: 'aes-256-gcm'
end