Skip to content

fix(dashlane-plugin): fail fast on a locked vault, add allowMissing option - #989

Merged
theoephraim merged 3 commits into
mainfrom
dashlane-locked-vault-allow-missing
Aug 7, 2026
Merged

fix(dashlane-plugin): fail fast on a locked vault, add allowMissing option#989
theoephraim merged 3 commits into
mainfrom
dashlane-locked-vault-allow-missing

Conversation

@theoephraim

@theoephraim theoephraim commented Aug 7, 2026

Copy link
Copy Markdown
Member

Builds on #959 by @anuragbanerjee (the hang fix is cherry-picked from there with authorship preserved), with the failure-handling behavior reworked.

Problem

dashlane() resolves by spawning dcli read with piped stdio and no timeout. On a locked vault, dcli prompts for the master password on a pipe that never answers, so any varlock load / varlock run whose schema contains a dashlane() entry hangs forever.

Changes

  1. Bounded dcli calls (from fix(dashlane-plugin): don't hang forever on a locked vault (bound dcli calls, add onLocked option) #959): stdin is closed on every spawn so interactive prompts fail immediately, plus an explicit deadline as a backstop (default 30s, configurable via @initDashlane(timeoutMs=...)): SIGTERM at timeoutMs, escalating to SIGKILL and rejecting after a short grace period even if the child never exits. A locked vault now fails fast with an actionable error instead of hanging.
  2. New allowMissing option, matching the other secrets plugins (infisical, 1password, pass, etc.): settable per item (dashlane("dl://...", allowMissing=true)) or as an instance default in @initDashlane. When set, a reference that does not exist in the vault resolves empty instead of failing. Normal required/optional handling then applies, so a @required item still fails as empty.

What changed vs #959

#959 added @initDashlane(onLocked=warn), which threw the locked-vault error with warning severity and changed core so warning-severity resolution errors fall through to required/optional handling. That coupled fetch-failure tolerance to @optional: a locked vault or bad reference on an optional item would silently resolve empty.

This PR keeps failure-to-fetch a hard error regardless of required/optional. A locked or unavailable vault (including timeouts) always fails the item, even with allowMissing set. Only a genuinely missing entry can resolve empty, and only when allowMissing is opted into. The core change in config-item.ts is reverted; this is now purely a plugin change.

Tests

Locked-vault tests drive a fake dcli shim: blocked master-password prompt fails immediately, hung call fails within timeoutMs (including a dcli that traps SIGTERM), locked vault fails even optional/allowMissing items. New allowMissing tests cover per-call, instance default, per-call override, and required-still-fails. Docs updated in the plugin README and website plugins page.

Closes #959

anuragbanerjee and others added 2 commits August 7, 2026 13:19
…i calls, add onLocked option)

On a locked vault, dcli prompts for the master password on a pipe that
never answers, so any load whose schema contains a dashlane() entry hung
forever, even for optional items the current command doesn't need.

- run every dcli call with stdin closed so interactive prompts hit EOF
  and fail immediately instead of blocking
- add a spawn timeout to every dcli call as a backstop (default 30s,
  configurable via @initDashlane(timeoutMs=...)); timeouts map to the
  existing locked-vault ResolutionError
- add @initDashlane(onLocked=error|warn), default error. With warn, the
  locked-vault error is thrown as a warning so optional dashlane() items
  resolve empty and the load can still pass; required items still fail
  as empty
- varlock core: warning-severity resolution errors no longer skip
  required/optional handling (previously they bypassed the required
  check entirely)
…fails

A locked/unavailable vault is a hard failure regardless of required/optional.
Only a reference that genuinely does not exist in the vault can resolve empty,
and only when allowMissing is set (per item or as an instance default in
@initDashlane), matching the other secrets plugins. Reverts the core change
that let warning-severity resolution errors fall through to required/optional
handling.
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

bumpy-frog

The changes in this PR will be included in the next version bump.

minor Minor releases

  • @varlock/dashlane-plugin 2.0.0 → 2.1.0

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
varlock-website 2e97173 Commit Preview URL

Branch Preview URL
Aug 07 2026, 08:29 PM

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The timeout backstop can still wait forever when dcli does not terminate on SIGTERM; this should be fixed before merging because bounded execution is the central behavior of the PR.

Reviewed changes in both commits through 2e971733, covering the Dashlane process lifecycle, missing-entry semantics, tests, release note, and user documentation.

  • Bounded CLI calls: closes stdin for all asynchronous dcli calls and adds a configurable timeout with locked-vault guidance.
  • Missing-entry policy: adds instance-level and per-call allowMissing controls while preserving hard errors for lock, authentication, and timeout failures.
  • Coverage and docs: adds fake-CLI scenarios for prompts, hangs, locks, and missing entries, and documents the new behavior in both Dashlane references.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using azure/gpt-5.6-sol𝕏

Comment thread packages/plugins/dashlane/src/dashlane-instance.ts Outdated
@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/varlock@989
npm i https://pkg.pr.new/@varlock/dashlane-plugin@989

commit: 2e97173

The spawn timeout option only sends SIGTERM and the promise still waited
on the exit event, so a dcli that ignores SIGTERM would hang the load
past the advertised timeout. Now an explicit timer sends SIGTERM at
timeoutMs, then after a 2s grace period sends SIGKILL, releases the
pipes, and rejects without waiting on exit. Adds a fake-dcli mode that
traps SIGTERM to cover this.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes since the prior Pullfrog review at 2e971733, focused on the owned process deadline and its regression coverage.

  • Owned the deadline: replaced Node's signal-only spawn timeout with explicit SIGTERM and SIGKILL escalation that rejects without waiting for child exit.
  • Covered ignored termination: added a fake dcli mode that ignores SIGTERM and verified the plugin still fails within the bounded timeout window.

Pullfrog  | View workflow run | Using azure/gpt-5.6-sol𝕏

@theoephraim
theoephraim merged commit 69e798b into main Aug 7, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants