summaryrefslogtreecommitdiff
path: root/lib/atlassian/jira_connect.rb
blob: 595cf0ac465ccd2286e324012ff1679b55c8923f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module Atlassian
  module JiraConnect
    class << self
      def app_name
        "GitLab for Jira (#{gitlab_host})"
      end

      def app_key
        # 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]
      end

      private

      def gitlab_host
        Gitlab.config.gitlab.host
      end
    end
  end
end