hackerone-client 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +6 -2
- data/fixtures/vcr_cassettes/report.yml +17 -0
- data/lib/hackerone/client.rb +1 -0
- data/lib/hackerone/client/report.rb +4 -0
- data/lib/hackerone/client/structured_scope.rb +29 -0
- data/lib/hackerone/client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52abcd095c98ae6bfc5790e2f2f1605be1b82125
|
4
|
+
data.tar.gz: 8e8aab47918ad9d2c665c44e9d5dcd5137fe933b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cf2206ba7182ce9f565fd840893609901f1dc48e06163b5ebd87da1ab81cb2b0db4bc4360ef3ae2d483fcb928c91c808190ab7e2e5898a95e4a1c6714250cf3
|
7
|
+
data.tar.gz: 9b8842589698744f040c581a71e97ab3f9152802745e81ec8e8db986f692b5f9a7d738e9f84420b050bf85ba012d8228ad4f42c9d7f32bc2b3fc658dfa29b601
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -2,14 +2,18 @@
|
|
2
2
|
|
3
3
|
A limited client library for interacting with HackerOne. Currently only supports a few operations:
|
4
4
|
|
5
|
-
```ruby
|
5
|
+
```ruby
|
6
6
|
client = HackerOne::Client::Api.new("github")
|
7
7
|
|
8
8
|
# GET`/reports` returns all reports in the "new" state for a given program
|
9
9
|
client.reports
|
10
10
|
|
11
11
|
# GET `/report/{id}` returns report data for a given report
|
12
|
-
client.report(id)
|
12
|
+
report = client.report(id)
|
13
|
+
|
14
|
+
# PUT `/reports/{id}/assignee`
|
15
|
+
report.assign_to_user("username")
|
16
|
+
report.assign_to_group("groupname")
|
13
17
|
|
14
18
|
# POST '/report/{id}/state_change change the state of a report
|
15
19
|
# `state` can be one of new, triaged, needs-more-info, resolved, not-applicable, informative, duplicate, spam
|
@@ -219,6 +219,23 @@ http_interactions:
|
|
219
219
|
}
|
220
220
|
}
|
221
221
|
},
|
222
|
+
"structured_scope": {
|
223
|
+
"id": "57",
|
224
|
+
"type": "structured_scope",
|
225
|
+
"attributes": {
|
226
|
+
"asset_identifier": "api.example.com",
|
227
|
+
"asset_type": "url",
|
228
|
+
"confidentiality_requirement": "high",
|
229
|
+
"integrity_requirement": "high",
|
230
|
+
"availability_requirement": "high",
|
231
|
+
"max_severity": "critical",
|
232
|
+
"created_at": "2015-02-02T04:05:06.000Z",
|
233
|
+
"updated_at": "2016-05-02T04:05:06.000Z",
|
234
|
+
"instruction": null,
|
235
|
+
"eligible_for_bounty": true,
|
236
|
+
"eligible_for_submission": true
|
237
|
+
}
|
238
|
+
},
|
222
239
|
"activities": {
|
223
240
|
"data": [
|
224
241
|
{
|
data/lib/hackerone/client.rb
CHANGED
@@ -35,6 +35,10 @@ module HackerOne
|
|
35
35
|
payments.reduce(0) { |total, payment| total + payment_amount(payment) }
|
36
36
|
end
|
37
37
|
|
38
|
+
def structured_scope
|
39
|
+
StructuredScope.new(relationships[:structured_scope])
|
40
|
+
end
|
41
|
+
|
38
42
|
# Excludes reports where the payout amount is 0 indicating swag-only or no
|
39
43
|
# payout for the issue supplied
|
40
44
|
def risk
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module HackerOne
|
2
|
+
module Client
|
3
|
+
class StructuredScope
|
4
|
+
DELEGATES = [
|
5
|
+
:asset_identifier,
|
6
|
+
:asset_type,
|
7
|
+
:eligible_for_bounty,
|
8
|
+
:eligible_for_submission,
|
9
|
+
:instruction
|
10
|
+
]
|
11
|
+
|
12
|
+
delegate *DELEGATES, to: :attributes
|
13
|
+
|
14
|
+
def initialize(scope)
|
15
|
+
@scope = scope
|
16
|
+
end
|
17
|
+
|
18
|
+
def id
|
19
|
+
@scope[:id]
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def attributes
|
25
|
+
OpenStruct.new(@scope[:attributes])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hackerone-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neil Matatall
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -158,6 +158,7 @@ files:
|
|
158
158
|
- lib/hackerone/client/program.rb
|
159
159
|
- lib/hackerone/client/report.rb
|
160
160
|
- lib/hackerone/client/reporter.rb
|
161
|
+
- lib/hackerone/client/structured_scope.rb
|
161
162
|
- lib/hackerone/client/user.rb
|
162
163
|
- lib/hackerone/client/version.rb
|
163
164
|
- lib/hackerone/client/weakness.rb
|