Commit a81db23b authored by Manoj MJ's avatar Manoj MJ Committed by James Lopez

Resolve "Support emails as ID in SCIM"

parent 43cfc786
---
title: Support emails as ID in SCIM
merge_request: 14625
author:
type: fixed
......@@ -5,6 +5,7 @@ module API
prefix 'api/scim'
version 'v2'
content_type :json, 'application/scim+json'
USER_ID_REQUIREMENTS = { id: /.+/ }.freeze
namespace 'groups/:group' do
params do
......@@ -107,7 +108,7 @@ module API
desc 'Get a SAML user' do
detail 'This feature was introduced in GitLab 11.10.'
end
get ':id' do
get ':id', requirements: USER_ID_REQUIREMENTS do
group = find_and_authenticate_group!(params[:group])
identity = GroupSamlIdentityFinder.find_by_group_and_uid(group: group, uid: params[:id])
......@@ -142,7 +143,7 @@ module API
desc 'Updates a SAML user' do
detail 'This feature was introduced in GitLab 11.10.'
end
patch ':id' do
patch ':id', requirements: USER_ID_REQUIREMENTS do
scim_error!(message: 'Missing ID') unless params[:id]
group = find_and_authenticate_group!(params[:group])
......@@ -164,7 +165,7 @@ module API
desc 'Removes a SAML user' do
detail 'This feature was introduced in GitLab 11.10.'
end
delete ":id" do
delete ':id', requirements: USER_ID_REQUIREMENTS do
scim_error!(message: 'Missing ID') unless params[:id]
group = find_and_authenticate_group!(params[:group])
......
This diff is collapsed.
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