summaryrefslogtreecommitdiff
path: root/app/models/key.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-05-13 11:59:30 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-05-13 11:59:30 +0300
commit5b5ff7708be0eb896aca0eb203a38663242da08b (patch)
tree222011db4138191d6abc24522ddf2b5aabecc0bb /app/models/key.rb
parent6e1ee1fea6400c3621005f1b79e1b8dab43cd000 (diff)
downloadgitlab-ce-5b5ff7708be0eb896aca0eb203a38663242da08b.tar.gz
More strict validation for SSH Key content
Diffstat (limited to 'app/models/key.rb')
-rw-r--r--app/models/key.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/key.rb b/app/models/key.rb
index a72357a6d01..185aef46e9e 100644
--- a/app/models/key.rb
+++ b/app/models/key.rb
@@ -22,7 +22,7 @@ class Key < ActiveRecord::Base
before_validation :strip_white_space
validates :title, presence: true, length: { within: 0..255 }
- validates :key, presence: true, length: { within: 0..5000 }, format: { with: /ssh-.{3} / }, uniqueness: true
+ validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\Assh-.*\Z/ }, uniqueness: true
validate :fingerprintable_key
delegate :name, :email, to: :user, prefix: true