def getReportIDs() -> str:
""" Get a list of report IDs created after the given time of openOnly is true, then only the IDs of open reports """
data = request.get_json(force=True)
startTime = parseTime(data['time'])
openOnly = data['openOnly']
if config.DEBUGVERBOSE:
print("/v1/getReportIDs: time=%s, openOnly=%s" % (startTime.isoformat(), str(openOnly)))
if openOnly:
allIDs = []
for state in ['new', 'triaged', 'needs-more-info']:
url = "https://api.hackerone.com/v1/reports?filter[program][]=%s&page[size]=100&filter[state][]=%s" % \
(config.programName, state)
ids = [report['id'] for report in getEndpointPaginated(url)
if parseTime(report['attributes']['created_at']) > startTime]
allIDs.extend(ids)
return json.dumps(allIDs)
else:
url = "https://api.hackerone.com/v1/reports?filter[program][]=%s&page[size]=100" % config.programName
return json.dumps([report['id'] for report in getEndpointPaginated(url)
if parseTime(report['attributes']['created_at']) > startTime])
评论列表
文章目录