pingidentity / scim2

The UnboundID SCIM 2.0 SDK for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GroupResource.member to have Member.class as multiValueClass

AvadhYadav opened this issue · comments

Describe the bug
I'm using the GroupResource included in scim2-sdk-common for my project. The member attribute has multiValueClass=Group.class. This makes all the attributes within member object READ_ONLY and thus I'm not able to add to replace any members in PUT/POST operations. Is this the correct behaviour? Why don't we have multiValueClass=Member.class.

To Reproduce

  1. Do POST/PUT operations to add members to a new/existing group with validations for mutability in place. This should throw mutability errors on creation/updation.
  2. Check /Schema/Group endpoints, the member fields will have mutability as READ_ONLY.

Expected behavior
Everything seems to be working as expected if I replace multiValueClass to Member.class. Just wanted to understand the reasoning behind having multiValueClass as Group.class and not Member.class or if it should be treated as a bug.

Also as per the RFC, the attributes within members should be IMMUTABLE and not READ_ONLY.
{ "id": "urn:ietf:params:scim:schemas:core:2.0:Group", "name": "Group", "description": "Group", "attributes": [ { "name": "displayName", "type": "string", "multiValued": false, "description": "A human-readable name for the Group. REQUIRED.", "required": false, "caseExact": false, "mutability": "readWrite", "returned": "default", "uniqueness": "none" }, { "name": "members", "type": "complex", "multiValued": true, "description": "A list of members of the Group.", "required": false, "subAttributes": [ { "name": "value", "type": "string", "multiValued": false, "description": "Identifier of the member of this Group.", "required": false, "caseExact": false, "mutability": "immutable", "returned": "default", "uniqueness": "none" }, { "name": "$ref", "type": "reference", "referenceTypes": [ "User", "Group" ], "multiValued": false, "description": "The URI corresponding to a SCIM resource that is a member of this Group.", "required": false, "caseExact": false, "mutability": "immutable", "returned": "default", "uniqueness": "none" }, { "name": "type", "type": "string", "multiValued": false, "description": "A label indicating the type of resource, e.g., 'User' or 'Group'.", "required": false, "caseExact": false, "canonicalValues": [ "User", "Group" ], "mutability": "immutable", "returned": "default", "uniqueness": "none" } ], "mutability": "readWrite", "returned": "default" } ], "meta": { "resourceType": "Schema", "location": "/v2/Schemas/urn:ietf:params:scim:schemas:core:2.0:Group" } }

Please let me know if you need any additional information for clarification.
Thank you.

Thanks for reporting this. This should be resolved with #199, which is currently planned to be released in version 2.4.0 of the UnboundID SCIM 2 SDK.