You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problems with Patch operation on group members #10
I've noticed a couple of problems with patch operations on group members.
A patch operation to remove a single member removes all members. This seems to be due to the code creating a new empty list of the value property of the patch operation has a null value.
case OperationName.Remove:
if (null == group.Members)
{
break;
}
if (operation?.Value?.FirstOrDefault()?.Value == null)
{
group.Members = Enumerable.Empty<Member>();
break;
}
Adding a member allows the adding of the same user id more than once.
steverash thanks for the feedback. Could you provide screenshots of a repro for #1? We're not able to repro it. We're trying to adhere to the standard as described in the screenshot below. We'll be able to address #2.
ArvindHarinder1 - I think the code above is assuming that if there is no value then it must be that it is trying to remove all members of the group. However that "value" is actually in the path, as per your example requests above.
For reproduction, here are the steps I went through with this sample app in postman
First, create a group with 2 members
{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
"externalId":"ABCDEFE-B840-47E7-8FBE-543534534543",
"displayName": "New group",
"members":
[
{
"value":"E367CCBD-B840-47E7-8FBE-B801A18DB3E3",
"display":"Test user 1"
},
{
"value":"A367CCBD-B840-47E7-8FBE-B801A18DB3BB",
"display":"Test user 2"
}
]
}
Activity
ArvindHarinder1 commentedon Mar 18, 2020
steverash thanks for the feedback. Could you provide screenshots of a repro for #1? We're not able to repro it. We're trying to adhere to the standard as described in the screenshot below. We'll be able to address #2.
https://tools.ietf.org/html/rfc7644#section-3.5.2
steverash commentedon Mar 18, 2020
ArvindHarinder1 - I think the code above is assuming that if there is no value then it must be that it is trying to remove all members of the group. However that "value" is actually in the path, as per your example requests above.
For reproduction, here are the steps I went through with this sample app in postman
First, create a group with 2 members
Then remove a single member
steverash commentedon Apr 14, 2020
As an alternative fix, I've put a PR in based on a fix I've done on my fork. PR is here : #14
ArvindHarinder1 commentedon May 5, 2020
Closed with this PR. #25