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

Function decryptApiKeyFromStorage

apps/sim/lib/api-key/auth.ts:80–88  ·  view source on GitHub ↗

* Decrypts an API key from storage for display purposes * @param encryptedKey - The encrypted API key from the database * @returns Promise - The decrypted API key

(encryptedKey: string)

Source from the content-addressed store, hash-verified

78 * @returns Promise<string> - The decrypted API key
79 */
80async function decryptApiKeyFromStorage(encryptedKey: string): Promise<string> {
81 try {
82 const { decrypted } = await decryptApiKey(encryptedKey)
83 return decrypted
84 } catch (error) {
85 logger.error('API key decryption error:', { error })
86 throw new Error('Failed to decrypt API key')
87 }
88}
89
90/**
91 * Gets the last 4 characters of an API key for display purposes

Callers 2

getApiKeyDisplayFormatFunction · 0.85
getEncryptedApiKeyLast4Function · 0.85

Calls 2

decryptApiKeyFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected