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

app_descriptor_controller.rb « jira_connect « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bf53c61601b9c80ad4b613f276ed15cc6b813901 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# frozen_string_literal: true

# This returns an app descriptor for use with Jira in development mode
# For the Atlassian Marketplace, a static copy of this JSON is uploaded to the marketplace
# https://developer.atlassian.com/cloud/jira/platform/app-descriptor/

class JiraConnect::AppDescriptorController < JiraConnect::ApplicationController
  skip_before_action :verify_atlassian_jwt!

  def show
    render json: {
      name: Atlassian::JiraConnect.app_name,
      description: 'Integrate commits, branches and merge requests from GitLab into Jira',
      key: Atlassian::JiraConnect.app_key,
      baseUrl: jira_connect_base_url(protocol: 'https'),
      lifecycle: {
        installed: relative_to_base_path(jira_connect_events_installed_path),
        uninstalled: relative_to_base_path(jira_connect_events_uninstalled_path)
      },
      vendor: {
        name: 'GitLab',
        url: 'https://gitlab.com'
      },
      links: {
        documentation: help_page_url('integration/jira_development_panel', anchor: 'gitlabcom-1')
      },
      authentication: {
        type: 'jwt'
      },
      scopes: %w(READ WRITE DELETE),
      apiVersion: 1,
      modules: {
        jiraDevelopmentTool: {
          key: 'gitlab-development-tool',
          application: {
            value: 'GitLab'
          },
          name: {
            value: 'GitLab'
          },
          url: 'https://gitlab.com',
          logoUrl: view_context.image_url('gitlab_logo.png'),
          capabilities: %w(branch commit pull_request)
        },
        postInstallPage: {
          key: 'gitlab-configuration',
          name: {
            value: 'GitLab Configuration'
          },
          url: relative_to_base_path(jira_connect_subscriptions_path)
        }
      },
      apiMigrations: {
        gdpr: true
      }
    }
  end

  private

  def relative_to_base_path(full_path)
    full_path.sub(/^#{jira_connect_base_path}/, '')
  end
end