{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/211349761","pull_request_review_id":147750890,"id":211349761,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTM0OTc2MQ==","diff_hunk":"@@ -625,5 +627,59 @@\n     new vm.Script(source, { displayErrors: true, filename });\n   }\n \n+  function setupAllowedFlags() {\n+    // This builds process.allowedNodeEnvironmentFlags\n+    // from data in the config binding\n+\n+    const replaceDashesRegex = /-/g;\n+    const leadingDashesRegex = /^--?/;\n+    const trailingValuesRegex = /=.*$/;\n+\n+    const trimLeadingDashes = (flag) => flag.replace(leadingDashesRegex, '');\n+\n+    const {\n+      allowedV8EnvironmentFlags,\n+      allowedNodeEnvironmentFlags\n+    } = process.binding('config');\n+\n+    // for comparison purposes only\n+    const v8Flags = new Set(allowedV8EnvironmentFlags\n+      .map(trimLeadingDashes));\n+    const nodeFlags = new Set(allowedNodeEnvironmentFlags","path":"lib/internal/bootstrap/node.js","position":31,"original_position":31,"commit_id":"0483e795e624ca65500bc1dd7bb99b6907a1550d","original_commit_id":"0483e795e624ca65500bc1dd7bb99b6907a1550d","user":{"login":"ljharb","id":45469,"node_id":"MDQ6VXNlcjQ1NDY5","avatar_url":"https://avatars1.githubusercontent.com/u/45469?v=4","gravatar_id":"","url":"https://api.github.com/users/ljharb","html_url":"https://github.com/ljharb","followers_url":"https://api.github.com/users/ljharb/followers","following_url":"https://api.github.com/users/ljharb/following{/other_user}","gists_url":"https://api.github.com/users/ljharb/gists{/gist_id}","starred_url":"https://api.github.com/users/ljharb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljharb/subscriptions","organizations_url":"https://api.github.com/users/ljharb/orgs","repos_url":"https://api.github.com/users/ljharb/repos","events_url":"https://api.github.com/users/ljharb/events{/privacy}","received_events_url":"https://api.github.com/users/ljharb/received_events","type":"User","site_admin":false},"body":"It's preventing something in node core breaking because of arbitrary user code.","created_at":"2018-08-20T17:45:54Z","updated_at":"2018-08-20T17:45:54Z","html_url":"https://github.com/nodejs/node/pull/19335#discussion_r211349761","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/19335","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/211349761"},"html":{"href":"https://github.com/nodejs/node/pull/19335#discussion_r211349761"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/19335"}},"in_reply_to_id":211057861},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/19335","id":174817538,"node_id":"MDExOlB1bGxSZXF1ZXN0MTc0ODE3NTM4","html_url":"https://github.com/nodejs/node/pull/19335","diff_url":"https://github.com/nodejs/node/pull/19335.diff","patch_url":"https://github.com/nodejs/node/pull/19335.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/19335","number":19335,"state":"open","locked":false,"title":"process: add allowedNodeEnvironmentFlags property","user":{"login":"boneskull","id":924465,"node_id":"MDQ6VXNlcjkyNDQ2NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/924465?v=4","gravatar_id":"","url":"https://api.github.com/users/boneskull","html_url":"https://github.com/boneskull","followers_url":"https://api.github.com/users/boneskull/followers","following_url":"https://api.github.com/users/boneskull/following{/other_user}","gists_url":"https://api.github.com/users/boneskull/gists{/gist_id}","starred_url":"https://api.github.com/users/boneskull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boneskull/subscriptions","organizations_url":"https://api.github.com/users/boneskull/orgs","repos_url":"https://api.github.com/users/boneskull/repos","events_url":"https://api.github.com/users/boneskull/events{/privacy}","received_events_url":"https://api.github.com/users/boneskull/received_events","type":"User","site_admin":false},"body":"`process.allowedNodeEnvironmentFlags` lists all allowable flags within the `NODE_OPTIONS` environment variable.\r\n\r\n**UPDATE Aug 17 2018**: I've modified this PR to provide a friendlier API, as described [in this comment](https://github.com/nodejs/node/pull/19335#issuecomment-413701559).\r\n\r\n* * *\r\n\r\nThis change addresses #17740 as far as I need it to.  The whitelist of `NODE_OPTIONS`-able flags (not counting v8 flags) correspond to the set of flags a CLI application may want to pass along to a spawned `node` process.  Put another way, *other* Node.js-specific flags are essentially useless to CLI apps wrapping `node`.\r\n\r\n- I changed `whitelist` to be more obvious about what it's for, since it's no longer within a function.\r\n- I also changed `whitelist` to a vector to mimic the existing global static variables in `node.cc` (I didn't see a `const char * []` anywhere; don't know if this matters)\r\n- Added a test\r\n- Added documentation\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] documentation is changed or added\r\n- [x] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines)","created_at":"2018-03-13T23:28:36Z","updated_at":"2018-08-20T17:45:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"beecaf24d6b88a6414b30a1ec36e811c61dec9e7","assignee":null,"assignees":[],"requested_reviewers":[{"login":"apapirovski","id":20809,"node_id":"MDQ6VXNlcjIwODA5","avatar_url":"https://avatars2.githubusercontent.com/u/20809?v=4","gravatar_id":"","url":"https://api.github.com/users/apapirovski","html_url":"https://github.com/apapirovski","followers_url":"https://api.github.com/users/apapirovski/followers","following_url":"https://api.github.com/users/apapirovski/following{/other_user}","gists_url":"https://api.github.com/users/apapirovski/gists{/gist_id}","starred_url":"https://api.github.com/users/apapirovski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apapirovski/subscriptions","organizations_url":"https://api.github.com/users/apapirovski/orgs","repos_url":"https://api.github.com/users/apapirovski/repos","events_url":"https://api.github.com/users/apapirovski/events{/privacy}","received_events_url":"https://api.github.com/users/apapirovski/received_events","type":"User","site_admin":false},{"login":"jasnell","id":439929,"node_id":"MDQ6VXNlcjQzOTkyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/439929?v=4","gravatar_id":"","url":"https://api.github.com/users/jasnell","html_url":"https://github.com/jasnell","followers_url":"https://api.github.com/users/jasnell/followers","following_url":"https://api.github.com/users/jasnell/following{/other_user}","gists_url":"https://api.github.com/users/jasnell/gists{/gist_id}","starred_url":"https://api.github.com/users/jasnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasnell/subscriptions","organizations_url":"https://api.github.com/users/jasnell/orgs","repos_url":"https://api.github.com/users/jasnell/repos","events_url":"https://api.github.com/users/jasnell/events{/privacy}","received_events_url":"https://api.github.com/users/jasnell/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":155267502,"node_id":"MDU6TGFiZWwxNTUyNjc1MDI=","url":"https://api.github.com/repos/nodejs/node/labels/C++","name":"C++","color":"e11d21","default":false},{"id":523004170,"node_id":"MDU6TGFiZWw1MjMwMDQxNzA=","url":"https://api.github.com/repos/nodejs/node/labels/cli","name":"cli","color":"bfd4f2","default":false},{"id":207521371,"node_id":"MDU6TGFiZWwyMDc1MjEzNzE=","url":"https://api.github.com/repos/nodejs/node/labels/process","name":"process","color":"00aaff","default":false},{"id":169485478,"node_id":"MDU6TGFiZWwxNjk0ODU0Nzg=","url":"https://api.github.com/repos/nodejs/node/labels/semver-minor","name":"semver-minor","color":"fef2c0","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/19335/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/19335/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/19335/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/0483e795e624ca65500bc1dd7bb99b6907a1550d","head":{"label":"boneskull:env-flags","ref":"env-flags","sha":"0483e795e624ca65500bc1dd7bb99b6907a1550d","user":{"login":"boneskull","id":924465,"node_id":"MDQ6VXNlcjkyNDQ2NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/924465?v=4","gravatar_id":"","url":"https://api.github.com/users/boneskull","html_url":"https://github.com/boneskull","followers_url":"https://api.github.com/users/boneskull/followers","following_url":"https://api.github.com/users/boneskull/following{/other_user}","gists_url":"https://api.github.com/users/boneskull/gists{/gist_id}","starred_url":"https://api.github.com/users/boneskull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boneskull/subscriptions","organizations_url":"https://api.github.com/users/boneskull/orgs","repos_url":"https://api.github.com/users/boneskull/repos","events_url":"https://api.github.com/users/boneskull/events{/privacy}","received_events_url":"https://api.github.com/users/boneskull/received_events","type":"User","site_admin":false},"repo":{"id":77440847,"node_id":"MDEwOlJlcG9zaXRvcnk3NzQ0MDg0Nw==","name":"node","full_name":"boneskull/node","owner":{"login":"boneskull","id":924465,"node_id":"MDQ6VXNlcjkyNDQ2NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/924465?v=4","gravatar_id":"","url":"https://api.github.com/users/boneskull","html_url":"https://github.com/boneskull","followers_url":"https://api.github.com/users/boneskull/followers","following_url":"https://api.github.com/users/boneskull/following{/other_user}","gists_url":"https://api.github.com/users/boneskull/gists{/gist_id}","starred_url":"https://api.github.com/users/boneskull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boneskull/subscriptions","organizations_url":"https://api.github.com/users/boneskull/orgs","repos_url":"https://api.github.com/users/boneskull/repos","events_url":"https://api.github.com/users/boneskull/events{/privacy}","received_events_url":"https://api.github.com/users/boneskull/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/boneskull/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":true,"url":"https://api.github.com/repos/boneskull/node","forks_url":"https://api.github.com/repos/boneskull/node/forks","keys_url":"https://api.github.com/repos/boneskull/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boneskull/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boneskull/node/teams","hooks_url":"https://api.github.com/repos/boneskull/node/hooks","issue_events_url":"https://api.github.com/repos/boneskull/node/issues/events{/number}","events_url":"https://api.github.com/repos/boneskull/node/events","assignees_url":"https://api.github.com/repos/boneskull/node/assignees{/user}","branches_url":"https://api.github.com/repos/boneskull/node/branches{/branch}","tags_url":"https://api.github.com/repos/boneskull/node/tags","blobs_url":"https://api.github.com/repos/boneskull/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boneskull/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boneskull/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/boneskull/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boneskull/node/statuses/{sha}","languages_url":"https://api.github.com/repos/boneskull/node/languages","stargazers_url":"https://api.github.com/repos/boneskull/node/stargazers","contributors_url":"https://api.github.com/repos/boneskull/node/contributors","subscribers_url":"https://api.github.com/repos/boneskull/node/subscribers","subscription_url":"https://api.github.com/repos/boneskull/node/subscription","commits_url":"https://api.github.com/repos/boneskull/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/boneskull/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/boneskull/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/boneskull/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/boneskull/node/contents/{+path}","compare_url":"https://api.github.com/repos/boneskull/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boneskull/node/merges","archive_url":"https://api.github.com/repos/boneskull/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boneskull/node/downloads","issues_url":"https://api.github.com/repos/boneskull/node/issues{/number}","pulls_url":"https://api.github.com/repos/boneskull/node/pulls{/number}","milestones_url":"https://api.github.com/repos/boneskull/node/milestones{/number}","notifications_url":"https://api.github.com/repos/boneskull/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boneskull/node/labels{/name}","releases_url":"https://api.github.com/repos/boneskull/node/releases{/id}","deployments_url":"https://api.github.com/repos/boneskull/node/deployments","created_at":"2016-12-27T08:51:03Z","updated_at":"2018-08-13T18:27:35Z","pushed_at":"2018-08-17T23:33:15Z","git_url":"git://github.com/boneskull/node.git","ssh_url":"git@github.com:boneskull/node.git","clone_url":"https://github.com/boneskull/node.git","svn_url":"https://github.com/boneskull/node","homepage":"https://nodejs.org","size":378415,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"7cbbb27c0721ced7b74fc39033c8485b8d2ad864","user":{"login":"nodejs","id":9950313,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NTAzMTM=","avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"node_id":"MDEwOlJlcG9zaXRvcnkyNzE5Mzc3OQ==","name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk5NTAzMTM=","avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2018-08-20T16:58:56Z","pushed_at":"2018-08-20T16:57:55Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":402827,"stargazers_count":52444,"watchers_count":52444,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11086,"mirror_url":null,"archived":false,"open_issues_count":847,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":11086,"open_issues":847,"watchers":52444,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/19335"},"html":{"href":"https://github.com/nodejs/node/pull/19335"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/19335"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/19335/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/19335/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/19335/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/0483e795e624ca65500bc1dd7bb99b6907a1550d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ljharb"}}