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

Function updateAccessToken

src/bridge/sessionRunner.ts:595–624  ·  view source on GitHub ↗
(token: string)

Source from the content-addressed store, hash-verified

593 }
594 },
595 updateAccessToken(token: string): void {
596 currentAccessToken = token
597 currentSessionIngressLease = buildSessionIngressLease({
598 executionTarget: handle.sessionIngressLease.executionTarget,
599 organizationUuid: handle.sessionIngressLease.organizationUuid,
600 providerMode:
601 handle.sessionIngressLease.providerMode ===
602 'third_party_provider'
603 ? undefined
604 : handle.sessionIngressLease.providerMode,
605 sessionId: opts.sessionId,
606 token,
607 })
608 handle.accessToken = currentAccessToken
609 handle.sessionIngressLease = currentSessionIngressLease
610 // Send the fresh token + explicit lease metadata to the child
611 // process via stdin. StructuredIO applies update_environment_variables
612 // directly to process.env, so session-ingress callers pick up the
613 // refreshed token and lease view on the next auth/header refresh.
614 handle.writeStdin(
615 buildSessionIngressRuntimeEnvironmentUpdate({
616 accessToken: token,
617 sessionId: opts.sessionId,
618 sessionIngressLease: handle.sessionIngressLease,
619 }),
620 )
621 deps.onDebug(
622 `[bridge:session] Sent token refresh via stdin for sessionId=${opts.sessionId}`,
623 )
624 },
625 }
626
627 return handle

Callers

nothing calls this directly

Tested by

no test coverage detected