Class: HackerOne::Client::Report
- Inherits:
-
Object
- Object
- HackerOne::Client::Report
- Defined in:
- lib/hackerone/client/report.rb
Constant Summary collapse
- PAYOUT_ACTIVITY_KEY =
"activity-bounty-awarded"
Instance Method Summary collapse
- #classification_label ⇒ Object
- #created_at ⇒ Object
- #id ⇒ Object
-
#initialize(report) ⇒ Report
constructor
A new instance of Report.
- #issue_tracker_reference_url ⇒ Object
- #payment_total ⇒ Object
- #reporter ⇒ Object
-
#risk ⇒ Object
Excludes reports where the payout amount is 0 indicating swag-only or no payout for the issue supplied.
- #summary ⇒ Object
- #title ⇒ Object
- #weakness ⇒ Object
-
#writeup_classification ⇒ Object
Bounty writeups just use the key, and not the label value.
Constructor Details
#initialize(report) ⇒ Report
Returns a new instance of Report.
8 9 10 |
# File 'lib/hackerone/client/report.rb', line 8 def initialize(report) @report = report end |
Instance Method Details
#classification_label ⇒ Object
62 63 64 |
# File 'lib/hackerone/client/report.rb', line 62 def classification_label weakness.to_owasp end |
#created_at ⇒ Object
20 21 22 |
# File 'lib/hackerone/client/report.rb', line 20 def created_at attributes[:created_at] end |
#id ⇒ Object
12 13 14 |
# File 'lib/hackerone/client/report.rb', line 12 def id @report[:id] end |
#issue_tracker_reference_url ⇒ Object
24 25 26 |
# File 'lib/hackerone/client/report.rb', line 24 def issue_tracker_reference_url attributes[:issue_tracker_reference_url] end |
#payment_total ⇒ Object
35 36 37 |
# File 'lib/hackerone/client/report.rb', line 35 def payment_total payments.reduce(0) { |total, payment| total + payment_amount(payment) } end |
#reporter ⇒ Object
28 29 30 31 32 33 |
# File 'lib/hackerone/client/report.rb', line 28 def reporter relationships .fetch(:reporter, {}) .fetch(:data, {}) .fetch(:attributes, {}) end |
#risk ⇒ Object
Excludes reports where the payout amount is 0 indicating swag-only or no payout for the issue supplied
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/hackerone/client/report.rb', line 41 def risk case payment_total when HackerOne::Client.low_range || DEFAULT_LOW_RANGE "low" when HackerOne::Client.medium_range || DEFAULT_MEDIUM_RANGE "medium" when HackerOne::Client.high_range || DEFAULT_HIGH_RANGE "high" when HackerOne::Client.critical_range || DEFAULT_CRITICAL_RANGE "critical" end end |
#summary ⇒ Object
54 55 56 |
# File 'lib/hackerone/client/report.rb', line 54 def summary attributes[:vulnerability_information] end |
#title ⇒ Object
16 17 18 |
# File 'lib/hackerone/client/report.rb', line 16 def title attributes[:title] end |
#weakness ⇒ Object
58 59 60 |
# File 'lib/hackerone/client/report.rb', line 58 def weakness @weakness ||= Weakness.new relationships[:weakness][:data][:attributes] end |
#writeup_classification ⇒ Object
Bounty writeups just use the key, and not the label value.
67 68 69 |
# File 'lib/hackerone/client/report.rb', line 67 def writeup_classification classification_label().split("-").first end |