Refactor requests auth handling to enable per-request token discovery
This MR refactors the igwn_auth_utils.requests
module to enable per-request auth handling.
Closes #13 (closed).
The main new features of this change are as follows
- a new
HTTPSciTokenAuth
object that implementsAuthorization
token handling on a per-request basis - token discovery for
Session
objects is deferred until the token is needed for a request, unlesstoken=True
is given - the
Session.token
attribute is now a property tied to theHTTPSciTokenAuth.token
attribute, which is likely to beNone
- basic auth and token auth are now formally exclusive
(i.e. this is documented, and not implicit - they both rely on the
Authorization
header key, so can't both be used at the same time anyway)
This is a fairly major change, but is for The Greater Good