{"record":{"id":"e14d7cff01204191","repo":"passbolt/passbolt_api","slug":"invalid-status","errorCode":null,"errorMessage":"Invalid status.","messagePattern":"Invalid status\\.","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"plugins/PassboltEe/Sso/src/Service/SsoSettings/SsoSettingsActivateService.php","lineNumber":148,"sourceCode":"            throw new NotFoundException(__('The SSO setting does not exist.'), 404, $exception);\n        }\n\n        if ($ssoSettings->status !== $status) {\n            throw new BadRequestException(__('The settings status is invalid.'));\n        }\n\n        return $ssoSettings;\n    }\n\n    /**\n     * @param array $data user provided data\n     * @throws \\Cake\\Http\\Exception\\BadRequestException if status is invalid\n     * @return void\n     */\n    protected function assertActiveStatus(array $data): void\n    {\n        if (!isset($data['status']) || $data['status'] !== SsoSetting::STATUS_ACTIVE) {\n            throw new BadRequestException(__('Invalid status.'));\n        }\n    }\n}\n","sourceCodeStart":130,"sourceCodeEnd":152,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Sso/src/Service/SsoSettings/SsoSettingsActivateService.php#L130-L152","documentation":"assertActiveStatus() requires $data['status'] to be present and exactly equal to SsoSetting::STATUS_ACTIVE ('active'). Missing or different values trigger a BadRequestException 'Invalid status.' This gates the activation payload contract.","triggerScenarios":"Calling activate() with no 'status' key, a typo like 'Active'/'actived', an empty string, or sending the whole settings entity where status holds a different value.","commonSituations":"API clients omitting the status field in the PATCH-style activation payload; case-sensitivity mistakes after refactoring; building the payload from user input without whitelisting.","solutions":["Send exactly ['status' => 'active'] (SsoSetting::STATUS_ACTIVE) in the activation payload","Use the SsoSetting::STATUS_ACTIVE constant instead of a hardcoded string","Whitelist/normalize client input to lowercase before calling activate()"],"exampleFix":"// before\n$service->activate($uac, $id, ['token' => $token, 'status' => $input['Status']]);\n// after\n$service->activate($uac, $id, ['token' => $token, 'status' => SsoSetting::STATUS_ACTIVE]);","handlingStrategy":"validation","validationCode":"if (($data['status'] ?? null) !== SsoSetting::STATUS_ACTIVE) { throw new \\InvalidArgumentException('status must be \"active\"'); }","typeGuard":null,"tryCatchPattern":"try { $service->activate($uac, $id, $data); } catch (BadRequestException $e) { // normalize payload and retry once }","preventionTips":["Use SsoSetting::STATUS_ACTIVE constant, not string literals","Lowercase/normalize client input","Document the exact activation payload in the API client"],"tags":["sso","validation","bad-request","passbolt"],"backgroundTag":"invalid-enum-value","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"}