MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / tokenProvider

Method tokenProvider

packages/oauth/src/toolkit.ts:264–274  ·  view source on GitHub ↗
(
    providerName?: string | undefined,
    oauthRef?: KimiOAuthTokenRef | undefined,
  )

Source from the content-addressed store, hash-verified

262 }
263
264 tokenProvider(
265 providerName?: string | undefined,
266 oauthRef?: KimiOAuthTokenRef | undefined,
267 ): BearerTokenProvider {
268 const name = providerName ?? KIMI_CODE_PROVIDER_NAME;
269 const oauthHost = this.oauthHostFor(oauthRef);
270 const oauthKey = oauthRef?.key ?? this.defaultOAuthKey(undefined, oauthHost);
271 return {
272 getAccessToken: (options) => this.managerFor(name, oauthKey, oauthHost).ensureFresh(options),
273 };
274 }
275
276 async getManagedUsage(
277 providerName?: string | undefined,

Callers 4

mainFunction · 0.95
toolkit.test.tsFile · 0.80
KimiAuthFacadeClass · 0.80

Calls 4

oauthHostForMethod · 0.95
defaultOAuthKeyMethod · 0.95
managerForMethod · 0.95
ensureFreshMethod · 0.45

Tested by

no test coverage detected