{"record":{"id":"e1e11474b65f5561","repo":"passbolt/passbolt_api","slug":"the-operation-type-s-is-not-supported-or-invalid-e1e114","errorCode":null,"errorMessage":"The operation type `%s` is not supported or invalid","messagePattern":"The operation type `(.+?)` is not supported or invalid","errorType":"http","errorClass":"NotSupportedException","httpStatus":400,"severity":"error","filePath":"plugins/PassboltEe/Scim/src/Utility/Resource/UserScimResource.php","lineNumber":672,"sourceCode":"                                $userPatchData['profile']['first_name'] = '';\n                                break;\n                            case 'name.familyName':\n                                $userPatchData['profile']['last_name'] = '';\n                                break;\n                            case 'active':\n                                $userPatchData['disabled'] = $this->getDisabledValue(isUserActive: false);\n                                break;\n                            case 'emails':\n                                throw new BadRequestException(\n                                    'The email can not be changed',\n                                    scimType: ScimException::SCIM_TYPE_MUTABILITY\n                                );\n                            default:\n                                // ignore attributes not used in this application\n                        }\n                        break;\n                    default:\n                        throw new NotSupportedException(\n                            sprintf('The operation type `%s` is not supported or invalid', $operation->getType())\n                        );\n                }\n            }\n        }\n\n        $this->updateDatabaseUser($userPatchData, $scimEntryPatchData);\n        // Set the object properties with the updated information\n        $this->setFromDatabase($this->userEntity->id);\n\n        return $this;\n    }\n\n    /**\n     * Assert that the user being disabled is not an administrator.\n     *\n     * @param array $userPatchData The patch data being applied.\n     * @return void","sourceCodeStart":654,"sourceCodeEnd":690,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Scim/src/Utility/Resource/UserScimResource.php#L654-L690","documentation":"UserScimResource::patch() only supports SCIM operations of type `add`, `replace`, and `remove`. Any other operation type value in the PATCH request's Operations array falls through to the default branch and raises a NotSupportedException (HTTP 501).","triggerScenarios":"PATCH /scim/v2/Users/<id> whose operation contains an invalid `op` value such as \"update\", \"delete\", \"modify\", a wrongly-cased value like \"Replace\", or a malformed operation object where the type could not be parsed into a known type.","commonSituations":"A hand-written SCIM client uses non-standard op names; an Op value arrives with different casing that the Operation parser doesn't normalize; a new SCIM RFC extension op is sent that passbolt doesn't implement; a proxy rewrites the payload incorrectly.","solutions":["Change the operation `op` value to one of `add`, `replace`, or `remove` (lowercase, per RFC 7644).","Log the raw PATCH body and verify each entry in the Operations array has a valid op string.","Update the SCIM client library to one that strictly emits RFC 7644 op values.","If a new op semantic is needed, implement equivalent behavior with multiple add/replace/remove operations."],"exampleFix":"// before\n{\"Operations\":[{\"op\":\"update\",\"path\":\"active\",\"value\":false}]}\n// after\n{\"Operations\":[{\"op\":\"replace\",\"path\":\"active\",\"value\":false}]}","handlingStrategy":"type-guard","validationCode":"const VALID = ['add','replace','remove'];\nops.forEach(op => { if (!VALID.includes(String(op.op).toLowerCase())) throw new Error('unsupported SCIM op: ' + op.op); });","typeGuard":"const isSupportedOp = (op) => ['add','replace','remove'].includes(String(op?.op).toLowerCase());","tryCatchPattern":"try { await scim.patchUser(id, ops); } catch (e) { if (e.status === 501 || /not supported/i.test(e.message)) { log('unsupported op in payload', ops); } else throw e; }","preventionTips":["Emit only lowercase RFC 7644 op values: add, replace, remove","Validate payloads against the SCIM 2.0 schema in tests","Log raw PATCH bodies in staging to catch client typos"],"tags":["scim","patch","unsupported-operation","rfc7644"],"backgroundTag":"operation-not-supported","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}