lib/hackerone/client/report.rb in hackerone-client-0.1.0 vs lib/hackerone/client/report.rb in hackerone-client-0.1.1
- old
+ new
@@ -29,14 +29,18 @@
def title
attributes[:title]
end
- def vulnerability_information
- attributes[:vulnerability_information]
+ def created_at
+ attributes[:created_at]
end
+ def issue_tracker_reference_url
+ attributes[:issue_tracker_reference_url]
+ end
+
def reporter
relationships
.fetch(:reporter, {})
.fetch(:data, {})
.fetch(:attributes, {})
@@ -60,16 +64,11 @@
"critical"
end
end
def summary
- summaries = relationships.fetch(:summaries, {}).fetch(:data, []).select {|summary| summary[:type] == "report-summary" }
- return unless summaries
-
- summaries.select { |summary| summary[:attributes][:category] == "team" }.map do |summary|
- summary[:attributes][:content]
- end.join("\n")
+ attributes[:vulnerability_information]
end
# Do our best to map the value that hackerone provides and the reporter sets
# to the OWASP Top 10. Take the first match since multiple values can be set.
# This is used for the issue label.
@@ -90,10 +89,10 @@
def payments
activities.select { |activity| activity[:type] == PAYOUT_ACTIVITY_KEY }
end
def payment_amount(payment)
- payment.fetch(:attributes, {}).fetch(:bounty_amount, 0).gsub(/[^\d]/, "").to_i
+ payment.fetch(:attributes, {}).fetch(:bounty_amount, "0").gsub(/[^\d]/, "").to_i
end
def activities
relationships.fetch(:activities, {}).fetch(:data, [])
end