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