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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2594d6f3b6932771415beb4c83652f414cb001a
4
- data.tar.gz: 4df51ec900985fabe0bf0f918f611a55040a3ba4
3
+ metadata.gz: 52abcd095c98ae6bfc5790e2f2f1605be1b82125
4
+ data.tar.gz: 8e8aab47918ad9d2c665c44e9d5dcd5137fe933b
5
5
  SHA512:
6
- metadata.gz: 79179c44938adaa137e884294d7cdceeaf45b76a0a1fefd4c2cafc8a0cfd23db70ae7e1f70bdb455b5697de861a75dd4511bc3db7fbae15b67b2835f16ec8a0f
7
- data.tar.gz: c82281badd63297dfbcf511637bc9bdf17dc1debf73775e970969ef3c65c02569354d46ce8a005b37ce5d2f909919e442b3d2d52c8bd84b868d8e68deb818e63
6
+ metadata.gz: 2cf2206ba7182ce9f565fd840893609901f1dc48e06163b5ebd87da1ab81cb2b0db4bc4360ef3ae2d483fcb928c91c808190ab7e2e5898a95e4a1c6714250cf3
7
+ data.tar.gz: 9b8842589698744f040c581a71e97ab3f9152802745e81ec8e8db986f692b5f9a7d738e9f84420b050bf85ba012d8228ad4f42c9d7f32bc2b3fc658dfa29b601
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.5.1] - 2017-06-26
2
+ ### Added
3
+ - [Structure scope](https://api.hackerone.com/docs/v1#structured-scope) data added to report object
4
+
1
5
  ## [0.5.0] - 2017-06-23
2
6
  ### Added
3
7
  - `report.assign_to_user` and `report.assign_to_group` (@esjee)
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
  {
@@ -9,6 +9,7 @@ require_relative "client/reporter"
9
9
  require_relative "client/member"
10
10
  require_relative "client/user"
11
11
  require_relative "client/group"
12
+ require_relative "client/structured_scope"
12
13
 
13
14
  module HackerOne
14
15
  module Client
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Hackerone
2
2
  module Client
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  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.0
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-23 00:00:00.000000000 Z
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