debian-mirror-gitlab/lib/atlassian/jira_connect.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
725 B
Ruby
Raw Permalink Normal View History

2020-11-24 15:15:51 +05:30
# frozen_string_literal: true
module Atlassian
module JiraConnect
class << self
def app_name
"GitLab for Jira (#{gitlab_host})"
end
def app_key
2022-05-07 20:08:51 +05:30
# App key must be <= 64 characters.
# See: https://developer.atlassian.com/cloud/jira/platform/connect-app-descriptor/#app-descriptor-structure
"gitlab-jira-connect-#{gitlab_host}"[..63]
2020-11-24 15:15:51 +05:30
end
private
def gitlab_host
2023-03-04 22:38:38 +05:30
return host_from_settings if Gitlab::CurrentSettings.jira_connect_proxy_url?
2020-11-24 15:15:51 +05:30
Gitlab.config.gitlab.host
end
2023-03-04 22:38:38 +05:30
def host_from_settings
uri = URI(Gitlab::CurrentSettings.jira_connect_proxy_url)
uri.hostname + uri.path
end
2020-11-24 15:15:51 +05:30
end
end
end