##// END OF EJS Templates
ssh: improve logging, and make the UI show last accessed date for key.
marcink -
r2973:40c25cc7 default
parent child Browse files
Show More
@@ -62,7 +62,8 b' class SshWrapper(object):'
62 62 key.accessed_on = datetime.datetime.utcnow()
63 63 Session().add(key)
64 64 Session().commit()
65 log.debug('Update key `%s` access time', key_id)
65 log.debug('Update key id:`%s` fingerprint:`%s` access time',
66 key_id, key.ssh_key_fingerprint)
66 67
67 68 def get_connection_info(self):
68 69 """
@@ -70,6 +70,11 b' class VcsServer(object):'
70 70 'permission for %s on %s are: %s',
71 71 self.user, self.repo_name, permission)
72 72
73 if not permission:
74 log.error('user `%s` permissions to repo:%s are empty. Forbidding access.',
75 self.user, self.repo_name)
76 return -2
77
73 78 if action == 'pull':
74 79 if permission in self.read_perms:
75 80 log.info(
@@ -83,8 +88,8 b' class VcsServer(object):'
83 88 self.user, self.repo_name)
84 89 return 0
85 90
86 log.error('Cannot properly fetch or allow user %s permissions. '
87 'Return value is: %s, req action: %s',
91 log.error('Cannot properly fetch or verify user `%s` permissions. '
92 'Permissions: %s, vcs action: %s',
88 93 self.user, permission, action)
89 94 return -2
90 95
@@ -8,7 +8,8 b''
8 8 <tr>
9 9 <th>${_('Fingerprint')}</th>
10 10 <th>${_('Description')}</th>
11 <th>${_('Created')}</th>
11 <th>${_('Created on')}</th>
12 <th>${_('Accessed on')}</th>
12 13 <th>${_('Action')}</th>
13 14 </tr>
14 15 % if not c.ssh_enabled:
@@ -22,6 +23,7 b''
22 23 </td>
23 24 <td class="td-wrap">${ssh_key.description}</td>
24 25 <td class="td-tags">${h.format_date(ssh_key.created_on)}</td>
26 <td class="td-tags">${h.format_date(ssh_key.accessed_on)}</td>
25 27
26 28 <td class="td-action">
27 29 ${h.secure_form(h.route_path('my_account_ssh_keys_delete'), request=request)}
@@ -8,7 +8,8 b''
8 8 <tr>
9 9 <th>${_('Fingerprint')}</th>
10 10 <th>${_('Description')}</th>
11 <th>${_('Created')}</th>
11 <th>${_('Created on')}</th>
12 <th>${_('Accessed on')}</th>
12 13 <th>${_('Action')}</th>
13 14 </tr>
14 15 %if c.user_ssh_keys:
@@ -19,6 +20,7 b''
19 20 </td>
20 21 <td class="td-wrap">${ssh_key.description}</td>
21 22 <td class="td-tags">${h.format_date(ssh_key.created_on)}</td>
23 <td class="td-tags">${h.format_date(ssh_key.accessed_on)}</td>
22 24
23 25 <td class="td-action">
24 26 ${h.secure_form(h.route_path('edit_user_ssh_keys_delete', user_id=c.user.user_id), request=request)}
General Comments 0
You need to be logged in to leave comments. Login now