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

web_hook.rb « encrypt_columns « models « background_migration « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bb76eb8ed480bdda7de9adb9afe265eed62be102 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

module Gitlab
  module BackgroundMigration
    module Models
      module EncryptColumns
        # This model is shared between synchronous and background migrations to
        # encrypt the `token` and `url` columns
        class WebHook < ActiveRecord::Base
          include ::EachBatch

          self.table_name = 'web_hooks'
          self.inheritance_column = :_type_disabled

          attr_encrypted :token,
                         mode:      :per_attribute_iv,
                         algorithm: 'aes-256-gcm',
                         key:       Settings.attr_encrypted_db_key_base_truncated

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