diff --git a/internal/api/scim/integration_test/testdata/users_update_test_full.json b/internal/api/scim/integration_test/testdata/users_update_test_full.json index 33b05a1f7..62bacecb0 100644 --- a/internal/api/scim/integration_test/testdata/users_update_test_full.json +++ b/internal/api/scim/integration_test/testdata/users_update_test_full.json @@ -3,7 +3,7 @@ "Operations": [ // add without path { - "op": "add", + "op": "Add", // with PascalCase operation type "value": { "emails":[ { @@ -17,7 +17,7 @@ }, // add complex attribute with path { - "op": "add", + "op": "add", // with camelCase operation type "path": "name", "value": { "formatted": "added-formatted", @@ -30,7 +30,7 @@ }, // add complex attribute value { - "op": "add", + "op": "ADD", // with UPPERCASE operation type "path": "name.middlename", "value": "added-middle-name-2" }, diff --git a/internal/api/scim/resources/patch/patch.go b/internal/api/scim/resources/patch/patch.go index f4e6b4710..d6fc9a48e 100644 --- a/internal/api/scim/resources/patch/patch.go +++ b/internal/api/scim/resources/patch/patch.go @@ -60,6 +60,9 @@ func (req *OperationRequest) Validate() error { } func (op *Operation) validate() error { + // ignore the casing, as some scim clients send these capitalized + op.Operation = OperationType(strings.ToLower(string(op.Operation))) + if !op.Operation.isValid() { return serrors.ThrowInvalidValue(zerrors.ThrowInvalidArgumentf(nil, "SCIM-opty1", "Patch op %s not supported", op.Operation)) }