(self)
Return auth headers. Will use API Keys if present in settings.
Return auth headers. Will use API Keys if present in settings.
Return auth headers . Will use API Keys if present in settings .
def __get_auth(self):
        '''Return auth headers. Will use API Keys if present in settings.'''

        if self.shouldAuth is False:
            return []

        if not settings.API_KEY:
            self.logger.info("Authenticating with email/password.")
            return [
                "email: " + settings.LOGIN,
                "password: " + settings.PASSWORD
            ]
        else:
            self.logger.info("Authenticating with API Key.")
            # To auth to the WS using an API key, we generate a signature of a nonce and
            # the WS API endpoint.
            nonce = generate_nonce()
            return [
                "api-nonce: " + str(nonce),
                "api-signature: " + generate_signature(settings.API_SECRET, 'GET', '/realtime', nonce, ''),
                "api-key:" + settings.API_KEY
            ]
def __get_auth ( self ) : if self . shouldAuth is False : return [ ] if not settings . API_KEY : self . logger . info ( "Authenticating with email/password." ) return [ "email: " + settings . LOGIN , "password: " + settings . PASSWORD ] else : self . logger . info ( "Authenticating with API Key." ) # To auth to the WS using an API key, we generate a signature of a nonce and # the WS API endpoint. nonce = generate_nonce ( ) return [ "api-nonce: " + str ( nonce ) , "api-signature: " + generate_signature ( settings . API_SECRET , 'GET' , '/realtime' , nonce , '' ) , "api-key:" + settings . API_KEY ]