{"record":{"id":"034592f0d77a84da","repo":"passbolt/passbolt_api","slug":"invalid-resourcetype","errorCode":null,"errorMessage":"Invalid ResourceType","messagePattern":"Invalid ResourceType","errorType":"http","errorClass":"ScimException","httpStatus":400,"severity":"warning","filePath":"plugins/PassboltEe/Scim/src/Utility/ScimResourceTypes.php","lineNumber":80,"sourceCode":"            $resourceTypes[] = self::build($identifier);\n        }\n\n        return $resourceTypes;\n    }\n\n    /**\n     * Build a ResourceType given the name\n     *\n     * @param string $name\n     * @return \\Passbolt\\Scim\\Utility\\ScimObjectInterface\n     * @throws \\Passbolt\\Scim\\Exception\\ScimException\n     * @throws \\Exception\n     */\n    public static function build(string $name): ScimObjectInterface\n    {\n        $class = self::MAPPING[$name] ?? null;\n        if (!$class) {\n            throw new ScimException(__('Invalid ResourceType'));\n        }\n\n        return new $class();\n    }\n}\n","sourceCodeStart":62,"sourceCodeEnd":86,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Scim/src/Utility/ScimResourceTypes.php#L62-L86","documentation":"ScimResourceTypes::build() resolves a SCIM resource type name ('User' or 'Group') to its class via MAPPING; an unknown name throws ScimException 'Invalid ResourceType'. Passbolt only knows the User and Group resource types.","triggerScenarios":"Requesting /scim/v2.0/ResourceTypes/{name} with a name other than 'User' or 'Group' (e.g. 'Entitlement', lowercase 'user'); calling ScimResourceTypes::build() with a mistyped name.","commonSituations":"IdP expecting resource types passbolt doesn't implement; case mismatch ('user' vs 'User'); custom integrations hardcoding wrong type names.","solutions":["Use exactly 'User' or 'Group' (see ScimResourceTypes::TYPE_* constants); check GET /scim/v2.0/ResourceTypes for the supported list.","Guard with ScimResourceTypes::isValid($name) before calling build().","If the client needs additional resource types, extend MAPPING in ScimResourceTypes.php rather than expecting them to exist."],"exampleFix":"// before\nScimResourceTypes::build('user'); // throws Invalid ResourceType\n// after\nif (ScimResourceTypes::isValid($name)) {\n    $rt = ScimResourceTypes::build($name);\n}","handlingStrategy":"validation","validationCode":"if (!['User', 'Group'].includes(resourceTypeName)) {\n  throw new Error(`Resource type ${resourceTypeName} not supported by passbolt SCIM`);\n}","typeGuard":"function isKnownResourceType(name) {\n  return name === 'User' || name === 'Group';\n}","tryCatchPattern":"try {\n  const rt = await fetchResourceType(name);\n} catch (e) {\n  if (e.response && e.response.status === 400) {\n    // invalid resource type: refresh from GET /ResourceTypes\n  }\n}","preventionTips":["Use exact case-sensitive names 'User' and 'Group'.","Fetch GET /scim/v2.0/ResourceTypes at startup and cache the supported list.","Don't assume other IdP resource types (e.g. 'Entitlement') exist."],"tags":["scim","resource-type","unsupported-value"],"backgroundTag":"unsupported-enum-value","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}