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

Function decryptAll

apps/sim/lib/environment/utils.ts:191–211  ·  view source on GitHub ↗
(src: Record<string, string>, source: 'personal' | 'workspace')

Source from the content-addressed store, hash-verified

189 const decryptionFailures: string[] = []
190
191 const decryptAll = async (src: Record<string, string>, source: 'personal' | 'workspace') => {
192 const entries = Object.entries(src)
193 const results = await Promise.all(
194 entries.map(async ([k, v]) => {
195 try {
196 const { decrypted } = await decryptSecret(v)
197 return [k, decrypted] as const
198 } catch (error) {
199 logger.error(`Failed to decrypt ${source} environment variable "${k}"`, {
200 userId,
201 workspaceId,
202 source,
203 error: getErrorMessage(error, 'Unknown error'),
204 })
205 decryptionFailures.push(k)
206 return [k, ''] as const
207 }
208 })
209 )
210 return Object.fromEntries(results)
211 }
212
213 const [personalDecrypted, workspaceDecrypted] = await Promise.all([
214 decryptAll(personalEncrypted, 'personal'),

Callers 1

Calls 4

decryptSecretFunction · 0.90
getErrorMessageFunction · 0.90
errorMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected