def post(self): logsecret = self.request.get('key') official_log_secret = passphrase_dao.get_log_secret() if logsecret != official_log_secret: logging.error("Logging: Bad logging secret: %s vs %s"%(logsecret, official_log_secret)) return eventtype = self.request.get('event') if eventtype not in constants.LOGGING.CLIENT_EVENT and \ eventtype not in constants.LOGGING.API_EVENT: logging.error("Unknown event type: %s"%eventtype) return diction = {} for args in self.request.arguments(): diction[args] = self.request.get(args) logs_dao.save_log(diction) return
def create(diction): diction['key'] = passphrase_dao.get_log_secret() assert ('event' in diction), "Logs must always have an event type" __url_async_post(constants.LOGGING.PATH, diction)