2020-10-15 11:08:45 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-10-20 11:08:57 -04:00
|
|
|
# Stores the authentication data required to access another GitLab instance on
|
|
|
|
# behalf of a user, to import Groups and Projects directly from that instance.
|
2020-10-15 11:08:45 -04:00
|
|
|
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,
|
2021-04-22 17:09:53 -04:00
|
|
|
key: Settings.attr_encrypted_db_key_base_32,
|
2020-10-15 11:08:45 -04:00
|
|
|
mode: :per_attribute_iv,
|
|
|
|
algorithm: 'aes-256-gcm'
|
|
|
|
attr_encrypted :access_token,
|
2021-04-22 17:09:53 -04:00
|
|
|
key: Settings.attr_encrypted_db_key_base_32,
|
2020-10-15 11:08:45 -04:00
|
|
|
mode: :per_attribute_iv,
|
|
|
|
algorithm: 'aes-256-gcm'
|
|
|
|
end
|