Skip to content
Snippets Groups Projects
Commit a06d9a49 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

More strict validation for SSH Key content

parent e36372ef
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -23,7 +23,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
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment