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

Function buildSourceDetails

src/auth/runtime/AuthRuntime.ts:187–213  ·  view source on GitHub ↗
(
  principalSource: PrincipalSource,
  rawAuthTokenSource: string | null,
  rawApiKeySource: string | null,
)

Source from the content-addressed store, hash-verified

185}
186
187function buildSourceDetails(
188 principalSource: PrincipalSource,
189 rawAuthTokenSource: string | null,
190 rawApiKeySource: string | null,
191): SourceDetails {
192 const rawSources = [rawAuthTokenSource, rawApiKeySource].filter(
193 (value): value is string => Boolean(value),
194 )
195
196 return {
197 usedLegacyCompat:
198 principalSource === 'external_bearer_compat' ||
199 rawSources.some(source =>
200 source.startsWith('CLAUDE_') ||
201 source.startsWith('ANTHROPIC_') ||
202 source.startsWith('CCR_'),
203 ),
204 usedEnvVar:
205 principalSource === 'service_oauth_env' ||
206 principalSource === 'direct_api_key_env' ||
207 principalSource === 'external_bearer_compat',
208 usedFileDescriptor:
209 principalSource === 'service_oauth_fd' ||
210 principalSource === 'service_api_key_fd',
211 usedHelper: principalSource === 'api_key_helper',
212 }
213}
214
215function buildRecovery(params: {
216 principalSource: PrincipalSource

Callers 2

resolveSessionSnapshotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected