{"record":{"id":"cb120f9cea500055","repo":"passbolt/passbolt_api","slug":"invalid-resource-type-s","errorCode":null,"errorMessage":"Invalid Resource type `%s`","messagePattern":"Invalid Resource type `(.+?)`","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"warning","filePath":"plugins/PassboltEe/Scim/src/Utility/ScimResources.php","lineNumber":60,"sourceCode":"     * @return bool\n     */\n    public static function isValid(string $type): bool\n    {\n        return array_key_exists($type, self::MAPPING);\n    }\n\n    /**\n     * Build a Resource given the type\n     *\n     * @param string $type\n     * @return \\Passbolt\\Scim\\Utility\\ScimResourceInterface\n     * @throws \\Exception\n     */\n    public static function build(string $type): ScimResourceInterface\n    {\n        $class = self::MAPPING[$type] ?? null;\n        if (!$class) {\n            throw new BadRequestException(sprintf('Invalid Resource type `%s`', $type), 400);\n        }\n\n        return new $class();\n    }\n}\n","sourceCodeStart":42,"sourceCodeEnd":66,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Scim/src/Utility/ScimResources.php#L42-L66","documentation":"ScimResources::build() maps a resource endpoint segment ('Users', 'Groups') to its resource class. Currently only 'Users' is mapped (Groups is not implemented in this build), so any other type throws BadRequestException 'Invalid Resource type `%s`' (HTTP 400).","triggerScenarios":"Requests to /scim/v2.0/Groups or any endpoint segment not in MAPPING (e.g. /Users typo'd, /groups lowercase); calling ScimResources::build() from controller actions (create/delete/patch/put/view) with an unknown segment.","commonSituations":"IdP configured to sync groups to a passbolt version/build that doesn't support SCIM Groups; URL case mistakes; forwarding rules rewriting the path.","solutions":["Only sync Users over SCIM, or upgrade to a passbolt version where Groups SCIM resources are supported; configure the IdP to skip group provisioning.","Use the exact endpoint segment 'Users' (case-sensitive) in client requests.","Guard with ScimResources::isValid($type) before build(), and return a proper SCIM error listing supported types."],"exampleFix":"// before\ncurl -X POST https://passbolt/scim/v2.0/Groups ... // 400 Invalid Resource type `Groups`\n// after: provision groups via passbolt API/UI, or upgrade to a build mapping Groups","handlingStrategy":"validation","validationCode":"if (!scimCapabilities.resourceTypes.includes('Groups')) {\n  // skip group provisioning entirely\n  return;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await client.post('/scim/v2.0/Groups', body);\n} catch (e) {\n  if (e.response && e.response.status === 400 && /Invalid Resource type/.test(e.response.data?.detail ?? '')) {\n    logger.warn('Groups not supported by this passbolt build');\n  }\n}","preventionTips":["Check GET /scim/v2.0/ResourceTypes before enabling group sync in the IdP.","Configure the IdP to not push groups when the passbolt build lacks Groups support.","Keep endpoint URLs exactly 'Users'/'Groups', case-sensitive.","Upgrade passbolt if group provisioning over SCIM is required."],"tags":["scim","groups","unsupported-operation"],"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"}