MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / getRemoteWorkspaceSecret

Function getRemoteWorkspaceSecret

apps/desktop/src/main/secret-store.ts:91–103  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

89}
90
91export async function getRemoteWorkspaceSecret(id: string): Promise<string | null> {
92 const normalizedId = id.trim()
93 if (!normalizedId) return null
94
95 const keytar = await loadKeytar()
96 if (keytar) {
97 return await keytar.getPassword(KEYTAR_SERVICE, accountName(normalizedId))
98 }
99
100 const fallback = await loadFallbackSecrets()
101 const encoded = fallback[normalizedId]
102 return encoded ? decodeSecret(encoded) : null
103}
104
105export async function setRemoteWorkspaceSecret(id: string, secret: string | null): Promise<boolean> {
106 const normalizedId = id.trim()

Calls 4

loadKeytarFunction · 0.85
accountNameFunction · 0.85
loadFallbackSecretsFunction · 0.85
decodeSecretFunction · 0.85

Tested by

no test coverage detected