Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(inputs.whois): Add plugin #16509
base: master
Are you sure you want to change the base?
feat(inputs.whois): Add plugin #16509
Changes from 17 commits
67e03e4
a04eea9
aaeb51f
daa605b
4caa207
c0fef67
a4ddc91
9bc3078
4bdd1aa
b28227c
4aa3331
7ebddd1
27a8079
b3ff6a5
ce03686
c3c0720
00f64c0
dc06f2c
e7265bc
566a1ed
8d87414
e05a548
f7f2417
3ecdae9
a07d1c6
94a4b68
d3a6bd9
573713f
1e4af8b
e83026d
a4be1b6
4b78e3e
4067f6f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 would really appreciate if we can get rid of this indirection that is solely there for testing. Can we rather mock a WHOIS server response in the tests? In any case this could be
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 removed the code function overwrite in the tests also. Please double-check for now.
However, you want to have some tests like this for this plugin? With some custom files on this side?
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.
Exactly. We do have some tests (e.g. here) with some "test cases" being a self-contained directly each and some testing mock to send the test-case data to the plugin...
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.
Missing the default value for
Server
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.
Thanks for the heads-up. This makes me find the
server
sent to the Client is not working with the same behavior as being empty. I have different outputs if I sendwhois.iana.org
as aserver
or if I send nothing to the client.Output setting server as empty:
Output setting server as the supposed default
whois.iana.org
:Technically, what is happening is (like
whois
CLI), when we send aserver,
thewhois
won't follow redirection if it is not explicitly defined, which leads to only parsing the data from the TLD, which is this case is.com
Result with the default behavior:
Results explicitly saying to follow redirects when the server is set:
So, I do not understand why the library is not respecting the
disableReferral,
which by default isfalse,
but either way, it seems the return comes from here.Due to these concerns, does it make sense to support custom whois servers, or should we open an issue and let that happen for the next interaction?
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.
The main issue is on this line. When a server is provided, in the end, they return an answer from all the steps. When is not provided, the library will get the server at this point, query directly the server here and if there is not any additional whois referral server, will return here.
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 guess it is best to report that issue upstream, since they are providing a way to set a custom server, it should be supported.
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.
likexian/whois#55