diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-13 11:59:30 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-13 11:59:30 +0300 |
commit | 5b5ff7708be0eb896aca0eb203a38663242da08b (patch) | |
tree | 222011db4138191d6abc24522ddf2b5aabecc0bb /app/models/key.rb | |
parent | 6e1ee1fea6400c3621005f1b79e1b8dab43cd000 (diff) | |
download | gitlab-ce-5b5ff7708be0eb896aca0eb203a38663242da08b.tar.gz |
More strict validation for SSH Key content
Diffstat (limited to 'app/models/key.rb')
-rw-r--r-- | app/models/key.rb | 2 |
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 |