MCPcopy Create free account
hub / github.com/simstudioai/sim / rememberToken

Function rememberToken

apps/sim/app/api/tools/sap_s4hana/proxy/route.ts:52–60  ·  view source on GitHub ↗
(key: string, token: CachedToken)

Source from the content-addressed store, hash-verified

50}
51
52function rememberToken(key: string, token: CachedToken): void {
53 if (TOKEN_CACHE.has(key)) TOKEN_CACHE.delete(key)
54 TOKEN_CACHE.set(key, token)
55 while (TOKEN_CACHE.size > TOKEN_CACHE_MAX_ENTRIES) {
56 const oldestKey = TOKEN_CACHE.keys().next().value
57 if (oldestKey === undefined) break
58 TOKEN_CACHE.delete(oldestKey)
59 }
60}
61
62async function fetchAccessToken(req: ProxyRequest, requestId: string): Promise<string> {
63 const cacheKey = tokenCacheKey(req)

Callers 1

fetchAccessTokenFunction · 0.70

Calls 2

deleteMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected