diff options
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 62208d838c1..c9152128638 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -17,7 +17,7 @@ class UsersController < ApplicationController skip_before_action :authenticate_user! prepend_before_action(only: [:show]) { authenticate_sessionless_user!(:rss) } - before_action :user, except: [:exists, :suggests] + before_action :user, except: [:exists, :suggests, :ssh_keys] before_action :authorize_read_user_profile!, only: [:calendar, :calendar_activities, :groups, :projects, :contributed, :starred, :snippets] @@ -41,7 +41,12 @@ class UsersController < ApplicationController # Get all keys of a user(params[:username]) in a text format # Helpful for sysadmins to put in respective servers + # + # Uses `UserFinder` rather than `find_routable!` because this endpoint should + # be publicly available regardless of instance visibility settings. def ssh_keys + user = UserFinder.new(params[:username]).find_by_username + render plain: user.all_ssh_keys.join("\n") end |