diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-28 15:09:17 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-28 15:09:17 +0000 |
commit | 1bb7f81e238569fd0fe2b0c4385f1015407a2d59 (patch) | |
tree | 768c7d44fa3ed641a7e26fdf9db61422902e8294 /app/controllers/jira_connect | |
parent | eb3a23aaaa99ef8ae08c7b440fad676e3c71a1af (diff) | |
download | gitlab-ce-1bb7f81e238569fd0fe2b0c4385f1015407a2d59.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/jira_connect')
-rw-r--r-- | app/controllers/jira_connect/public_keys_controller.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/controllers/jira_connect/public_keys_controller.rb b/app/controllers/jira_connect/public_keys_controller.rb new file mode 100644 index 00000000000..b3144993edb --- /dev/null +++ b/app/controllers/jira_connect/public_keys_controller.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module JiraConnect + class PublicKeysController < ::ApplicationController + # This is not inheriting from JiraConnect::Application controller because + # it doesn't need to handle JWT authentication. + + feature_category :integrations + + skip_before_action :authenticate_user! + + def show + return render_404 if Feature.disabled?(:jira_connect_oauth_self_managed) || !Gitlab.com? + + render plain: public_key.key + end + + private + + def public_key + JiraConnect::PublicKey.find(params[:id]) + end + end +end |