-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update validator to remove Node vm dependency #53
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these implementations are equivalent. The current implementation runs the code in a completely new V8 context (https://nodejs.org/api/vm.html#what-does-it-mean-to-contextify-an-object). The proposed change runs the code in the same context with access to the parent scope.
I'm interested to hear @davidmarkclements's and @mcollina's views on this.
Why would you do this? |
I would like to use fast-redact in a Deno project, but Deno currently does not support vm. While the code running has access to the parent scope it should have no side effects, and vm should not be used as a security mechanism per the node documentation. Related Article |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I don't think vm is actually needed here. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [fast-redact](https://togithub.com/davidmarkclements/fast-redact) | [`^3.1.2` -> `^3.2.0`](https://renovatebot.com/diffs/npm/fast-redact/3.1.2/3.2.0) | [![age](https://badges.renovateapi.com/packages/npm/fast-redact/3.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/fast-redact/3.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/fast-redact/3.2.0/compatibility-slim/3.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/fast-redact/3.2.0/confidence-slim/3.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>davidmarkclements/fast-redact</summary> ### [`v3.2.0`](https://togithub.com/davidmarkclements/fast-redact/releases/tag/v3.2.0) [Compare Source](https://togithub.com/davidmarkclements/fast-redact/compare/v3.1.2...v3.2.0) ##### What's Changed - docs(paths): add a specific call-out for hyphens by [@​dncrews](https://togithub.com/dncrews) in [https://github.com/davidmarkclements/fast-redact/pull/56](https://togithub.com/davidmarkclements/fast-redact/pull/56) - fix: updated redaction mechanism for wild cards above level 2 by [@​gurjotkaur20](https://togithub.com/gurjotkaur20) in [https://github.com/davidmarkclements/fast-redact/pull/58](https://togithub.com/davidmarkclements/fast-redact/pull/58) - Update validator to remove Node vm dependency by [@​mikehw](https://togithub.com/mikehw) in [https://github.com/davidmarkclements/fast-redact/pull/53](https://togithub.com/davidmarkclements/fast-redact/pull/53) ##### New Contributors - [@​dncrews](https://togithub.com/dncrews) made their first contribution in [https://github.com/davidmarkclements/fast-redact/pull/56](https://togithub.com/davidmarkclements/fast-redact/pull/56) - [@​gurjotkaur20](https://togithub.com/gurjotkaur20) made their first contribution in [https://github.com/davidmarkclements/fast-redact/pull/58](https://togithub.com/davidmarkclements/fast-redact/pull/58) - [@​mikehw](https://togithub.com/mikehw) made their first contribution in [https://github.com/davidmarkclements/fast-redact/pull/53](https://togithub.com/davidmarkclements/fast-redact/pull/53) **Full Changelog**: davidmarkclements/fast-redact@v3.1.2...v3.2.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - "after 8:00 before 23:00 every weekday except on Friday" in timezone UTC. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/valora-inc/logging). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS45My4wIiwidXBkYXRlZEluVmVyIjoiMzUuOTMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Removing
vm
references and replacing the validation code with a Function eval.This change should enable the use of fast-redact in browsers and Deno.
Addresses issue #37