-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PATCH add/remove/replace extensions using path to extension but not to exact attribute #694
Conversation
- Removes special checks for operation types, moves logic to specfic PatchOperationHandlers - Adds test case for removal of full extension
@jasonfagerberg-toast I added a fix to this PR. I think you are right, and this is valid patch request, although there are a quark with how the Attribute's are parsed (see comments) I also added a test case for a "REMOVE" of a full Extension. I'm not sure if that one is a valid 🤔 Please take a quick pass through the code and let me know if you think something is missing or it's confusing. I'll try to take another look when i'm more awake 😴 |
Wow this is awesome! Wasn't expecting such a quick turn around! From my initial pass this looks good, I found another example online of a PATCH body doing the same thing in a slightly different way: https://is.docs.wso2.com/en/latest/references/extend/user-mgt/provisioning/extend-scim2-user-schemas/ {
"schemas":[
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations":[
{
"op":"replace",
"value":{
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{
"customAttribute":"new value"
}
}
}
]
} So I added a test for that as well, and looks like it is passing 😄 |
scim-core/src/test/java/org/apache/directory/scim/core/repository/PatchHandlerTest.java
Outdated
Show resolved
Hide resolved
scim-core/src/test/java/org/apache/directory/scim/core/repository/PatchHandlerTest.java
Outdated
Show resolved
Hide resolved
scim-core/src/main/java/org/apache/directory/scim/core/repository/DefaultPatchHandler.java
Show resolved
Hide resolved
I think for being sleepy this is an excellent PR 😅 I pushed a few small things to the tests but overall LGTM |
Thanks for taking a look at the updates! |
scim-core/src/test/java/org/apache/directory/scim/core/repository/PatchHandlerTest.java
Outdated
Show resolved
Hide resolved
Sorry about the delay on this one, I though we had already merged it! Thanks again @jasonfagerberg-toast |
Happy holidays :) |
When you attempt to replace an entire extension schema (using EnterpriseSchema as an example here), scimple throws a Null Pointer exception
This is because it is not treating it as an entire resource replacement but an exact path