{"record":{"id":"528b53abb74c594f","repo":"passbolt/passbolt_api","slug":"the-patch-operation-is-not-supported","errorCode":null,"errorMessage":"The PATCH operation is not supported","messagePattern":"The PATCH operation is not supported","errorType":"exception","errorClass":"Passbolt\\Scim\\Exception\\NotSupportedException","httpStatus":501,"severity":"error","filePath":"plugins/PassboltEe/Scim/src/Utility/Resource/UserScimResource.php","lineNumber":536,"sourceCode":"                $mutability = ScimConstants::ATTRIBUTE_MUTABILITY_READ_WRITE;\n        }\n        if (!ScimConstants::isValidAttributeMutability((string)$mutability)) {\n            throw new ScimException(sprintf('The mutability `%s` is invalid or not supported', $mutability));\n        }\n\n        return $mutability;\n    }\n\n    /**\n     * {@inheritDoc}\n     *\n     * @throws \\Exception\n     */\n    public function patch(PatchRequest $patchRequest): static\n    {\n        $serviceConfig = new ServiceProviderConfig();\n        if (!$serviceConfig->isPatchSupported()) {\n            throw new NotSupportedException('The PATCH operation is not supported');\n        }\n        if (!$this->userEntity) {\n            throw new ScimException('The database user must be set to apply an operation');\n        }\n\n        $userPatchData = [];\n        $scimEntryPatchData = [];\n        foreach ($patchRequest->getOperations() as $operation) {\n            if ($operation->getAttribute() === null) {\n                $attributes = $operation->getValue();\n            } else {\n                $attributes[$operation->getAttribute()] = $operation->getValue();\n            }\n            foreach ($attributes as $attributeName => $attributeValue) {\n                $mutability = $this->getAttributeMutability($attributeName);\n                if ($mutability === ScimConstants::ATTRIBUTE_MUTABILITY_READ_ONLY) {\n                    throw new BadRequestException(sprintf(\n                        'Unable to apply operation `%s` for the attribute `%s` with mutability `%s`',","sourceCodeStart":518,"sourceCodeEnd":554,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Scim/src/Utility/Resource/UserScimResource.php#L518-L554","documentation":"This NotSupportedException is thrown at the start of patch() when the ServiceProviderConfig reports that PATCH is not supported. It is a capability guard: the server advertises its supported operations and refuses PATCH if the config disables it.","triggerScenarios":"PATCH /scim/v2/Users/{id} while ServiceProviderConfig::isPatchSupported() returns false — i.e. patch support is disabled in the service provider configuration.","commonSituations":"SCIM plugin configuration with patch disabled, an IdP configured to sync via PATCH while the server advertises only PUT, or an outdated plugin version where patch support is not yet enabled.","solutions":["Enable PATCH support in the SCIM ServiceProviderConfig (or update the Scim plugin to a version supporting it)","Configure the IdP to use PUT (full replace) if PATCH must remain disabled","Check the /scim/v2/ServiceProviderConfig endpoint to see the advertised capabilities"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"$config = $http->get('/scim/v2/ServiceProviderConfig')->getJson();\nif (!($config['patch']['supported'] ?? false)) {\n    // fall back to PUT full-replace sync\n}","typeGuard":null,"tryCatchPattern":"try {\n    $scimUsers->patch($id, $patchRequest);\n} catch (\\Passbolt\\Scim\\Exception\\NotSupportedException $e) {\n    // capability not advertised: switch strategy to PUT or full re-create\n}","preventionTips":["Query ServiceProviderConfig at sync startup and cache advertised capabilities","Configure the IdP to match the server's advertised operations","Keep the Scim plugin updated so PATCH remains supported"],"tags":["scim","unsupported-operation","patch"],"backgroundTag":"unsupported-operation","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"}