hackerone-client 0.20.0 → 0.20.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
  SHA256:
3
- metadata.gz: 0cd49e52e3d138ef9f7d37a0ce8610298a658e1a78b085a1cd0a7afa36633674
4
- data.tar.gz: d540fe6b703f57561a203d19d1104fea40e421b64ae2d337807e6a28bd7dc4ca
3
+ metadata.gz: 8bc7c771f9513ac464c291fcd7aff64f7bac61f07a599bc3df69fa50b5620aef
4
+ data.tar.gz: 2e1bfeee93c61b44b0852a49c24297b8c75cfc1a44fe74482961682e8de57225
5
5
  SHA512:
6
- metadata.gz: 46c0e045343a36893ea0cc5565bb8cc58c1a5dd96035816d61fd8ef3947cd9b7d9969f5fcb6ee336d0c462ae94450d2e98f354b2e5491c05f7ff0fc4669d2538
7
- data.tar.gz: 93e49f0fbec49d1bbd62689d2556632d38659ab97f132a73b75b3c2decb9bac7f4b49c63939ce574dbb3a137452bb000e37dc6c344a05c012ec8dd8412c5c7bc
6
+ metadata.gz: 6e432abcb996c438be845f68f46785a8d58d5cad4ea30623fd4878358f8ae5d2857b9ba00f6bc33393c1ee30d35e92db49bbf0a4432ffb7a62b4021a4eb676c8
7
+ data.tar.gz: 483858e438178da5283d87b29df8bd3281a73f9716936dce4620be7b8420baf1c8f9afa59aa4d78f32426e248465fd5f106d5e2473d0b79e0a32c749a18dcbcc
@@ -7,13 +7,14 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  strategy:
9
9
  matrix:
10
- ruby: [ '2.4', '2.5', '2.6', '2.7']
10
+ ruby: [ '2.4.0', '2.5.0', '2.6.0', '2.7.2', '3.0.0']
11
11
  steps:
12
12
  - uses: actions/checkout@v2
13
13
  - name: Set up Ruby ${{ matrix.ruby }}
14
- uses: actions/setup-ruby@v1
14
+ uses: ruby/setup-ruby@v1.64.1
15
15
  with:
16
16
  ruby-version: ${{ matrix.ruby }}
17
+ bundler-cache: true
17
18
  - name: Build and test with Rake with Ruby ${{ matrix.ruby }}
18
19
  run: |
19
20
  gem install bundler
data/README.md CHANGED
@@ -54,6 +54,9 @@ program.common_responses
54
54
 
55
55
  # Updates a program's policy
56
56
  program.update_policy(policy: "Please submit valid vulnerabilities")
57
+
58
+ # Gets a program's balance
59
+ program.balance
57
60
  ```
58
61
 
59
62
  ## State change hooks
@@ -0,0 +1,80 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.hackerone.com/v1/programs/18969/billing/balance
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - Basic NOPE
12
+ User-Agent:
13
+ - Faraday v0.17.3
14
+ Content-Type:
15
+ - application/json
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Fri, 12 Feb 2021 20:37:48 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - __cfduid=d64ff625fe5f42c2547caf518714b001c1613162268; expires=Sun, 14-Mar-21
35
+ 20:37:48 GMT; path=/; Domain=api.hackerone.com; HttpOnly; SameSite=Lax; Secure
36
+ X-Request-Id:
37
+ - 49e5c329-cf7f-4723-9853-a47db4c6ef4d
38
+ Etag:
39
+ - W/"623ba11e90acdaa5bfcf60eb7743af10"
40
+ Cache-Control:
41
+ - max-age=0, private, must-revalidate
42
+ Strict-Transport-Security:
43
+ - max-age=31536000; includeSubDomains; preload
44
+ X-Frame-Options:
45
+ - DENY
46
+ X-Content-Type-Options:
47
+ - nosniff
48
+ X-Xss-Protection:
49
+ - 1; mode=block
50
+ X-Download-Options:
51
+ - noopen
52
+ X-Permitted-Cross-Domain-Policies:
53
+ - none
54
+ Referrer-Policy:
55
+ - strict-origin-when-cross-origin
56
+ Expect-Ct:
57
+ - enforce, max-age=86400
58
+ Content-Security-Policy:
59
+ - 'default-src ''none''; base-uri ''self''; block-all-mixed-content; child-src
60
+ www.youtube-nocookie.com; connect-src ''self'' www.google-analytics.com errors.hackerone.net;
61
+ font-src ''self''; form-action ''self''; frame-ancestors ''none''; img-src
62
+ ''self'' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com
63
+ profile-photos.hackerone-user-content.com hackerone-us-west-2-production-attachments.s3.us-west-2.amazonaws.com;
64
+ media-src ''self'' hackerone-us-west-2-production-attachments.s3.us-west-2.amazonaws.com;
65
+ script-src ''self'' www.google-analytics.com; style-src ''self'' ''unsafe-inline'';
66
+ report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=374aea95847f4040a69f9c8d49a3a59d'
67
+ Cf-Cache-Status:
68
+ - DYNAMIC
69
+ Cf-Request-Id:
70
+ - '08398fde1c000027e4d90cd000000001'
71
+ Server:
72
+ - cloudflare
73
+ Cf-Ray:
74
+ - 62091c102ef927e4-SLC
75
+ body:
76
+ encoding: ASCII-8BIT
77
+ string: '{"data":{"id":"1894","type":"program-balance","attributes":{"balance":"118386.40"}}}'
78
+ http_version:
79
+ recorded_at: Fri, 12 Feb 2021 20:37:48 GMT
80
+ recorded_with: VCR 3.0.3
@@ -17,6 +17,7 @@ require_relative "client/address"
17
17
  require_relative "client/attachment"
18
18
  require_relative "client/bounty"
19
19
  require_relative "client/incremental/activities"
20
+ require_relative "client/billing_balance"
20
21
  require "active_support/core_ext/hash"
21
22
 
22
23
  module HackerOne
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HackerOne
4
+ module Client
5
+ class BillingBalance
6
+ delegate :balance, to: :attributes
7
+
8
+ def initialize(billing_balance)
9
+ @billing_balance = OpenStruct.new billing_balance
10
+ end
11
+
12
+ private
13
+ def attributes
14
+ OpenStruct.new(@billing_balance[:attributes])
15
+ end
16
+ end
17
+ end
18
+ end
@@ -76,6 +76,13 @@ module HackerOne
76
76
  response_body.map { |r| Swag.new(r, self) }
77
77
  end
78
78
 
79
+ def balance
80
+ response_body = make_get_request(
81
+ "programs/#{id}/billing/balance"
82
+ )
83
+ BillingBalance.new(response_body).balance
84
+ end
85
+
79
86
  private
80
87
 
81
88
  def members
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Hackerone
4
4
  module Client
5
- VERSION = "0.20.0"
5
+ VERSION = "0.20.1"
6
6
  end
7
7
  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.20.0
4
+ version: 0.20.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: 2021-01-26 00:00:00.000000000 Z
11
+ date: 2021-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -146,6 +146,7 @@ files:
146
146
  - fixtures/vcr_cassettes/create_report_invalid.yml
147
147
  - fixtures/vcr_cassettes/dup.yml
148
148
  - fixtures/vcr_cassettes/empty_report_list.yml
149
+ - fixtures/vcr_cassettes/get_balance.yml
149
150
  - fixtures/vcr_cassettes/lock_report.yml
150
151
  - fixtures/vcr_cassettes/missing_report.yml
151
152
  - fixtures/vcr_cassettes/programs.yml
@@ -170,6 +171,7 @@ files:
170
171
  - lib/hackerone/client/activity.rb
171
172
  - lib/hackerone/client/address.rb
172
173
  - lib/hackerone/client/attachment.rb
174
+ - lib/hackerone/client/billing_balance.rb
173
175
  - lib/hackerone/client/bounty.rb
174
176
  - lib/hackerone/client/group.rb
175
177
  - lib/hackerone/client/incremental/activities.rb