client's auth argument is ignored
igwn_alert.client
has an argument:
auth : :class:`Auth <hop.auth.Auth>` (optional)
A :code:`hop.auth.Auth` object.
However, __init__
completely ignores this, except in the possible edge case where netrc_auth is not None
is reached and evaluates to False
here.
Assuming we want auth
to take precedence over any other arguments (which seems sensible to me), we should change the conditional block to look something like this:
if noauth:
auth = False
else:
if auth is not None:
pass
elif (username and password):
auth = Auth(username, password)
Here is a simple example that should set up a client using an Auth
object, and print True
, but instead sets up an unauthenticated session
from hop.auth import Auth
from igwn_alert import client
auth = Auth("test_username", "test_password")
c = client(auth=auth)
print(auth is c.auth_obj)
Output:
/cvmfs/oasis.opensciencegrid.org/ligo/sw/conda/envs/igwn-py39/lib/python3.9/site-packages/igwn_alert/client.py:156: UserWarning: No authentication found. Proceeding with unathenticated session
warnings.warn("No authentication found. Proceeding "
False