MCPcopy Create free account
hub / github.com/Noumena-Network/code / isManagedOAuthContext

Function isManagedOAuthContext

src/utils/auth.ts:104–111  ·  view source on GitHub ↗

* 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

()

Source from the content-addressed store, hash-verified

102 * and fail if it's stale/wrong-org.
103 */
104function 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

Callers 2

isAnthropicAuthEnabledFunction · 0.85
getAuthTokenSourceFunction · 0.85

Calls 1

isEnvTruthyFunction · 0.90

Tested by

no test coverage detected