Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
36e4616d45ab
Commit
5b5ff770
authored
May 13, 2013
by
Dmitriy Zaporozhets
Browse files
More strict validation for SSH Key content
parent
b3565a2e2aea
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/models/key.rb
View file @
36e4616d
...
...
@@ -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:
/
\A
ssh-.
*\Z
/
},
uniqueness:
true
validate
:fingerprintable_key
delegate
:name
,
:email
,
to: :user
,
prefix:
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment