Repository navigation
Ideas for making permission sets portable: env vars in paths, merging CLI flags, path patterns #35757
Replies: 1 comment
|
Thanks for the detailed writeup! Good news: all three of these ideas are already tracked as feature requests, so I'll close this discussion and invite you to continue the conversation on the issues directly — the concrete use cases here (npm auth via
Feel free to 👍 and add your use cases on those issues — it helps with prioritization. |
Uh oh!
There was an error while loading. Please reload this page.
I've been converting my tasks over to the experimental
permissionsconfig indeno.json(#25651) and really like the direction — a declarative sandbox per task is exactly what I wanted. In practice though, I keep hitting a wall with paths that vary per machine, and I'd love to hear how others are handling this and whether any of the ideas below fit the feature's direction. Observations from Deno 2.9.1.The core problem: permission set paths are literal, so machine-dependent paths can't be expressed.
$HOME,${HOME}, and~don't expand, so grants like~/.npmrc(npm auth) or the defaultDENO_DIRcache location can't be written portably in the set.The natural workaround is to append them via the task string, where the task shell does expand env vars:
…but a CLI
--allow-readreplaces the set'sread.allowlist rather than merging with it, so every read grant has to migrate out of the set and onto the flag — which mostly defeats the declarative config. (Interestingly, the set'sread.ignorelist does survive the CLI flag, so there's already a mix of replace and merge semantics.)A related ergonomic issue: with no glob or name-based patterns, silencing Node-style resolution walk-ups means enumerating every ancestor by hand. From my real config:
Ideas (any one of which would cover my use case):
"read": ["$HOME/.npmrc"], resolved when the set is loaded.**/node_modules, or a dedicated "in any ancestor directory" form aimed at the walk-up case.Is any of this on the roadmap for the experimental feature, and is there interest in a PR for any of these directions? Curious how others are structuring their sets around per-machine paths in the meantime.
All reactions