Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-01-09 13:30:49 +0300
committerSean McGivern <sean@mcgivern.me.uk>2017-01-09 13:30:49 +0300
commitcb4964d23b49f775ad3c8aa562942911b6b1c262 (patch)
treecb8af8e74102d709c40e1119b000e0f8ae1419b9 /lib/api
parentfb5ded7d8ef32177e51af047e4dafbc3ed9c6abb (diff)
parentb6df93a51f90c7ed29ce6667c6b1a8debf02506e (diff)
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/api')
-rw-r--r--lib/api/internal.rb8
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