pycontribs / jira

Python Jira library. Development chat available on https://matrix.to/#/#pycontribs:matrix.org
https://jira.readthedocs.io
BSD 2-Clause "Simplified" License
1.91k stars 856 forks source link

Support for Proxy Headers in JIRA Package (e.g., Proxy-Authorization) #1868

Open kuro96al opened 3 weeks ago

kuro96al commented 3 weeks ago

Bug summary

I would like to ask if the jira package supports setting proxy headers. Specifically, I need to set the Proxy-Authorization header to use a bearer token for my requests. However, I couldn't find an implementation for this in the jira package.

I'm going to provide an example of using urllib3 with proxy headers.


    proxy_headers = {
        'Proxy-Authorization': f'Bearer {access_token}',
    }
    openai_url = 'https://api.openai.com/v1/chat/completions'
    headers = {
        'Content-Type': 'application/json',
        'Authorization': f'Bearer {api_key}',
    }
    data = {
        'model': 'gpt-3.5-turbo',
        'messages': [{'role': 'user', 'content': event.get('msg', 'Hi!')}],
    }
    http = urllib3.ProxyManager(proxy_url, proxy_headers=proxy_headers)