def burp_import(path): requests = {} content = reader(path) matches = re.finditer(burp_regex, content) for match in matches: request = parse_request(match.group(4)) url = match.group(1) requests[url] = request['data'] return requests
def list(self, request): query, limit, user_agent, ip_address = parse_request(request) save_query_with_metadata.delay(query, user_agent, ip_address) queryset = self.get_queryset(query) tailored_skills = sort_skills(queryset)[:limit] data = OrderedDict({ "vacancy_name": query, "number_of_vacancies": len(queryset), "rated_skills": tailored_skills, }) return Response(data)
def get_queryset(self): query, limit, user_agent, ip_address = parse_request(self.request) save_query_with_metadata.delay(query, user_agent, ip_address) # SearchVector is currently disabled as it does not work properly on AWS RDS due to lack of # pg_catalog.english support from the migrations file. Retaled discussions: # https://stackoverflow.com/q/40032685/10748367 # https://forums.aws.amazon.com/thread.jspa?threadID=143920 # queryset = Vacancy.objects.filter(search_vector=query) queryset = Vacancy.objects.filter(title__search=query) tailored_skills = sort_skills(queryset)[:LIMIT_OF_SKILLS] skills_dict = { "vacancy_name": query, "number_of_vacancies": len(queryset), "rated_skills": tailored_skills, } return skills_dict
def burp_import(path): requests = [] content = reader(path) matches = re.finditer(burp_regex, content) for match in matches: request = parse_request(match.group(4)) headers = request['headers'] if match.group(7) in ('HTML', 'JSON'): requests.append({ 'url': match.group(1), 'method': match.group(2), 'extension': match.group(3), 'headers': headers, 'include': request['data'], 'code': match.group(5), 'length': match.group(6), 'mime': match.group(7) }) return requests
def request_import(path): parsed = parse_request(reader(path)) return {parsed['url']: [parsed['data']]}
def request_import(path): return parse_request(reader(path))