-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
Issue
Patch validation errors get swallowed up to ScimErrorInvalidValue here:
Lines 158 to 160 in 172bf2a
| value, err := validator.Validate() | |
| if err != nil { | |
| return nil, &errors.ScimErrorInvalidValue |
Example
Hence, the ScimType for errors upon patch validation is not always respected, for example:
{ "schemas":
["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations":[
{
"op":"remove",
"path":"",
"value":"newusername"
}]
}
In this example, a remove path must be provided and as per the RFC and we should return a scimType of noTarget:
If "path" is unspecified, the operation fails with HTTP status code 400 and a "scimType" error code of "noTarget".
Although the code does actually do this validation here
Lines 15 to 20 in 172bf2a
| if v.Path == nil { | |
| return nil, &errors.ScimError{ | |
| ScimType: errors.ScimTypeNoTarget, | |
| Status: http.StatusBadRequest, | |
| } | |
| } |
validatePatch.
The same issue is seen for other validations (e.g. sometimes a SyntaxError is swallowed).
alexmunda and katiesteinfeldtivixvi
Metadata
Metadata
Assignees
Labels
No labels