diff options
Diffstat (limited to 'app/models/bulk_imports/configuration.rb')
-rw-r--r-- | app/models/bulk_imports/configuration.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/models/bulk_imports/configuration.rb b/app/models/bulk_imports/configuration.rb new file mode 100644 index 00000000000..8c3aff6f749 --- /dev/null +++ b/app/models/bulk_imports/configuration.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +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_truncated, + mode: :per_attribute_iv, + algorithm: 'aes-256-gcm' + attr_encrypted :access_token, + key: Settings.attr_encrypted_db_key_base_truncated, + mode: :per_attribute_iv, + algorithm: 'aes-256-gcm' +end |