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

Function loadKeytar

apps/desktop/src/main/secret-store.ts:28–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26}
27
28async function loadKeytar(): Promise<KeytarModule | null> {
29 try {
30 const mod = (await import('keytar')) as Partial<KeytarModule> | { default?: Partial<KeytarModule> }
31 const candidate = ('default' in mod ? mod.default : mod) as Partial<KeytarModule> | undefined
32 if (
33 candidate &&
34 typeof candidate.getPassword === 'function' &&
35 typeof candidate.setPassword === 'function' &&
36 typeof candidate.deletePassword === 'function'
37 ) {
38 return candidate as KeytarModule
39 }
40 } catch {
41 // keytar is optional; safeStorage fallback handles the common case.
42 }
43 return null
44}
45
46async function loadFallbackSecrets(): Promise<SecretMap> {
47 try {

Callers 3

getRemoteWorkspaceSecretFunction · 0.85
setRemoteWorkspaceSecretFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected