summaryrefslogtreecommitdiff
path: root/worker/secret.ts
diff options
context:
space:
mode:
Diffstat (limited to 'worker/secret.ts')
-rw-r--r--worker/secret.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/worker/secret.ts b/worker/secret.ts
index 241823d..30316bd 100644
--- a/worker/secret.ts
+++ b/worker/secret.ts
@@ -47,9 +47,12 @@ export class Bitwarden implements IVault<TClient, TKey, TItemId> {
.flatMap((tConfig) => tConfig.move(`bw config server ${tConfig.get().server}`).map(getStdout))
.map(async (tEitherWithConfig) => {
const eitherWithConfig = await tEitherWithConfig.get();
- tEitherWithConfig.trace.trace('logging in~ ^.^');
return eitherWithConfig.flatMapAsync((_) =>
- tEitherWithConfig.move('bw login --apikey --quiet').map(getStdout).get(),
+ tEitherWithConfig
+ .peek((t) => t.trace.trace('logging in~ ^.^'))
+ .move('bw login --apikey --quiet')
+ .map(getStdout)
+ .get(),
);
})
.peek(TraceUtil.promiseify(TraceUtil.traceResultingEither(Bitwarden.loginMetric)));
@@ -57,9 +60,12 @@ export class Bitwarden implements IVault<TClient, TKey, TItemId> {
.flatMap(TraceUtil.withMetricTrace(Bitwarden.unlockVaultMetric))
.map(async (tEitherWithAuthd) => {
const eitherWithAuthd = await tEitherWithAuthd.get();
- tEitherWithAuthd.trace.trace('unlocking the secret vault~ (◕ᴗ◕✿)');
return eitherWithAuthd.flatMapAsync((_) =>
- tEitherWithAuthd.move('bw unlock --passwordenv BW_PASSWORD --raw').map(getStdout).get(),
+ tEitherWithAuthd
+ .peek((t) => t.trace.trace('unlocking the secret vault~ (◕ᴗ◕✿)'))
+ .move('bw unlock --passwordenv BW_PASSWORD --raw')
+ .map(getStdout)
+ .get(),
);
})
.peek(TraceUtil.promiseify(TraceUtil.traceResultingEither(Bitwarden.unlockVaultMetric)));