fix(route)(hackerone): make sure report is disclosed (#8313)
This commit is contained in:
parent
a4ee8e23c1
commit
0a2a9e161f
|
|
@ -27,19 +27,21 @@ module.exports = async (ctx) => {
|
|||
ctx.state.data = {
|
||||
title: 'HackerOne Hacker Activity',
|
||||
link: 'https://hackerone.com/hacktivity',
|
||||
item: response.data.data.hacktivity_items.edges.map((item) => {
|
||||
const author = item.node.reporter ? item.node.reporter.username : 'Someone';
|
||||
const vendor = item.node.team.name;
|
||||
const state = item.node.report.substate.replace(/^[a-z]/g, (L) => L.toUpperCase());
|
||||
const severity = item.node.severity_rating ? item.node.severity_rating.replace(/^[a-z]/g, (L) => L.toUpperCase()) : 'No Rating';
|
||||
const awarded = item.node.total_awarded_amount ? item.node.total_awarded_amount : 0;
|
||||
return {
|
||||
title: item.node.report.title,
|
||||
description: `By ${author} to ${vendor} | ${state} | ${severity} | $${awarded}`,
|
||||
author,
|
||||
pubDate: new Date(item.node.latest_disclosable_activity_at).toUTCString(),
|
||||
link: `https://hackerone.com/reports/${item.node.databaseId}`,
|
||||
};
|
||||
}),
|
||||
item: response.data.data.hacktivity_items.edges
|
||||
.filter((item) => item.node.type === 'Disclosed')
|
||||
.map((item) => {
|
||||
const author = item.node.reporter ? item.node.reporter.username : 'Someone';
|
||||
const vendor = item.node.team.name;
|
||||
const state = item.node.report.substate.replace(/^[a-z]/g, (L) => L.toUpperCase());
|
||||
const severity = item.node.severity_rating ? item.node.severity_rating.replace(/^[a-z]/g, (L) => L.toUpperCase()) : 'No Rating';
|
||||
const awarded = item.node.total_awarded_amount ? item.node.total_awarded_amount : 0;
|
||||
return {
|
||||
title: item.node.report.title,
|
||||
description: `By ${author} to ${vendor} | ${state} | ${severity} | $${awarded}`,
|
||||
author,
|
||||
pubDate: new Date(item.node.latest_disclosable_activity_at).toUTCString(),
|
||||
link: `https://hackerone.com/reports/${item.node.databaseId}`,
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue