Commit 8b74c35c authored by James Lopez's avatar James Lopez

Fix SCIM API

parent 092c678a
...@@ -40,7 +40,9 @@ module API ...@@ -40,7 +40,9 @@ module API
check_group_saml_configured check_group_saml_configured
end end
desc 'Returns 200 if authenticated' desc 'Get SAML users' do
detail 'This feature was introduced in GitLab 11.9.'
end
get do get do
group = find_group(params[:group]) group = find_group(params[:group])
...@@ -54,6 +56,9 @@ module API ...@@ -54,6 +56,9 @@ module API
present identity || {}, with: ::EE::Gitlab::Scim::Users present identity || {}, with: ::EE::Gitlab::Scim::Users
end end
desc 'Get a SAML user' do
detail 'This feature was introduced in GitLab 11.9.'
end
get ':id' do get ':id' do
group = find_group(params[:group]) group = find_group(params[:group])
...@@ -67,6 +72,9 @@ module API ...@@ -67,6 +72,9 @@ module API
end end
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
desc 'Updates a SAML user' do
detail 'This feature was introduced in GitLab 11.9.'
end
patch ':id' do patch ':id' do
scim_error!(message: 'Missing ID') unless params[:id] scim_error!(message: 'Missing ID') unless params[:id]
...@@ -103,12 +111,13 @@ module API ...@@ -103,12 +111,13 @@ module API
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
desc 'Removes a SAML user' desc 'Removes a SAML user' do
detail 'This feature was introduced in GitLab 11.9.'
end
delete ":id" do delete ":id" do
scim_error!(message: 'Missing ID') unless params[:id] scim_error!(message: 'Missing ID') unless params[:id]
group = find_group(params[:group]) group = find_group(params[:group])
identity = GroupSamlIdentityFinder.find_by_group_and_uid(group: group, uid: params[:id]) identity = GroupSamlIdentityFinder.find_by_group_and_uid(group: group, uid: params[:id])
scim_not_found!(message: "Resource #{params[:id]} not found") unless identity scim_not_found!(message: "Resource #{params[:id]} not found") unless identity
......
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