Skip to content

feat: add Dashlane plugin#501

Open
LucasPicoli wants to merge 3 commits intodmno-dev:mainfrom
LucasPicoli:main
Open

feat: add Dashlane plugin#501
LucasPicoli wants to merge 3 commits intodmno-dev:mainfrom
LucasPicoli:main

Conversation

@LucasPicoli
Copy link
Copy Markdown

Adds @varlock/dashlane-plugin wrapping the Dashlane CLI (dcli) to resolve secrets via dl:// references. Supports pre-authenticated dcli sessions and headless auth via service device keys, multiple instances, and in-session caching.

Adds @varlock/dashlane-plugin wrapping the Dashlane CLI (dcli) to resolve
secrets via dl:// references. Supports pre-authenticated dcli sessions and
headless auth via service device keys, multiple instances, and in-session
caching.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 28, 2026

🦋 Changeset detected

Latest commit: 2b35b45

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

This PR includes changesets to release 1 package
Name Type
@varlock/dashlane-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@philmillman
Copy link
Copy Markdown
Member

Thanks for this! Will review soon

@theoephraim
Copy link
Copy Markdown
Member

@LucasPicoli - would you be using this for local dev only? Doesn't seem like they have an sdk/api to pull from in production without using the CLI - which would mirror what we do for 1pass (use sdk with service account tokens for prod)

@LucasPicoli
Copy link
Copy Markdown
Author

@theoephraim it does work for CI/prod too, not just local dev. Dashlane supports headless auth via https://cli.dashlane.com/personal/devices which the plugin accepts through serviceDeviceKeys, same bootstrap pattern as the 1pass plugin. The main difference is that they don't have any SDK or API, so it's CLI-only for both paths, similar to the pass plugin

`dcli read` works against a **local vault cache** that auto-syncs with Dashlane's servers once per hour. This means:

- Secrets changed less than 1 hour ago may not be reflected without a manual sync
- Run `dcli sync` to force a fresh sync before resolving
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we internally trigger dcli sync at the beginning of the resolution? Probably too aggressive... but maybe there is a way to check when it has been synced last and trigger it depending on that, to make it more often than 1 hr? or could add a triggerSync param within @initDashlane too?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I considered this but thought it was a bit too much overhead since the reads try and make sure everything is synced. But yeah, I think it's better if we do it on init, just to make sure everything is up to date.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do keep in mind that when doing live-reload style front-end dev, it may be reloading the config a lot. So it still probably makes sense as an option?

@@ -0,0 +1,277 @@
# @varlock/dashlane-plugin
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add the docs page to the website as well. Other plugin pages should provide a good template/example.

@@ -0,0 +1,384 @@
import {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks for adding tests. I hope to do a pass soon at providing some tooling to make it easier for plugins to include tests.

@LucasPicoli
Copy link
Copy Markdown
Author

just a note - I also noted that the dcli will not lock itself after working on it. this should be fine on interactive environments, especially if we are resolving multiple credentials. I'll make sure to add a note that tells people to lock their vaults on the instructions. however, for headless I'll make sure that we lock the vault down at the end.

Adds @varlock/dashlane-plugin wrapping the Dashlane CLI (dcli) to resolve
secrets via dl:// references. Supports pre-authenticated dcli sessions and
headless auth via service device keys, multiple instances, and in-session
caching.
- Set version to 0.0.0, remove CHANGELOG.md, add changeset
- Add dcli PATH callout to README, fix @type syntax
- Point dcli install references to official docs
- Remove dashlaneSecretRef data type
- Add automatic vault sync before first read (opt out with skipSync=true)
- Add automatic vault locking via spawnSync on process exit
- Add docs website page, sidebar entry, and overview table row
- Fix concurrent read races with in-flight promise deduplication
- Guard validateDeviceKeys against non-string input
@theoephraim
Copy link
Copy Markdown
Member

re: locking - might want to make that an option too. The default can be set based on whether it is headless or not. This might require adding a new hook or something, as I'm not sure there will be a natural place to add it. I had initially imagined lots of hooks available to plugins like this but there hasn't really been a need yet.

Also one important thing - make sure that any init / connect logic only runs when there is actually a first read triggered. You dont want it to happen on plugin init, because you may initialize the plugin in your .env.schema, but only use it in some cases, and you dont want for example a missing dcli to cause a problem if no dashlane secrets are being read.

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.

3 participants