summaryrefslogtreecommitdiff
path: root/app/models/key.rb
diff options
context:
space:
mode:
authorKeith Pope <mute.pop3+gitlab@gmail.com>2016-08-02 06:56:23 +0100
committerKeith Pope <mute.pop3+gitlab@gmail.com>2016-08-02 06:56:23 +0100
commit4768afbdbf85abbb5e2281c8855e7d27c07a581e (patch)
tree457ef4821e5095080a797be1d2733d00ed6c2cf3 /app/models/key.rb
parente299504b798c053817f1c866649542ac0c779924 (diff)
downloadgitlab-ce-4768afbdbf85abbb5e2281c8855e7d27c07a581e.tar.gz
Add simple identifier to public SSH keys
Diffstat (limited to 'app/models/key.rb')
-rw-r--r--app/models/key.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/key.rb b/app/models/key.rb
index b9bc38a0436..568a60b8af3 100644
--- a/app/models/key.rb
+++ b/app/models/key.rb
@@ -26,8 +26,9 @@ class Key < ActiveRecord::Base
end
def publishable_key
- # Removes anything beyond the keytype and key itself
- self.key.split[0..1].join(' ')
+ # Strip out the keys comment so we don't leak email addresses
+ # Replace with simple ident of user_name (hostname)
+ self.key.split[0..1].push("#{self.user_name} (#{Gitlab.config.gitlab.host})").join(' ')
end
# projects that has this key