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¶
Send an HTTP GET request to the specified URL with IGWN Auth attached. |
|
Send a request of the specific method to the specified URL. |
|
Auth handler for SciTokens. |
|
|
|
Mixin for |
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:
Send an HTTP DELETE request to the specified URL with IGWN Auth attached. |
|
Send an HTTP HEAD request to the specified URL with IGWN Auth attached. |
|
Send an HTTP PATCH request to the specified URL with IGWN Auth attached. |
|
Send an HTTP POST request to the specified URL with IGWN Auth attached. |
|
Send an HTTP PUT request to the specified URL with IGWN Auth attached. |