summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-07-03 15:30:22 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-07-13 12:10:26 +0200
commit1c57a4b92b66b91f4defd569666bed6f2d7a4428 (patch)
tree627a6e4f85ce39d1e0043888fd27b64ef6662529 /app/models
parent73e3a6ad5944a1b4ead4a6d6a5c3cee45a5449e1 (diff)
downloadgitlab-ci-1c57a4b92b66b91f4defd569666bed6f2d7a4428.tar.gz
Encrypt variables with attr_encrypted
Diffstat (limited to 'app/models')
-rw-r--r--app/models/variable.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/models/variable.rb b/app/models/variable.rb
index ebd3a44..76a2c65 100644
--- a/app/models/variable.rb
+++ b/app/models/variable.rb
@@ -2,12 +2,17 @@
#
# Table name: variables
#
-# id :integer not null, primary key
-# project_id :integer not null
-# key :string(255)
-# value :text
+# id :integer not null, primary key
+# project_id :integer not null
+# key :string(255)
+# value :text
+# encrypted_value :string(255)
+# encrypted_value_salt :string(255)
+# encrypted_value_iv :string(255)
#
class Variable < ActiveRecord::Base
belongs_to :project
+
+ attr_encrypted :value, mode: :per_attribute_iv_and_salt, key: GitlabCi::Application.config.secret_key_base
end