diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-13 13:26:31 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-13 13:26:31 +0000 |
commit | b7dfe2ae4054aa40e15182fd3c6cb7dd39f131db (patch) | |
tree | 5ab080ca9cadeb6cd9578bf301e4e9e8810bed9e /lib/api | |
parent | 25cb337cf12438169f1b14bc5dace8a06a7356e3 (diff) | |
download | gitlab-ce-b7dfe2ae4054aa40e15182fd3c6cb7dd39f131db.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api')
34 files changed, 64 insertions, 1 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb index 3bf16dc41d2..d71f0c38ce6 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -182,3 +182,5 @@ module API end end end + +API::API.prepend_if_ee('::EE::API::API') diff --git a/lib/api/api_guard.rb b/lib/api/api_guard.rb index af9b519ed9e..a3fa7cd5cf9 100644 --- a/lib/api/api_guard.rb +++ b/lib/api/api_guard.rb @@ -41,6 +41,7 @@ module API # Helper Methods for Grape Endpoint module HelperMethods + prepend_if_ee('EE::API::APIGuard::HelperMethods') # rubocop: disable Cop/InjectEnterpriseEditionModule include Gitlab::Auth::UserAuthFinders def find_current_user! diff --git a/lib/api/boards.rb b/lib/api/boards.rb index 4e31f74f18a..87818903705 100644 --- a/lib/api/boards.rb +++ b/lib/api/boards.rb @@ -5,6 +5,8 @@ module API include BoardsResponses include PaginationParams + prepend_if_ee('EE::API::BoardsResponses') # rubocop: disable Cop/InjectEnterpriseEditionModule + before { authenticate! } helpers do diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 312c8d5b548..53774d4db1a 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -1780,7 +1780,6 @@ module API end # rubocop: disable Cop/InjectEnterpriseEditionModule -API::Entities.prepend_if_ee('EE::API::Entities::Entities') ::API::Entities::ApplicationSetting.prepend_if_ee('EE::API::Entities::ApplicationSetting') ::API::Entities::Board.prepend_if_ee('EE::API::Entities::Board') ::API::Entities::Group.prepend_if_ee('EE::API::Entities::Group', with_descendants: true) diff --git a/lib/api/group_boards.rb b/lib/api/group_boards.rb index feb2254963e..f7ef0cfd0d8 100644 --- a/lib/api/group_boards.rb +++ b/lib/api/group_boards.rb @@ -5,6 +5,8 @@ module API include BoardsResponses include PaginationParams + prepend_if_ee('EE::API::BoardsResponses') # rubocop: disable Cop/InjectEnterpriseEditionModule + before do authenticate! end diff --git a/lib/api/group_clusters.rb b/lib/api/group_clusters.rb index db0f8081140..a70ac63cc6e 100644 --- a/lib/api/group_clusters.rb +++ b/lib/api/group_clusters.rb @@ -16,6 +16,8 @@ module API end end + prepend_if_ee('EE::API::GroupClusters') # rubocop: disable Cop/InjectEnterpriseEditionModule + params do requires :id, type: String, desc: 'The ID of the group' end diff --git a/lib/api/group_milestones.rb b/lib/api/group_milestones.rb index d4287e4a7c4..eae29f5b5dd 100644 --- a/lib/api/group_milestones.rb +++ b/lib/api/group_milestones.rb @@ -95,3 +95,5 @@ module API end end end + +API::GroupMilestones.prepend_if_ee('EE::API::GroupMilestones') diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 0b086f2e36d..4ae9b8c70d3 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -266,3 +266,5 @@ module API end end end + +API::Groups.prepend_if_ee('EE::API::Groups') diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index e61b25721fb..fad8bb13150 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -561,3 +561,5 @@ module API end end end + +API::Helpers.prepend_if_ee('EE::API::Helpers') diff --git a/lib/api/helpers/discussions_helpers.rb b/lib/api/helpers/discussions_helpers.rb index 94a5bf75c39..799d5582b38 100644 --- a/lib/api/helpers/discussions_helpers.rb +++ b/lib/api/helpers/discussions_helpers.rb @@ -11,3 +11,5 @@ module API end end end + +API::Helpers::DiscussionsHelpers.prepend_if_ee('EE::API::Helpers::DiscussionsHelpers') diff --git a/lib/api/helpers/groups_helpers.rb b/lib/api/helpers/groups_helpers.rb index 6af12828ca5..585ae1eb5c4 100644 --- a/lib/api/helpers/groups_helpers.rb +++ b/lib/api/helpers/groups_helpers.rb @@ -38,3 +38,5 @@ module API end end end + +API::Helpers::GroupsHelpers.prepend_if_ee('EE::API::Helpers::GroupsHelpers') diff --git a/lib/api/helpers/issues_helpers.rb b/lib/api/helpers/issues_helpers.rb index a8480bb9339..8addcd18fe3 100644 --- a/lib/api/helpers/issues_helpers.rb +++ b/lib/api/helpers/issues_helpers.rb @@ -65,3 +65,5 @@ module API end end end + +API::Helpers::IssuesHelpers.prepend_if_ee('EE::API::Helpers::IssuesHelpers') diff --git a/lib/api/helpers/notes_helpers.rb b/lib/api/helpers/notes_helpers.rb index f445834323d..8adfac346f6 100644 --- a/lib/api/helpers/notes_helpers.rb +++ b/lib/api/helpers/notes_helpers.rb @@ -134,3 +134,5 @@ module API end end end + +API::Helpers::NotesHelpers.prepend_if_ee('EE::API::Helpers::NotesHelpers') diff --git a/lib/api/helpers/project_snapshots_helpers.rb b/lib/api/helpers/project_snapshots_helpers.rb index 1b5dc281e38..13cec1bfd5c 100644 --- a/lib/api/helpers/project_snapshots_helpers.rb +++ b/lib/api/helpers/project_snapshots_helpers.rb @@ -3,6 +3,8 @@ module API module Helpers module ProjectSnapshotsHelpers + prepend_if_ee('::EE::API::Helpers::ProjectSnapshotsHelpers') # rubocop: disable Cop/InjectEnterpriseEditionModule + def authorize_read_git_snapshot! authenticated_with_full_private_access! end diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb index c1e7af33235..f247c722c44 100644 --- a/lib/api/helpers/projects_helpers.rb +++ b/lib/api/helpers/projects_helpers.rb @@ -111,3 +111,5 @@ module API end end end + +API::Helpers::ProjectsHelpers.prepend_if_ee('EE::API::Helpers::ProjectsHelpers') diff --git a/lib/api/helpers/protected_branches_helpers.rb b/lib/api/helpers/protected_branches_helpers.rb index 0fc6841d79a..970a3687214 100644 --- a/lib/api/helpers/protected_branches_helpers.rb +++ b/lib/api/helpers/protected_branches_helpers.rb @@ -11,3 +11,5 @@ module API end end end + +API::Helpers::ProtectedBranchesHelpers.prepend_if_ee('EE::API::Helpers::ProtectedBranchesHelpers') diff --git a/lib/api/helpers/resource_label_events_helpers.rb b/lib/api/helpers/resource_label_events_helpers.rb index 23574deb59b..423bd4e704b 100644 --- a/lib/api/helpers/resource_label_events_helpers.rb +++ b/lib/api/helpers/resource_label_events_helpers.rb @@ -11,3 +11,5 @@ module API end end end + +API::Helpers::ResourceLabelEventsHelpers.prepend_if_ee('EE::API::Helpers::ResourceLabelEventsHelpers') diff --git a/lib/api/helpers/runner.rb b/lib/api/helpers/runner.rb index 41ee34a8fdf..11631378137 100644 --- a/lib/api/helpers/runner.rb +++ b/lib/api/helpers/runner.rb @@ -3,6 +3,8 @@ module API module Helpers module Runner + prepend_if_ee('EE::API::Helpers::Runner') # rubocop: disable Cop/InjectEnterpriseEditionModule + JOB_TOKEN_HEADER = 'HTTP_JOB_TOKEN' JOB_TOKEN_PARAM = :token diff --git a/lib/api/helpers/search_helpers.rb b/lib/api/helpers/search_helpers.rb index 0e052e0e273..de8cbe62106 100644 --- a/lib/api/helpers/search_helpers.rb +++ b/lib/api/helpers/search_helpers.rb @@ -20,3 +20,5 @@ module API end end end + +API::Helpers::SearchHelpers.prepend_if_ee('EE::API::Helpers::SearchHelpers') diff --git a/lib/api/helpers/services_helpers.rb b/lib/api/helpers/services_helpers.rb index 422db5c7a50..607a498ffb2 100644 --- a/lib/api/helpers/services_helpers.rb +++ b/lib/api/helpers/services_helpers.rb @@ -739,3 +739,5 @@ module API end end end + +API::Helpers::ServicesHelpers.prepend_if_ee('EE::API::Helpers::ServicesHelpers') diff --git a/lib/api/helpers/settings_helpers.rb b/lib/api/helpers/settings_helpers.rb index 6441bb579ff..65aec6ae2e7 100644 --- a/lib/api/helpers/settings_helpers.rb +++ b/lib/api/helpers/settings_helpers.rb @@ -17,3 +17,5 @@ module API end end end + +API::Helpers::SettingsHelpers.prepend_if_ee('EE::API::Helpers::SettingsHelpers') diff --git a/lib/api/helpers/users_helpers.rb b/lib/api/helpers/users_helpers.rb index 56fd3c6602d..99eefc1cbb9 100644 --- a/lib/api/helpers/users_helpers.rb +++ b/lib/api/helpers/users_helpers.rb @@ -14,3 +14,5 @@ module API end end end + +API::Helpers::UsersHelpers.prepend_if_ee('EE::API::Helpers::UsersHelpers') diff --git a/lib/api/internal/base.rb b/lib/api/internal/base.rb index 087985d34b0..cde7b0e1eea 100644 --- a/lib/api/internal/base.rb +++ b/lib/api/internal/base.rb @@ -271,3 +271,5 @@ module API end end end + +API::Internal::Base.prepend_if_ee('EE::API::Internal::Base') diff --git a/lib/api/job_artifacts.rb b/lib/api/job_artifacts.rb index b35aa952f81..920938ad453 100644 --- a/lib/api/job_artifacts.rb +++ b/lib/api/job_artifacts.rb @@ -11,6 +11,8 @@ module API end end + prepend_if_ee('EE::API::JobArtifacts') # rubocop: disable Cop/InjectEnterpriseEditionModule + params do requires :id, type: String, desc: 'The ID of a project' end diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index 4c092f10729..f317ae717bd 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -33,6 +33,8 @@ module API ] end + prepend_if_ee('EE::API::MergeRequests') # rubocop: disable Cop/InjectEnterpriseEditionModule + helpers do # rubocop: disable CodeReuse/ActiveRecord def find_merge_requests(args = {}) diff --git a/lib/api/namespaces.rb b/lib/api/namespaces.rb index 77ecb3e7cde..c51417d2889 100644 --- a/lib/api/namespaces.rb +++ b/lib/api/namespaces.rb @@ -17,6 +17,8 @@ module API end end + prepend_if_ee('EE::API::Namespaces') # rubocop: disable Cop/InjectEnterpriseEditionModule + resource :namespaces do desc 'Get a namespaces list' do success Entities::Namespace diff --git a/lib/api/project_clusters.rb b/lib/api/project_clusters.rb index 4f093e9be08..45c800d7d1e 100644 --- a/lib/api/project_clusters.rb +++ b/lib/api/project_clusters.rb @@ -16,6 +16,8 @@ module API end end + prepend_if_ee('EE::API::ProjectClusters') # rubocop: disable Cop/InjectEnterpriseEditionModule + params do requires :id, type: String, desc: 'The ID of the project' end diff --git a/lib/api/project_milestones.rb b/lib/api/project_milestones.rb index 9ecbf37b49a..aebf7d5fae1 100644 --- a/lib/api/project_milestones.rb +++ b/lib/api/project_milestones.rb @@ -116,3 +116,5 @@ module API end end end + +API::ProjectMilestones.prepend_if_ee('EE::API::ProjectMilestones') diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 63bfa8db61c..74de9fcec68 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -533,3 +533,5 @@ module API end end end + +API::Projects.prepend_if_ee('EE::API::Projects') diff --git a/lib/api/protected_branches.rb b/lib/api/protected_branches.rb index 33dea25289a..ca75ee906ce 100644 --- a/lib/api/protected_branches.rb +++ b/lib/api/protected_branches.rb @@ -59,6 +59,7 @@ module API # rubocop: disable CodeReuse/ActiveRecord post ':id/protected_branches' do protected_branch = user_project.protected_branches.find_by(name: params[:name]) + if protected_branch conflict!("Protected branch '#{params[:name]}' already exists") end diff --git a/lib/api/search.rb b/lib/api/search.rb index 1cab1a97186..50f930c7c7c 100644 --- a/lib/api/search.rb +++ b/lib/api/search.rb @@ -123,3 +123,5 @@ module API end end end + +API::Search.prepend_if_ee('EE::API::Search') diff --git a/lib/api/services.rb b/lib/api/services.rb index bc77fae87fa..aa5354e20c3 100644 --- a/lib/api/services.rb +++ b/lib/api/services.rb @@ -162,3 +162,5 @@ module API end end end + +API::Services.prepend_if_ee('EE::API::Services') diff --git a/lib/api/settings.rb b/lib/api/settings.rb index acf03051a5b..e4ef507228b 100644 --- a/lib/api/settings.rb +++ b/lib/api/settings.rb @@ -187,3 +187,5 @@ module API end end end + +API::Settings.prepend_if_ee('EE::API::Settings') diff --git a/lib/api/validations/check_assignees_count.rb b/lib/api/validations/check_assignees_count.rb index 836ec936b31..451b14c623c 100644 --- a/lib/api/validations/check_assignees_count.rb +++ b/lib/api/validations/check_assignees_count.rb @@ -30,3 +30,5 @@ module API end end end + +API::Validations::CheckAssigneesCount.prepend_if_ee('EE::API::Validations::CheckAssigneesCount') |