MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / decodeSecret

Function decodeSecret

desktop/main.mjs:191–203  ·  view source on GitHub ↗
(record)

Source from the content-addressed store, hash-verified

189}
190
191function decodeSecret(record) {
192 if (!record?.value) {
193 return ''
194 }
195 if (record.mode === 'safeStorage') {
196 try {
197 return safeStorage.decryptString(Buffer.from(record.value, 'base64'))
198 } catch {
199 return ''
200 }
201 }
202 return String(record.value || '')
203}
204
205async function getSecret(key) {
206 const store = await readSecretStore()

Callers 1

getSecretFunction · 0.85

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected