hydroshare / hsclient

A python client for interacting with HydroShare in an object oriented way.
https://hydroshare.github.io/hsclient/
BSD 3-Clause "New" or "Revised" License
1 stars 4 forks source link

Cannot create OAuth Session when creating HydroShare object #28

Closed aaraney closed 2 years ago

aaraney commented 2 years ago

The HydroShare object intends to allows a user to create a session using oauth credentials. However, HydroShareSession's constructor enforces username and password as positional/keyword arguments without a default (see below). So, this causes a HydroShare object to fail to construct when passing in oauth credentials as it does not specify a username or password.

See source

class HydroShareSession:
    def __init__(self, username, password, host, protocol, port, client_id=None, token=None):
        ...

Having already talked to @sblack-usu about this, the proposed solution is to make the username, password,client_id, andtokenparameters keyword only arguments with a default value ofNone`. Ill ref the PR that implements this solution and should close this issue here.