JordanMilne / Advocate

An SSRF-preventing wrapper around Python's requests library. Advocate is no longer maintained, please fork and rename if you would like to continue work on it.
Other
92 stars 17 forks source link

Unvendor ipaddress package #15

Closed Gee19 closed 3 years ago

Gee19 commented 3 years ago

Fixes #9

Doing some testing now but this probably breaks py2 support.

Really appreciate the work you have done on this library <3

codecov[bot] commented 3 years ago

Codecov Report

Merging #15 (eb8b822) into master (6d699ae) will decrease coverage by 1.25%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #15      +/-   ##
==========================================
- Coverage   96.73%   95.47%   -1.26%     
==========================================
  Files           9        9              
  Lines         398      398              
==========================================
- Hits          385      380       -5     
- Misses         13       18       +5     
Impacted Files Coverage Δ
advocate/addrvalidator.py 92.18% <100.00%> (-3.91%) :arrow_down:
advocate/connection.py 94.25% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6d699ae...eb8b822. Read the comment docs.

JordanMilne commented 3 years ago

Thanks for the PR!

Right now I still support Advocate on Python 2 and the tests for it are failing. If there's a way to add a requirement for one of the API-compatible ipaddress polyfills when running on Python 2 I think that'd be the best approach.

IIRC the last time I looked into this, the ipaddress polyfills I found on PyPI (like https://github.com/phihag/ipaddress) required the addresses to be unicodes under Python 2, and that'd be a breaking change from how things are now.

Gee19 commented 3 years ago

Looks like this is being addressed in #16