* CCR and Claude Desktop spawn the CLI with OAuth and should never fall back * to the user's settings-backed API-key config (typically * ~/.ncode/settings.json; legacy ~/.claude/settings.json) or related auth env * sources (apiKeyHelper, env.NOUMENA_API_KEY / env.ANTHROPIC_API_KEY / * env.OPENAI
()
| 102 | * and fail if it's stale/wrong-org. |
| 103 | */ |
| 104 | function isManagedOAuthContext(): boolean { |
| 105 | return ( |
| 106 | isEnvTruthy(process.env.NCODE_REMOTE) || |
| 107 | isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) || |
| 108 | process.env.NCODE_ENTRYPOINT === 'claude-desktop' || |
| 109 | process.env.CLAUDE_CODE_ENTRYPOINT === 'claude-desktop' |
| 110 | ) |
| 111 | } |
| 112 | |
| 113 | /** Whether we are supporting direct 1P auth. */ |
| 114 | // this code is closely related to getAuthTokenSource |
no test coverage detected