Commit b3cc82e8 authored by Max Woolf's avatar Max Woolf

Merge branch 'mk_recategorize_endpoints_to_compliance' into 'master'

Move audit event endpoints to audit_events category

See merge request gitlab-org/gitlab!84274
parents cd60bc5d 85faaf39
......@@ -86,7 +86,7 @@ module EE
resource :groups, requirements: ::API::API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
desc 'Sync a group with LDAP.'
post ":id/ldap_sync" do
post ":id/ldap_sync", feature_category: :subgroups do
not_found! unless ::Gitlab::Auth::Ldap::Config.group_sync_enabled?
group = find_group!(params[:id])
......@@ -115,7 +115,7 @@ module EE
use :pagination
end
get '/' do
get '/', feature_category: :audit_events do
level = ::Gitlab::Audit::Levels::Group.new(group: user_group)
audit_events = AuditLogFinder.new(
level: level,
......@@ -131,7 +131,7 @@ module EE
params do
requires :audit_event_id, type: Integer, desc: 'The ID of the audit event'
end
get '/:audit_event_id' do
get '/:audit_event_id', feature_category: :audit_events do
level = ::Gitlab::Audit::Levels::Group.new(group: user_group)
# rubocop: disable CodeReuse/ActiveRecord, Rails/FindById
# This is not `find_by!` from ActiveRecord
......@@ -144,7 +144,7 @@ module EE
end
desc 'Restore a group.'
post ':id/restore' do
post ':id/restore', feature_category: :subgroups do
authorize! :admin_group, user_group
break not_found! unless user_group.licensed_feature_available?(:adjourned_deletion_for_projects_and_groups)
......@@ -172,7 +172,7 @@ module EE
use :pagination
end
# rubocop: disable CodeReuse/ActiveRecord
get ':id/provisioned_users' do
get ':id/provisioned_users', feature_category: :subgroups do
authorize! :maintainer_access, user_group
finder = ::Auth::ProvisionedUsersFinder.new(
......
......@@ -7,10 +7,10 @@ module API
before { authenticate_non_get! }
feature_category :subgroups
helpers Helpers::GroupsHelpers
feature_category :subgroups, ['/groups/:id/custom_attributes', '/groups/:id/custom_attributes/:key']
helpers do
params :statistics_params do
optional :statistics, type: Boolean, default: false, desc: 'Include project statistics'
......@@ -181,7 +181,7 @@ module API
use :group_list_params
use :with_custom_attributes
end
get do
get feature_category: :subgroups do
groups = find_groups(declared_params(include_missing: false), params[:id])
present_groups_with_pagination_strategies params, groups
end
......@@ -196,7 +196,7 @@ module API
use :optional_params
end
post do
post feature_category: :subgroups do
parent_group = find_group!(params[:parent_id]) if params[:parent_id].present?
if parent_group
authorize! :create_subgroup, parent_group
......@@ -229,7 +229,7 @@ module API
use :optional_update_params
use :optional_update_params_ee
end
put ':id' do
put ':id', feature_category: :subgroups do
group = find_group!(params[:id])
group.preload_shared_group_links
......@@ -249,7 +249,7 @@ module API
use :with_custom_attributes
optional :with_projects, type: Boolean, default: true, desc: 'Omit project details'
end
get ":id" do
get ":id", feature_category: :subgroups do
group = find_group!(params[:id])
group.preload_shared_group_links
......@@ -265,7 +265,7 @@ module API
end
desc 'Remove a group.'
delete ":id" do
delete ":id", feature_category: :subgroups do
group = find_group!(params[:id])
authorize! :admin_group, group
check_subscription! group
......@@ -300,7 +300,7 @@ module API
use :with_custom_attributes
use :optional_projects_params
end
get ":id/projects" do
get ":id/projects", feature_category: :subgroups do
finder_options = {
only_owned: !params[:with_shared],
include_subgroups: params[:include_subgroups],
......@@ -334,7 +334,7 @@ module API
use :pagination
use :with_custom_attributes
end
get ":id/projects/shared" do
get ":id/projects/shared", feature_category: :subgroups do
projects = find_group_projects(params, { only_shared: true })
present_projects(params, projects)
......@@ -347,7 +347,7 @@ module API
use :group_list_params
use :with_custom_attributes
end
get ":id/subgroups" do
get ":id/subgroups", feature_category: :subgroups do
groups = find_groups(declared_params(include_missing: false), params[:id])
present_groups params, groups
end
......@@ -359,7 +359,7 @@ module API
use :group_list_params
use :with_custom_attributes
end
get ":id/descendant_groups" do
get ":id/descendant_groups", feature_category: :subgroups do
finder_params = declared_params(include_missing: false).merge(include_parent_descendants: true)
groups = find_groups(finder_params, params[:id])
present_groups params, groups
......@@ -371,7 +371,7 @@ module API
params do
requires :project_id, type: String, desc: 'The ID or path of the project'
end
post ":id/projects/:project_id", requirements: { project_id: /.+/ } do
post ":id/projects/:project_id", requirements: { project_id: /.+/ }, feature_category: :projects do
authenticated_as_admin!
group = find_group!(params[:id])
group.preload_shared_group_links
......@@ -391,7 +391,7 @@ module API
desc: 'The ID of the target group to which the group needs to be transferred to.'\
'If not provided, the source group will be promoted to a root group.'
end
post ':id/transfer' do
post ':id/transfer', feature_category: :subgroups do
group = find_group!(params[:id])
authorize! :admin_group, group
......@@ -415,7 +415,7 @@ module API
requires :group_access, type: Integer, values: Gitlab::Access.all_values, desc: 'The group access level'
optional :expires_at, type: Date, desc: 'Share expiration date'
end
post ":id/share" do
post ":id/share", feature_category: :subgroups do
shared_group = find_group!(params[:id])
shared_with_group = find_group!(params[:group_id])
......@@ -438,7 +438,7 @@ module API
requires :group_id, type: Integer, desc: 'The ID of the shared group'
end
# rubocop: disable CodeReuse/ActiveRecord
delete ":id/share/:group_id" do
delete ":id/share/:group_id", feature_category: :subgroups do
shared_group = find_group!(params[:id])
link = shared_group.shared_with_group_links.find_by(shared_with_group_id: params[:group_id])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment