python-ipware 2.0.1__tar.gz → 2.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python-ipware-2.0.1/python_ipware.egg-info → python-ipware-2.0.3}/PKG-INFO +2 -1
- {python-ipware-2.0.1 → python-ipware-2.0.3}/README.md +1 -0
- python-ipware-2.0.3/python_ipware/__version__.py +1 -0
- {python-ipware-2.0.1 → python-ipware-2.0.3}/python_ipware/python_ipware.py +5 -2
- {python-ipware-2.0.1 → python-ipware-2.0.3/python_ipware.egg-info}/PKG-INFO +2 -1
- python-ipware-2.0.1/python_ipware/__version__.py +0 -1
- {python-ipware-2.0.1 → python-ipware-2.0.3}/LICENSE +0 -0
- {python-ipware-2.0.1 → python-ipware-2.0.3}/pyproject.toml +0 -0
- {python-ipware-2.0.1 → python-ipware-2.0.3}/python_ipware/__init__.py +0 -0
- {python-ipware-2.0.1 → python-ipware-2.0.3}/python_ipware/py.typed +0 -0
- {python-ipware-2.0.1 → python-ipware-2.0.3}/python_ipware.egg-info/SOURCES.txt +0 -0
- {python-ipware-2.0.1 → python-ipware-2.0.3}/python_ipware.egg-info/dependency_links.txt +0 -0
- {python-ipware-2.0.1 → python-ipware-2.0.3}/python_ipware.egg-info/requires.txt +0 -0
- {python-ipware-2.0.1 → python-ipware-2.0.3}/python_ipware.egg-info/top_level.txt +0 -0
- {python-ipware-2.0.1 → python-ipware-2.0.3}/setup.cfg +0 -0
- {python-ipware-2.0.1 → python-ipware-2.0.3}/tests/tests_ipv4.py +0 -0
- {python-ipware-2.0.1 → python-ipware-2.0.3}/tests/tests_ipv6.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-ipware
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: A Python package to retrieve user's IP address
|
|
5
5
|
Author-email: Val Neekman <info@neekware.com>
|
|
6
6
|
License: MIT
|
|
@@ -134,6 +134,7 @@ request_headers_precedence_order = (
|
|
|
134
134
|
"HTTP_X_CLUSTER_CLIENT_IP", # Rackspace LB and Riverbed Stingray
|
|
135
135
|
"HTTP_FORWARDED_FOR", # RFC 7239
|
|
136
136
|
"HTTP_FORWARDED", # RFC 7239
|
|
137
|
+
"HTTP_CF_CONNECTING_IP", # CloudFlare
|
|
137
138
|
"X-CLIENT-IP", # Microsoft Azure
|
|
138
139
|
"X-REAL-IP", # NGINX
|
|
139
140
|
"X-CLUSTER-CLIENT-IP", # Rackspace Cloud Load Balancers
|
|
@@ -103,6 +103,7 @@ request_headers_precedence_order = (
|
|
|
103
103
|
"HTTP_X_CLUSTER_CLIENT_IP", # Rackspace LB and Riverbed Stingray
|
|
104
104
|
"HTTP_FORWARDED_FOR", # RFC 7239
|
|
105
105
|
"HTTP_FORWARDED", # RFC 7239
|
|
106
|
+
"HTTP_CF_CONNECTING_IP", # CloudFlare
|
|
106
107
|
"X-CLIENT-IP", # Microsoft Azure
|
|
107
108
|
"X-REAL-IP", # NGINX
|
|
108
109
|
"X-CLUSTER-CLIENT-IP", # Rackspace Cloud Load Balancers
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.0.3"
|
|
@@ -6,6 +6,8 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|
|
6
6
|
IpAddressType = Union[ipaddress.IPv4Address, ipaddress.IPv6Address]
|
|
7
7
|
OptionalIpAddressType = Optional[IpAddressType]
|
|
8
8
|
|
|
9
|
+
logger = logging.getLogger(__name__)
|
|
10
|
+
|
|
9
11
|
|
|
10
12
|
class IpWareMeta:
|
|
11
13
|
"""
|
|
@@ -26,6 +28,7 @@ class IpWareMeta:
|
|
|
26
28
|
"HTTP_X_CLUSTER_CLIENT_IP", # Rackspace LB and Riverbed Stingray
|
|
27
29
|
"HTTP_FORWARDED_FOR", # RFC 7239
|
|
28
30
|
"HTTP_FORWARDED", # RFC 7239
|
|
31
|
+
"HTTP_CF_CONNECTING_IP", # CloudFlare
|
|
29
32
|
"X-CLIENT-IP", # Microsoft Azure
|
|
30
33
|
"X-REAL-IP", # NGINX
|
|
31
34
|
"X-CLUSTER-CLIENT-IP", # Rackspace Cloud Load Balancers
|
|
@@ -105,7 +108,7 @@ class IpWareIpAddress:
|
|
|
105
108
|
ip = ipaddress.IPv4Address(ipv4)
|
|
106
109
|
except ipaddress.AddressValueError:
|
|
107
110
|
# not a valid IP address, return None
|
|
108
|
-
|
|
111
|
+
logger.info("Invalid ip address. {0}".format(ip_str))
|
|
109
112
|
ip = None
|
|
110
113
|
return ip
|
|
111
114
|
|
|
@@ -324,7 +327,7 @@ class IpWare(IpWareMeta, IpWareProxy, IpWareIpAddress):
|
|
|
324
327
|
"""
|
|
325
328
|
|
|
326
329
|
if not ip_list:
|
|
327
|
-
|
|
330
|
+
logger.warning("Invalid ip list provided.")
|
|
328
331
|
return None, False
|
|
329
332
|
|
|
330
333
|
# the incoming ips match our trusted proxy list
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-ipware
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: A Python package to retrieve user's IP address
|
|
5
5
|
Author-email: Val Neekman <info@neekware.com>
|
|
6
6
|
License: MIT
|
|
@@ -134,6 +134,7 @@ request_headers_precedence_order = (
|
|
|
134
134
|
"HTTP_X_CLUSTER_CLIENT_IP", # Rackspace LB and Riverbed Stingray
|
|
135
135
|
"HTTP_FORWARDED_FOR", # RFC 7239
|
|
136
136
|
"HTTP_FORWARDED", # RFC 7239
|
|
137
|
+
"HTTP_CF_CONNECTING_IP", # CloudFlare
|
|
137
138
|
"X-CLIENT-IP", # Microsoft Azure
|
|
138
139
|
"X-REAL-IP", # NGINX
|
|
139
140
|
"X-CLUSTER-CLIENT-IP", # Rackspace Cloud Load Balancers
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.0.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|