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

Function generateAuthToken

apps/sim/lib/core/security/deployment.ts:23–31  ·  view source on GitHub ↗
(
  deploymentId: string,
  type: string,
  encryptedPassword?: string | null
)

Source from the content-addressed store, hash-verified

21}
22
23function generateAuthToken(
24 deploymentId: string,
25 type: string,
26 encryptedPassword?: string | null
27): string {
28 const payload = `${deploymentId}:${type}:${Date.now()}:${passwordSlot(encryptedPassword)}`
29 const sig = signPayload(payload)
30 return Buffer.from(`${payload}:${sig}`).toString('base64')
31}
32
33/**
34 * Validates an HMAC-signed authentication token for a chat deployment.

Callers 1

setDeploymentAuthCookieFunction · 0.85

Calls 3

passwordSlotFunction · 0.85
signPayloadFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected