summaryrefslogtreecommitdiff
path: root/app/graphql/types/ci/job_token_scope_type.rb
blob: 639bbaa22afd32d89da3fe7598d822245b95ec59 (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
# frozen_string_literal: true

module Types
  # rubocop: disable Graphql/AuthorizeTypes
  # Authorization is in the resolver based on the parent project
  module Ci
    class JobTokenScopeType < BaseObject
      graphql_name 'CiJobTokenScopeType'

      field :projects,
            Types::ProjectType.connection_type,
            null: false,
            description: 'Allow list of projects that can be accessed by CI Job tokens created by this project.',
            method: :outbound_projects,
            deprecated: {
              reason: 'The `projects` attribute is being deprecated. Use `outbound_allowlist`',
              milestone: '15.9'
            }

      field :outbound_allowlist,
            Types::ProjectType.connection_type,
            null: false,
            description: "Allow list of projects that are accessible using the current project's CI Job tokens.",
            method: :outbound_projects

      field :inbound_allowlist,
            Types::ProjectType.connection_type,
            null: false,
            description: "Allow list of projects that can access the current project through its CI Job tokens.",
            method: :inbound_projects
    end
  end
  # rubocop: enable Graphql/AuthorizeTypes
end