( _ctx: PluginCtx<unknown>, options: KeychainPluginConfig | undefined, )
| 50 | // --------------------------------------------------------------------------- |
| 51 | |
| 52 | const makeKeychainExtension = ( |
| 53 | _ctx: PluginCtx<unknown>, |
| 54 | options: KeychainPluginConfig | undefined, |
| 55 | ) => { |
| 56 | const serviceName = resolveServiceName(options?.serviceName); |
| 57 | return { |
| 58 | /** Human-readable name for the keychain on this platform */ |
| 59 | displayName: displayName(), |
| 60 | |
| 61 | /** Whether the current platform supports system keychain */ |
| 62 | isSupported: isSupportedPlatform(), |
| 63 | |
| 64 | /** Check if a secret exists in the system keychain. `id` is the opaque |
| 65 | * provider item id (the keychain account); v2 has no scope partitioning. */ |
| 66 | has: (id: string) => |
| 67 | getPassword(serviceName, id).pipe( |
| 68 | Effect.map((value: string | null) => value !== null), |
| 69 | Effect.orElseSucceed(() => false), |
| 70 | ), |
| 71 | }; |
| 72 | }; |
| 73 | |
| 74 | export const keychainPlugin = definePlugin((options?: KeychainPluginConfig) => ({ |
| 75 | id: "keychain" as const, |
no test coverage detected