🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

kerberos-proxy-auth

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kerberos-proxy-auth

This package patches requests at runtime to authenticate with kerberos proxy (negotiate)

0.0.2
PyPI
Maintainers
1

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 kerberos-proxy-auth
    

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 or pip 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)

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts