3193: use sshkey gem to validate the ssh key passed in.
[arvados.git] / apps / workbench / app / views / users / _manage_ssh_keys.html.erb
index 5fcdd0e7ba4c1abfb0edc107d53329475b3ff4fd..e559356f72ea6c635c8961c4eb5492907223dbd0 100644 (file)
@@ -9,27 +9,33 @@
   <% end %>
 
   <% if @my_ssh_keys.andand.any? %>
-    <table class="table virtual-machines-table" style="table-layout:fixed; overflow:hidden; white-space: nowrap;">
+    <table class="table manage-ssh-keys-table">
       <colgroup>
-        <col style="width: 30%" />
-        <col style="width: 65%" />
-        <col style="width: 5%" />
+        <col style="width: 45%" />
+        <col style="width: 45%" />
+        <col style="width: 10%" />
       </colgroup>
       <thead>
         <tr>
           <th> Name </th>
-          <th> Public Key </th>
+          <th> Key Finger Print </th>
           <th> </th>
         </tr>
       </thead>
       <tbody>
         <% @my_ssh_keys.andand.each do |key| %>
-          <tr>
-            <td style="width:50px; overflow:hidden;">
+          <tr style="word-break:break-all;">
+            <td>
               <%= key[:name] %>
             </td>
-            <td style="width:100px; overflow:hidden;">
-              <%= key[:public_key] %>
+            <td style="word-break:break-all;">
+              <% if key[:public_key] && key[:public_key].size > 0 %>
+                <div>
+                  <%= SSHKey.fingerprint key[:public_key] %>
+                </div>
+              <% else %>
+                  <%= key[:public_key] %>
+              <% end %>
             </td>
             <td>
               <%= link_to(authorized_key_path(id: key[:uuid]), method: 'delete', class: 'btn btn-sm', data: {confirm: "Really delete key?"}) do %>