UNPKG

@cto.af/ca

Version:

Testing-only Certificate Authority (CA) for your local development environment ONLY. This is in no way suitable for production of any kind.

40 lines (39 loc) 1.35 kB
import { AsyncEntry } from '@napi-rs/keyring'; import type { Logger } from '@cto.af/log'; /** * Retrieve secret information from the keychain. * * @param log Logging service. * @param service Keychain service name. * @param account Full path to a filename that *could* store the secret. * @returns Secret. */ export declare function getSecret(log: Logger, service: string, account: string): Promise<string | undefined>; /** * Store a secret in the keychain. * * @param log Logging service. * @param service Keychain service name. * @param account Full path to a filename that *could* store the secret. * @param secret Secret to store. */ export declare function setSecret(log: Logger, service: string, account: string, secret: string): Promise<void>; /** * Delete a secret from the keychain. * * @param service Keychain service name. * @param account Full path to a filename that *could* store the secret. * @param log Logging service. */ export declare function deleteSecret(service: string, account: string, log?: Logger): Promise<void>; export interface SecretEntry { entry: AsyncEntry; account: string; } /** * List all of the keys in this service. * * @param service Keychain service name. * @yields An entry for each key found. */ export declare function listSecrets(service: string): AsyncGenerator<SecretEntry>;