More strict validation for SSH Key content
This commit is contained in:
parent
6e1ee1fea6
commit
5b5ff7708b
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue