def changeStatus() -> str:
""" Change the status of the report at the given ID to the given status """
data = request.get_json(force=True)
status = data['status']
message = data['message']
id = data['id']
if config.DEBUG:
print("/v1/changeStatus: id=%s, status=%s" % (id, status))
if config.DEBUGVERBOSE:
print("message=%s" % message)
h1Data = {'data': {'type': 'state-change',
'attributes': {'message': message,
'state': status}}}
headers = {'Content-Type': 'application/json'}
resp = requests.post('https://api.hackerone.com/v1/reports/%s/state_changes' % id,
headers=headers,
data=json.dumps(h1Data).encode('utf-8'),
auth=(config.apiName, secrets.apiToken))
return json.dumps(resp.json())
评论列表
文章目录