MCPcopy
hub / github.com/FlowiseAI/Flowise / compareKeys

Function compareKeys

packages/server/src/utils/apiKey.ts:29–33  ·  view source on GitHub ↗
(storedKey: string, suppliedKey: string)

Source from the content-addressed store, hash-verified

27 * @returns {boolean}
28 */
29export const compareKeys = (storedKey: string, suppliedKey: string): boolean => {
30 const [hashedPassword, salt] = storedKey.split('.')
31 const buffer = scryptSync(suppliedKey, salt, 64) as Buffer
32 return timingSafeEqual(Buffer.from(hashedPassword, 'hex'), buffer)
33}

Callers 3

apiKey.test.tsFile · 0.90
validateFlowAPIKeyFunction · 0.90
validateAPIKeyFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected