Skip to content

Allow Deno as a VarlockEnclave IPC client #842

Description

@bjesuiter

What happened

deno run -A npm:varlock@1.9.0 load --skip-cache fails when resolving a keychain(...) secret on macOS.

Observed error:

keychain(): Failed to read keychain item: Daemon connection closed
Make sure the item exists in your Keychain and VarlockEnclave has access.

The same env file succeeds with the globally installed varlock CLI.

Why

With VARLOCK_DEBUG=1, Deno resolves the native helper from Deno's npm cache, but the decisive failure is in the native daemon's IPC client authorization.

When the Deno-cache helper daemon is started manually, it logs:

varlock: rejected IPC connection from unauthorized process (pid=..., path=/Users/.../.deno/bin/deno)

VarlockEnclave currently allows IPC clients by executable name. The allowlist includes node and bun, but not deno, so Deno is rejected before keychain-get, keychain-search, or keychain-fix-access can run.

Affected paths are likely any Varlock feature using the local encryption daemon, including keychain() and the varlock keychain subcommands.

Proposed fix

Add deno to the native daemon client allowlist, matching the existing Node/Bun runtime treatment:

 private let allowedBinaryNames: Set<String> = [
     "VarlockEnclave",        // The daemon itself (self-connections via .app bundle)
     "varlock-local-encrypt", // Rust binary (not used on macOS, but for completeness)
     "varlock",               // SEA CLI binary
     "node",                  // Node.js (varlock TS client)
     "bun",                   // Bun runtime (varlock TS client)
+    "deno",                  // Deno runtime (varlock TS client)
 ]

I validated this patch builds and the Swift test suite still passes locally with:

cd packages/encryption-binary-swift/swift
swift test

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions