GluuFederation / oxTrust

Gluu Server UI for managing authentication, authorization and users.
https://gluu.org/docs/ce
MIT License
134 stars 61 forks source link

Support SCIM PATCH method "add", "remove", or "replace" values #367

Closed uboznikov closed 7 years ago

shekhar16 commented 8 years ago

@val Can u help me suitable approach to achieve this user Extension Delete functionality. I had 2 solutions 1) I can add one more map deleteFields in User object in that user can add which field (Key ,Value) he wants to delete.

2) User always has to set all extension he wants to retain ,we only persist the extension he sending in update call. If he wants to retain a custom attributes he has to send it every time.other wise we didn't know which custom attribute we should retain and which custom attribute we have to delete

Please suggest if you have different plan in Extensions.As you added new design (Extension-builder-Fields).

uboznikov commented 8 years ago

@shekhar16 We can only be compliant with the SCIM API spec, and to this end I think we already need to implement PATCH which enables the "remove" attribute operation.

https://tools.ietf.org/html/rfc7644#section-3.5.2

yurem commented 8 years ago

I think we need to split this into 2 independent parts: 1) Parse SCIM PATCH operation and create User(Group?) object(s) 2) Call already implemented methods from our SCIM API like: addUser/updateUser/deletedUser/etc...

With these 2 parts process will be more clear. We can iterate through SCIM PATCH operations and process them independently. Th workflow will be similar to bulk operation with one difference. Patch can apply one operation to more than 1 entry.

shekhar16 commented 8 years ago

Thanks Yuriy for your inputs I implemented that but I had 2 doubts 1) about path value in json request 2) I added list of operations and in that operations we had scim User object means for every operation request has to whole user object

yurem commented 8 years ago

Shekhar Laad: Path filter is the problem Shekhar Laad: We had path as string value Shekhar Laad: We got whole path in a string variables Shekhar Laad: Now how can we identify from string which field filter is applied

From my point of view field (attribute name) is part of the string till " or [

Here are examples from spec:

       "path":"members"
       "path":"name.familyName"
       "path":"addresses[type eq \"work\"]"
       "path":"members[value eq
              \"2819c223-7f76-453a-919d-413861904646\"]"
       "path":"members[value eq
              \"2819c223-7f76-453a-919d-413861904646\"].displayName"
yurem commented 8 years ago

Shekhar Laad: This patch is for single user record as in uri we had param (ID)

I don't think so. I think path specify target entry.

shekhar16 commented 8 years ago

https://github.com/GluuFederation/SCIM-Client/commit/52428764ace5671dc65b5b9a90852c519cf4c6ae

nynymike commented 8 years ago

Is this being incorporated into 3.0 ?

uboznikov commented 8 years ago

@shekhar16 Please add the unit tests in SCIM-Client. Thanks.

nynymike commented 8 years ago

Correct... no unit test, no inclusion in 3.0

yurem commented 7 years ago

It looks like we implemented it already. Can you close it if?

yurem commented 7 years ago

@shekhar16 , @uboznikov can we close it?