This package patches requests at runtime to authenticate with kerberos proxy (negotiate)
Project description
kerberos-proxy-auth
This package patches requests
and urllib3
at runtime to authenticate with kerberos proxy (spnego)
Installation
a) using a NON-kerberos proxy (if available)
- set the environment variables to NON-kerberos proxy and use
pip install ...
set https_proxy=http://<NONkerberosproxy>:8080 set http_proxy=http://<NONkerberosproxy>:8080 pip install https://<path/to/this/repo>/kerberos-proxy-auth/archive/refs/heads/main.zip
b) from behind the kerberos proxy
- download this package manually as well as all its dependancies.
- run this command
pip install path/to/kerberos-proxy-auth-main.zip path/to/dependancy1.zip path/to/dependancy2.zip [...]
Usage
After installation
- set the environment variables
set https_proxy=http://<kerberosproxy>:8080 set http_proxy=http://<kerberosproxy>:8080
- start python and use
requests
,urllib3
orpip
even from behind the kerberos proxy without any further action.import requests r = requests.get('https://example.org') print(r.status_code) # expected: 200 r = requests.head('https://example.org') print(r.status_code) # expected: 200 r = requests.request('GET', 'https://example.org') print(r.status_code) # expected : 200 import urllib3, os http = urllib3.poolmanager.proxy_from_url(os.getenv('https_proxy')) r = http.request('GET', 'https://example.org') print(r.status) # expected : 200
ToDo
- test, feedback, contribute improvements
- rework to support other environments (currently only: windows/system)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for kerberos-proxy-auth-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4efe024a4096dd1807572cdec5abd1cba735cd37bf6338aed1b916a3cb558f55 |
|
MD5 | 5ae9774ade169b5e7951b2807a2d97e6 |
|
BLAKE2b-256 | 3d8e1031874785da4a29828cad235a221af1aebf2c5a2dee276ec8f7eeaf0be3 |
Close
Hashes for kerberos_proxy_auth-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74695c858269ddd0e24ada75055210d5326b7b5c0f8a20990cb2f234e361492f |
|
MD5 | af6c93e5a0d969664c3b4dc0e883facd |
|
BLAKE2b-256 | d2ad6ea33c0f4945e752bd473bf8c7dc752836be20d09f86c4725e3945bb2cdf |