-
Notifications
You must be signed in to change notification settings - Fork 80
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
nope-ip removal - Phase 1 #8714
Conversation
@@ -578,10 +577,10 @@ function _prepare_auth_request(req) { | |||
const client_ip = net_utils.unwrap_ipv6(req.auth.client_ip); | |||
if (client_ip) { | |||
let is_allowed = false; | |||
const client_ip_val = ip_module.toLong(client_ip); | |||
const client_ip_val = net_utils.ip_toLong(client_ip); |
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'm not sure if we still need allowed_ips in accounts. maybe we should get rid of that? then we don't need most of the code 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.
@jackyalbo I have looked at it but it is completely out of scope.
We should have a run on looking at deprecated fields in the schema and remove them, including an upgrade script to verify they are no longer there.
@@ -3,7 +3,8 @@ | |||
/* eslint-disable no-control-regex */ | |||
|
|||
const _ = require('lodash'); | |||
const ip = require('ip'); | |||
const ip_module = require('ip'); |
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.
why are we just changing the name here? consistency? maybe explain here that this change is still in progress, and we plan to remove this module.
Is the effort of totally removing this module that big? the isEqual sounds easy also, CIDR doesn't suppose to be hard if we have the ip_to_long conversion
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.
This is Phase 1, as the title suggests.
The change of this name is to make it easy for us to look for ip_module.
in later PR we will address the other functions, CIDR is not that easy...
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 question is if we need 2 phases :). But sure, if you prefer to split.
nope-ip removal - Phase 1 # `net_utils` - Will no longer use the deprecated `url.parse()` and use `new URL()` instead. It is possible because we use it with .hostname, which is equal for both. - Create ip_toLong to replace the node-ip toLong # Others - Replace the use of isV4Format to net.isIPv4 - Replace the use of isV6Format to net.isIPv6 - Calling ip_toLong instead of toLong Signed-off-by: liranmauda <[email protected]>
941bbaa
to
a3a39c4
Compare
nope-ip removal - Phase 1
net_utils
url.parse()
and usenew URL()
instead. It is possible because we use it with .hostname, which is equal for both.Others
Explain the changes
Issues: Fixed #xxx / Gap #xxx
Testing Instructions: