MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / makeKeychainProvider

Function makeKeychainProvider

packages/plugins/keychain/src/provider.ts:40–55  ·  view source on GitHub ↗
(serviceName: string)

Source from the content-addressed store, hash-verified

38const KEYCHAIN_PROVIDER_KEY = ProviderKey.make("keychain");
39
40export const makeKeychainProvider = (serviceName: string): CredentialProvider => ({
41 key: KEYCHAIN_PROVIDER_KEY,
42 writable: true,
43 get: (id: ProviderItemId) => getPassword(serviceName, id).pipe(Effect.mapError(toStorageError)),
44 has: (id: ProviderItemId) =>
45 getPassword(serviceName, id).pipe(
46 Effect.map((value: string | null) => value !== null),
47 Effect.mapError(toStorageError),
48 ),
49 set: (id: ProviderItemId, value: string) =>
50 setPassword(serviceName, id, value).pipe(Effect.mapError(toStorageError)),
51 delete: (id: ProviderItemId) =>
52 deletePassword(serviceName, id).pipe(Effect.asVoid, Effect.mapError(toStorageError)),
53 // Keychain doesn't support enumerating — you need to know the account name.
54 list: undefined,
55});

Callers 7

index.test.tsFile · 0.90
index.tsFile · 0.90
providerGetFunction · 0.85
cleanupKeychainBackupsFunction · 0.85
writeMigratedSecretsFunction · 0.85

Calls 3

getPasswordFunction · 0.90
setPasswordFunction · 0.90
deletePasswordFunction · 0.90

Tested by

no test coverage detected