Allow ecdsa SSH keys

Update app/models/key.rb to permit SSH keys of type ecdsa rather than forcing dsa and rsa algorithms.
This commit is contained in:
Akiva Levy 2013-07-10 15:19:52 -07:00
parent 0d285c1cb1
commit 88301d5695

View file

@ -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: /\Assh-.*\Z/ }, uniqueness: true
validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\A(ssh|ecdsa)-.*\Z/ }, uniqueness: true
validate :fingerprintable_key
delegate :name, :email, to: :user, prefix: true