connectordb/_connection.py
def setauth(self, user_or_apikey=None, user_password=None):
        """ setauth sets the authentication header for use in the session.
        It is for use when apikey is updated or something of the sort, such that
        there is a seamless experience. """
        auth = None
        if user_or_apikey is not None:
            # ConnectorDB allows login using both basic auth or an apikey url param.
            # The python client uses basic auth for all logins
            if user_password is None:
                # Login by api key - the basic auth login uses "" user and
                # apikey as password
                user_password = user_or_apikey
                user_or_apikey = ""
            auth = HTTPBasicAuth(user_or_apikey, user_password)
            self.r.auth = auth

        # Set the websocket's authentication
        self.ws.setauth(auth)
def setauth(self, user_or_apikey=None, user_password=None):
        """ setauth sets the authentication header for use in the session.
        It is for use when apikey is updated or something of the sort, such that
        there is a seamless experience. """
        auth = None
        if user_or_apikey is not None:
            # ConnectorDB allows login using both basic auth or an apikey url param.
            # The python client uses basic auth for all logins
            if user_password is None:
                # Login by api key - the basic auth login uses "" user and
                # apikey as password
                user_password = user_or_apikey
                user_or_apikey = ""
            auth = HTTPBasicAuth(user_or_apikey, user_password)
            self.r.auth = auth

        # Set the websocket's authentication
        self.ws.setauth(auth)
def setauth ( self , user_or_apikey = None , user_password = None ) : auth = None if user_or_apikey is not None : # ConnectorDB allows login using both basic auth or an apikey url param. # The python client uses basic auth for all logins if user_password is None : # Login by api key - the basic auth login uses "" user and # apikey as password user_password = user_or_apikey user_or_apikey = "" auth = HTTPBasicAuth ( user_or_apikey , user_password ) self . r . auth = auth # Set the websocket's authentication self . ws . setauth ( auth )
setauth sets the authentication header for use in the session.
        It is for use when apikey is updated or something of the sort, such that
        there is a seamless experience.
setauth sets the authentication header for use in the session . It is for use when apikey is updated or something of the sort such that there is a seamless experience .