Skip to main content

httplib2 extension that is more paranoid about input

Project description

TinfoilHat is a httplib2 extension that is more paranoid about input. It won’t allow downloading data from private IP ranges.

This library was inspired by, but is not yet as paranoid as, Perl’s LWPx::ParanoidAgent.

Example usage

TinfoilHat is a drop-in replacement for httplib2:

>>> import tinfoilhat
>>> client = tinfoilhat.Http()
>>> client.request('http://0.1.2.3/')
...
tinfoilhat.BlockedError: Host name 0.1.2.3 is blocked

You can also specify an additional blacklist as a list of regular expressions:

>>> import tinfoilhat
>>> client = tinfoilhat.Http(blacklist=['83\.\d+\.\d+\.\d+'])
>>> client.request('http://83.5.6.7')
...
tinfoilhat.BlockedError: Host name 83.5.6.7 is blocked

Author & License

This library was created by Patrice Neff for initial use at Memonic. It’s licensed under the BSD License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TinfoilHat-0.3.zip (6.8 kB view details)

Uploaded Source

File details

Details for the file TinfoilHat-0.3.zip.

File metadata

  • Download URL: TinfoilHat-0.3.zip
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for TinfoilHat-0.3.zip
Algorithm Hash digest
SHA256 95b81d0f16d8f876ec4cddf89b0d8c9106b8058942d62f237f3cd2ef3b538978
MD5 1465b7464b811ba1f939aef2fb2b2557
BLAKE2b-256 a7680c5ec9d10686f02d306e8322426f7fc4ba56345188f179a50a2a1f5edef8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page