Making HTTP(S) requests with IGWN Auth Utils

igwn_auth_utils provides a requests interface to support HTTP/HTTPS requests with the IGWN Auth flow.

Basic usage

To use this interface, open a Session and make some requests:

>>> from igwn_auth_utils import Session
>>> with Session() as sess:
...     sess.get("https://myservice.example.com/api/important/data")

The igwn_auth_utils.Session class will automatically discover available SciTokens and X.509 credentials and will send them with the request to maximise chances of a successfull authorisation.

See the igwn_auth_utils.Session documentation for details on keywords that enable configuring the discovery of each of the credential types, including disabling/enabling individual credential types, or disabling all credentials completely.

API

get

Send an HTTP GET request to the specified URL with IGWN Auth attached.

request

Send a request of the specific method to the specified URL.

HTTPSciTokenAuth

Auth handler for SciTokens.

Session

requests.Session class with default IGWN authorization handling.

SessionAuthMixin

Mixin for requests.Session to add support for IGWN auth.

Other request methods

Only the get() and request() functions are available from the top-level module interface, however all HTTP methods are supported via functions in the igwn_auth_utils.requests module:

igwn_auth_utils.requests.delete

Send an HTTP DELETE request to the specified URL with IGWN Auth attached.

igwn_auth_utils.requests.head

Send an HTTP HEAD request to the specified URL with IGWN Auth attached.

igwn_auth_utils.requests.patch

Send an HTTP PATCH request to the specified URL with IGWN Auth attached.

igwn_auth_utils.requests.post

Send an HTTP POST request to the specified URL with IGWN Auth attached.

igwn_auth_utils.requests.put

Send an HTTP PUT request to the specified URL with IGWN Auth attached.