-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
util: Adding warnings when NODE_DEBUG is set as http/http2 #21914
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
Conversation
ChALkeR
left a comment
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.
See inline comment — we need to make sure that the warning does not get emitted multiple times.
Disregard my comment, the flag is not required here, it already gets cached.
lib/util.js
Outdated
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.
can exposes
I am not a native English speaker, but this needs rewording.
|
@ChALkeR Thanks, have made the correction. As I have mentioned on my PR, the test case is failing. Not sure where is the mistake. Thanks for your help on this. |
lib/util.js
Outdated
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.
fwiw, this is likely also true of http2
|
@jasnell Thanks for reviewing the code. Taken care for Also made the test case pass for another method: I tried adding these assertions in |
lib/util.js
Outdated
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.
Imo, this needs to be made more explicit, something along «… can expose sensitive data (including passwords, tokens, authentication headers) in the resulting log.»
Lines 298 to 307 in 28a3e28
|
|
@richardlau Thanks, that make sense. Let me know if all good. |
ChALkeR
left a comment
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.
Rubber-stump LGTM. I have not tested this locally, though, but code and message look good to me.
I would prefer to wait a bit more for more comments from others (re: message and other things) though.
|
/cc @nodejs/collaborators |
lib/util.js
Outdated
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.
Optional suggested text changes:
- s/including/such as/
- s/tokens, authentication/tokens, and authentication/
Tests will need to be updated to reflect any changes here, of course.
|
@nodejs/tsc What's the semver-ness of adding a warning? We treat runtime deprecation warnings as Adding |
|
@antsmartian Won't this trigger the warning twice on |
|
@ChALkeR: Yes it will if the same code imports both will give us two warnings: one for |
|
Ah, in fact it's ok if the message is different in that aspect. |
|
@Trott Addressed your comments. Also thanks for fixing minor punctuation issues in comment section. |
mcollina
left a comment
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
SomeoneWeird
left a comment
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. Much needed. Have seen this go very wrong before.
|
I'm planning to land next Monday morning (CEST), please comment before then. |
|
Landed in 980877f |
|
@mcollina Was that landed manually or with help of |
|
Thanks everyone ! |
|
I’ve used ncu. |
|
@mcollina Thanks! |
I have fixed the issue #21774 (related to
NODE_DEBUG=httppart). There are couple of things I wanted to understand here:util.jsis the right place for inserting this check. This should be fine I guess. Please let me know otherwise.debugEnvRegextestis not working when we set theNODE_DEBUGfrom code, so warning is not getting triggered. I didmake -j4and tested manually with build, and I could able to see warning like the following:So somewhere, I'm making a mistake in my test.
Thanks for your time on this.
make -j4 test(UNIX), orvcbuild test(Windows) passes