whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [3/3] Commit 7649d20: ssh public keys
Date Wed, 02 Mar 2016 20:30:00 GMT
Commit 7649d2089febd949f2c69f902b0f0f277bafae1f:
    ssh public keys


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
lib/whimsy/asf/ldap.rb                                       | ++++ 
www/roster/models/committer.rb                               | +++++ -
www/roster/public/stylesheets/app.css                        | +++ 
www/roster/views/committer.js.rb                             | +++++++++++++ 
------------------------------------------------------------
26 changes: 25 additions, 1 deletions.
------------------------------------------------------------


diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index 9b32733..8fac25c 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -352,6 +352,10 @@ def pgp_key_fingerprints
       attrs['asf-pgpKeyFingerprint'] || []
     end
 
+    def ssh_public_keys
+      attrs['sshPublicKey'] || []
+    end
+
     def urls
       attrs['asf-personalURL'] || []
     end
diff --git a/www/roster/models/committer.rb b/www/roster/models/committer.rb
index 3e354b9..4283a88 100644
--- a/www/roster/models/committer.rb
+++ b/www/roster/models/committer.rb
@@ -25,10 +25,14 @@ def self.serialize(id, env)
 
     response[:mail] = person.all_mail
 
-    if person.pgp_key_fingerprints and not person.pgp_key_fingerprints.empty?
+    unless person.pgp_key_fingerprints.empty?
       response[:pgp] = person.pgp_key_fingerprints 
     end
 
+    unless person.ssh_public_keys.empty?
+      response[:ssh] = person.ssh_public_keys
+    end
+
     if person.attrs['asf-sascore']
       response[:sascore] = person.attrs['asf-sascore'].first
     end
diff --git a/www/roster/public/stylesheets/app.css b/www/roster/public/stylesheets/app.css
index a2a91c4..81ff9c4 100644
--- a/www/roster/public/stylesheets/app.css
+++ b/www/roster/public/stylesheets/app.css
@@ -48,3 +48,6 @@ button.btn {margin: 0 8px}
 #main > span > ul {
   margin-top: 1em;
 }
+
+pre.wide {padding: 0 8px; width: 60em; overflow-x: hidden; margin: 6px 0}
+pre.wide:hover {overflow-x: scroll}
diff --git a/www/roster/views/committer.js.rb b/www/roster/views/committer.js.rb
index 7240def..6570116 100644
--- a/www/roster/views/committer.js.rb
+++ b/www/roster/views/committer.js.rb
@@ -124,6 +124,19 @@ def render
         end
       end
 
+      if @committer.ssh
+        _tr do
+          _td 'SSH keys'
+          _td do
+            _ul @committer.ssh do |key|
+              _li.ssh do
+                _pre.wide key
+              end
+            end
+          end
+        end
+      end
+
       if @committer.githubUsername
         _tr do
           _td 'GitHub username'

Mime
View raw message