{"record":{"id":"e25a4471deae4d83","repo":"diegosouzapw/OmniRoute","slug":"api-key-is-required","errorCode":null,"errorMessage":"API key is required","messagePattern":"API key is required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/oauth/services/kiro.ts","lineNumber":522,"sourceCode":"    const profiles = Array.isArray(data?.profiles) ? data.profiles : [];\n    const arnOf = (profile: any) => profile?.arn || profile?.profileArn || null;\n    const match =\n      profiles.find((profile: any) => String(arnOf(profile) || \"\").includes(`:${region}:`)) ||\n      profiles[0];\n    return arnOf(match);\n  }\n\n  /**\n   * Normalize a long-lived Kiro/CodeWhisperer API key.\n   */\n  async validateApiKey(apiKey: string, regionInput?: string) {\n    // Default kept OUT of the parameter list: check-public-creds' CRED_KEY_RE matches the\n    // `apiKey:` annotation and flags any string literal in the signature (fn-param FP class).\n    const region = regionInput || \"us-east-1\";\n    assertValidAwsRegion(region);\n    const accessToken = apiKey.trim();\n    if (!accessToken) {\n      throw new Error(\"API key is required\");\n    }\n\n    let profileArn: string | null = null;\n    try {\n      profileArn = await this.listAvailableProfiles(accessToken, region);\n    } catch (error: any) {\n      const message = String(error?.message || error || \"\");\n      const isApiKeyProfileDenied =\n        message.includes(\"AccessDeniedException\") &&\n        message.includes(\"API key authentication is not supported for this operation\");\n      if (!isApiKeyProfileDenied) {\n        throw error;\n      }\n    }\n\n    return {\n      accessToken,\n      refreshToken: null,","sourceCodeStart":504,"sourceCodeEnd":540,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/services/kiro.ts#L504-L540","documentation":"Error \"API key is required\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/services/kiro.ts:522 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}