MCPcopy Index your code
hub / github.com/simstudioai/sim / tokenCacheKey

Function tokenCacheKey

apps/sim/app/api/tools/sap_concur/shared.ts:170–176  ·  view source on GitHub ↗
(req: SapConcurAuth)

Source from the content-addressed store, hash-verified

168export const SAP_CONCUR_OUTBOUND_FETCH_TIMEOUT_MS = 30_000
169
170function tokenCacheKey(req: SapConcurAuth): string {
171 const secretHash = createHash('sha256').update(req.clientSecret).digest('hex').slice(0, 16)
172 const userHash = req.username
173 ? createHash('sha256').update(req.username).digest('hex').slice(0, 12)
174 : ''
175 return `${req.datacenter}::${req.grantType}::${req.clientId}::${secretHash}::${userHash}`
176}
177
178function rememberToken(key: string, token: CachedToken): void {
179 if (TOKEN_CACHE.has(key)) TOKEN_CACHE.delete(key)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected