python-ipware 2.0.1__py3-none-any.whl → 2.0.3__py3-none-any.whl

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.
@@ -1 +1 @@
1
- __version__ = "2.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
- logging.info("Invalid ip address. {0}".format(ip_str))
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
- logging.warning("Invalid ip list provided.")
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.1
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
@@ -0,0 +1,9 @@
1
+ python_ipware/__init__.py,sha256=TCZx4mt5Gxr2D_zNU6j0ynopdsAN_v4xeiTWz1OXSpY,87
2
+ python_ipware/__version__.py,sha256=_GEKEa6BYjBV34SZkSlAR87aCM5Y9G0aSI0LXL52iJg,22
3
+ python_ipware/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ python_ipware/python_ipware.py,sha256=kAoCyLbJLxN-zocHB9Ps-AdZYWMUQ8KasHscg6Qcc3Q,12119
5
+ python_ipware-2.0.3.dist-info/LICENSE,sha256=MLpNxpqfTc4TLdcDk3x6k7Vz4lJGBNLV-SxQZlFMDU8,1103
6
+ python_ipware-2.0.3.dist-info/METADATA,sha256=cwAXk8j8o_cfJUfZT9tQ3sCwjRa6OQRVVX89juDwJgA,14857
7
+ python_ipware-2.0.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
8
+ python_ipware-2.0.3.dist-info/top_level.txt,sha256=URE4dvjpReJtRHyQpJqoBow5EWt_RqVXFn85B9Tq5Xw,14
9
+ python_ipware-2.0.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,9 +0,0 @@
1
- python_ipware/__init__.py,sha256=TCZx4mt5Gxr2D_zNU6j0ynopdsAN_v4xeiTWz1OXSpY,87
2
- python_ipware/__version__.py,sha256=wAxkK8w13vqoF47A8iqWdSlIgRRXmZiQ0R4wePZfzhs,22
3
- python_ipware/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- python_ipware/python_ipware.py,sha256=PacCjg03wsKID34e7FMO5dJnaus2GUvV20_eVew3SzY,12032
5
- python_ipware-2.0.1.dist-info/LICENSE,sha256=MLpNxpqfTc4TLdcDk3x6k7Vz4lJGBNLV-SxQZlFMDU8,1103
6
- python_ipware-2.0.1.dist-info/METADATA,sha256=ccujv0l5NTyvrVRtlhKcFmsrjIZsMOsE5n20bcaUILw,14814
7
- python_ipware-2.0.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
8
- python_ipware-2.0.1.dist-info/top_level.txt,sha256=URE4dvjpReJtRHyQpJqoBow5EWt_RqVXFn85B9Tq5Xw,14
9
- python_ipware-2.0.1.dist-info/RECORD,,