{"record":{"id":"237b41bb21adc84c","repo":"passbolt/passbolt_api","slug":"the-resource-identifier-should-be-a-valid-uuid-237b41","errorCode":null,"errorMessage":"The resource identifier should be a valid UUID.","messagePattern":"The resource identifier should be a valid UUID\\.","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"plugins/PassboltEe/AuditLog/src/Controller/ResourceLogsController.php","lineNumber":46,"sourceCode":"     */\n    public function getModelName(): string\n    {\n        return 'Resources';\n    }\n\n    /**\n     * View action logs for a given resource.\n     *\n     * @param string|null $resourceId resource id\n     * @return void\n     * @throws \\Cake\\Http\\Exception\\BadRequestException if the resource id has the wrong format\n     * @throws \\Cake\\Http\\Exception\\NotFoundException if the user cannot access the given resource, or if the resource does not exist\n     */\n    public function view(?string $resourceId = null)\n    {\n        // Check request sanity\n        if (!Validation::uuid($resourceId)) {\n            throw new BadRequestException(__('The resource identifier should be a valid UUID.'));\n        }\n\n        $this->viewByEntity(new ResourceActionLogsFinder(), $resourceId);\n    }\n}\n","sourceCodeStart":28,"sourceCodeEnd":52,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/AuditLog/src/Controller/ResourceLogsController.php#L28-L52","documentation":"Thrown by the AuditLog EE plugin's ResourceLogsController when the resourceId path parameter is not a valid UUID. It is the request sanity check for the resource activity logs endpoint and fires before any permission or existence verification.","triggerScenarios":"GET /resources/<resourceId>/logs.json where resourceId is missing, null, numeric, or otherwise not a UUID.","commonSituations":"Scripts or integrations using legacy numeric ids; URL built without interpolating the resource id; test fixtures with fake ids like 'xxx'; truncated UUIDs from copy-paste.","solutions":["Provide the resource's passbolt UUID in the URL path","Look up the correct id via GET /resources.json and use the id property","Add client-side UUID validation before invoking the logs endpoint","Fix route/template code that drops or mangles the id segment"],"exampleFix":"// before\nconst url = `/resources/${idx}/logs.json`; // idx is array index\n// after\nconst url = `/resources/${resource.id}/logs.json`;","handlingStrategy":"validation","validationCode":"const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nif (!UUID_RE.test(resourceId)) throw new Error('resourceId must be a UUID');","typeGuard":"const isUuid = (v) => typeof v === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(v);","tryCatchPattern":"try {\n  const logs = await getResourceLogs(resourceId);\n} catch (e) {\n  if (e.code === 400 && /valid UUID/.test(e.message)) {\n    refreshResourceList();\n  } else { throw e; }\n}","preventionTips":["Use resource.id from API responses, never array indices or slugs","Validate id format before the request","Ensure URL builders interpolate the id correctly","Add tests that call the logs endpoint with real fetched ids"],"tags":["audit-log","uuid","http-400","controller"],"backgroundTag":"invalid-argument-format","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"}