diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-01-09 10:30:49 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-01-09 10:30:49 +0000 |
commit | cb4964d23b49f775ad3c8aa562942911b6b1c262 (patch) | |
tree | cb8af8e74102d709c40e1119b000e0f8ae1419b9 /lib | |
parent | fb5ded7d8ef32177e51af047e4dafbc3ed9c6abb (diff) | |
parent | b6df93a51f90c7ed29ce6667c6b1a8debf02506e (diff) | |
download | gitlab-ce-cb4964d23b49f775ad3c8aa562942911b6b1c262.tar.gz |
Merge branch 'track_last_used_date_of_ssh_keys' into 'master'
Record and show last used date of SSH Keys
See merge request !8113
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/internal.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index db2d18f935d..d235977fbd8 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -28,6 +28,8 @@ module API protocol = params[:protocol] + actor.update_last_used_at if actor.is_a?(Key) + access = if wiki? Gitlab::GitAccessWiki.new(actor, project, protocol, authentication_abilities: ssh_authentication_abilities) @@ -61,6 +63,8 @@ module API status 200 key = Key.find(params[:key_id]) + key.update_last_used_at + token_handler = Gitlab::LfsToken.new(key) { @@ -103,7 +107,9 @@ module API key = Key.find_by(id: params[:key_id]) - unless key + if key + key.update_last_used_at + else return { 'success' => false, 'message' => 'Could not find the given key' } end |