Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liranmauda
Copy link
Contributor

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

Explain the changes

Issues: Fixed #xxx / Gap #xxx

Testing Instructions:

  • Doc added/updated
  • Tests added

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]>
@@ -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);
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants