Handle a post request.
(self)
| 31 | @handler.post(handler.JSON, handler.JSON) |
| 32 | @handler.oauth |
| 33 | def post(self): |
| 34 | """Handle a post request.""" |
| 35 | if not auth.get_current_user(): |
| 36 | raise helpers.AccessDeniedError() |
| 37 | |
| 38 | project = request.get('project') |
| 39 | fuzz_target = request.get('fuzz_target') |
| 40 | stacktrace = request.get('stacktrace') |
| 41 | |
| 42 | state = stack_analyzer.get_crash_data( |
| 43 | stacktrace, |
| 44 | symbolize_flag=False, |
| 45 | fuzz_target=fuzz_target, |
| 46 | already_symbolized=True, |
| 47 | detect_ooms_and_hangs=True) |
| 48 | security_flag = crash_analyzer.is_security_issue( |
| 49 | state.crash_stacktrace, state.crash_type, state.crash_address) |
| 50 | |
| 51 | result = { |
| 52 | 'state': state.crash_state, |
| 53 | 'type': state.crash_type, |
| 54 | 'security': security_flag, |
| 55 | } |
| 56 | |
| 57 | duplicate_testcase = data_handler.find_testcase( |
| 58 | project, state.crash_type, state.crash_state, security_flag) |
| 59 | if (duplicate_testcase and duplicate_testcase.security_flag and |
| 60 | not access.can_user_access_testcase(duplicate_testcase)): |
| 61 | # Do not disclose the existence or identifiers of a security-confidential |
| 62 | # testcase to a user who is not allowed to access it. |
| 63 | duplicate_testcase = None |
| 64 | if duplicate_testcase: |
| 65 | result['result'] = 'duplicate' |
| 66 | result['duplicate_id'] = duplicate_testcase.key.id() |
| 67 | |
| 68 | bug_id = ( |
| 69 | duplicate_testcase.bug_information or |
| 70 | duplicate_testcase.group_bug_information) |
| 71 | if bug_id: |
| 72 | result['bug_id'] = str(bug_id) |
| 73 | else: |
| 74 | result['result'] = 'new' |
| 75 | |
| 76 | return self.render_json(result) |
nothing calls this directly
no test coverage detected