diff options
author | Elizabeth Hunt <me@liz.coffee> | 2025-07-26 21:07:36 -0700 |
---|---|---|
committer | Elizabeth Hunt <me@liz.coffee> | 2025-07-27 00:00:12 -0700 |
commit | df76fa3c266f7f9b22d2bfaf98ad5accebcabd35 (patch) | |
tree | 8aaef9f227e385b8e31bd6c69fc6a8231326f361 /worker/secret.ts | |
parent | 9ee3bf3345b006a745b2ee28fee3613819011796 (diff) | |
download | ci-df76fa3c266f7f9b22d2bfaf98ad5accebcabd35.tar.gz ci-df76fa3c266f7f9b22d2bfaf98ad5accebcabd35.zip |
Fixes type inference for Either.joinRightAsync. Regarding ansible-docker. Will it ever be okay to trust docs?!!
Diffstat (limited to 'worker/secret.ts')
-rw-r--r-- | worker/secret.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/worker/secret.ts b/worker/secret.ts index 11daf06..071b539 100644 --- a/worker/secret.ts +++ b/worker/secret.ts @@ -39,12 +39,12 @@ export interface IVault<TClient, TKey, TItemId> { // -- <Vault> -- type TClient = ITraceable<unknown, LogMetricTraceSupplier>; -type TKey = { +export type BitwardenKey = { BW_SESSION: string; BITWARDENCLI_APPDATA_DIR: string; }; type TItemId = string; -export class Bitwarden implements IVault<TClient, TKey, TItemId> { +export class Bitwarden implements IVault<TClient, BitwardenKey, TItemId> { constructor(private readonly config: BitwardenConfig) {} public unlock(client: TClient) { @@ -52,7 +52,7 @@ export class Bitwarden implements IVault<TClient, TKey, TItemId> { .move(this.config) .flatMap(TraceUtil.withMetricTrace(Bitwarden.loginMetric)) .map((tConfig) => - Either.fromFailable<Error, { config: BitwardenConfig; key: Pick<TKey, 'BITWARDENCLI_APPDATA_DIR'> }>( + Either.fromFailable<Error, { config: BitwardenConfig; key: Pick<BitwardenKey, 'BITWARDENCLI_APPDATA_DIR'> }>( () => { const sessionPath = path.join(this.config.sessionBaseDirectory, randomUUID()); mkdirSync(sessionPath, { recursive: true }); @@ -78,7 +78,7 @@ export class Bitwarden implements IVault<TClient, TKey, TItemId> { .get(); } - public fetchSecret<T extends SecretItem>(client: TClient, key: TKey, item: string): Promise<IEither<Error, T>> { + public fetchSecret<T extends SecretItem>(client: TClient, key: BitwardenKey, item: string): Promise<IEither<Error, T>> { return client .move(key) .flatMap(TraceUtil.withMetricTrace(Bitwarden.fetchSecretMetric)) @@ -104,7 +104,7 @@ export class Bitwarden implements IVault<TClient, TKey, TItemId> { .get(); } - public lock(client: TClient, key: TKey) { + public lock(client: TClient, key: BitwardenKey) { return client .move(key) .flatMap(TraceUtil.withMetricTrace(Bitwarden.lockVaultMetric)) |