def add_security_params(self, params): """ Utility method that add `timestamp` and `signature` keys to params. """ timestamp = util.make_timestamp() signature = util.make_signature(params, timestamp, user=params.get('user')) params['timestamp'] = timestamp params['signature'] = signature return params
def api_search(self): logger.info("URL:API-search") commune_id = pick_commune() job = pick_job_rome() params = { 'commune_id': commune_id, 'rome_codes': job, 'user': '******', } timestamp = util.make_timestamp() signature = util.make_signature(params, timestamp, user=params.get('user')) params['timestamp'] = timestamp params['signature'] = signature url = '/api/v1/company/?%s' % urllib.parse.urlencode(params) logger.info("GET %s", url) self.client.get(url)