apiServer.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:AutoTriageBot 作者: salesforce 项目源码 文件源码
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])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号