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

Function encryptApiKey

apps/sim/lib/api-key/crypto.ts:29–35  ·  view source on GitHub ↗
(apiKey: string)

Source from the content-addressed store, hash-verified

27 * compatibility with deployments that predate encryption-at-rest.
28 */
29export async function encryptApiKey(apiKey: string): Promise<{ encrypted: string; iv: string }> {
30 const key = getApiEncryptionKey()
31 if (!key) {
32 return { encrypted: apiKey, iv: '' }
33 }
34 return encrypt(apiKey, key)
35}
36
37/**
38 * Decrypts an API key previously produced by {@link encryptApiKey}. Values

Callers 3

encryptApiKeyForStorageFunction · 0.90
crypto.test.tsFile · 0.90
route.tsFile · 0.90

Calls 2

encryptFunction · 0.90
getApiEncryptionKeyFunction · 0.85

Tested by

no test coverage detected