hackerone-client 0.14.0 → 0.14.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 -0
- data/lib/hackerone/client.rb +2 -0
- data/lib/hackerone/client/activity.rb +18 -2
- data/lib/hackerone/client/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88603237218a28a4e4969d2d2e3f7e5cd80cb127f08a4e28281f782d4256b676
|
4
|
+
data.tar.gz: 0d043560be7894f9a4f6ddbb05a48b50ef9d23096b8f70620633f99b0bc3de3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bea7771d2072ea159ef5eb4b482c80625b5df0927bbde0475782b2ec08279da43233800c5175814b5b9ebc2854f94a6f8535f32c98c6da147b7d4c6157cabfc
|
7
|
+
data.tar.gz: 44c4af87d1a9c58d57ba64f4ae1ceb3edf1f9036e5d0640aeb3665128fb812346252daba058e008dd27f1c3a26db3be5265fe51e007766d72aa5700ce9fdf65d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## [0.14.1] - 2020-02-13
|
2
|
+
|
3
|
+
- [Add support for float values in API responses](https://github.com/oreoshake/hackerone-client/pull/44) (@rzhade3)
|
4
|
+
|
1
5
|
## [0.14.0] - 2019-10-28
|
2
6
|
|
3
7
|
- [Add new swag API support](https://github.com/oreoshake/hackerone-client/pull/41) (@anglinb)
|
data/README.md
CHANGED
@@ -91,6 +91,12 @@ HackerOne::Client.high_range = 2500...5000
|
|
91
91
|
HackerOne::Client.critical_range = 5000...100_000_000
|
92
92
|
```
|
93
93
|
|
94
|
+
### Configuration
|
95
|
+
|
96
|
+
In order to configure whether error handling is strict or lenient, set the `HACKERONE_CLIENT_LENIENT_MODE` variable.
|
97
|
+
|
98
|
+
Setting this variable will make the client try to absorb errors, like a malformed bounty or bonus amount. Not setting this variable will cause the client to raise errors.
|
99
|
+
|
94
100
|
## Contributing
|
95
101
|
|
96
102
|
Bug reports and pull requests are welcome on GitHub at https://github.com/oreoshake/hackerone-client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/lib/hackerone/client.rb
CHANGED
@@ -24,6 +24,8 @@ module HackerOne
|
|
24
24
|
DEFAULT_HIGH_RANGE = 2500...4999
|
25
25
|
DEFAULT_CRITICAL_RANGE = 5000...100_000_000
|
26
26
|
|
27
|
+
LENIENT_MODE_ENV_VARIABLE = 'HACKERONE_CLIENT_LENIENT_MODE'
|
28
|
+
|
27
29
|
class << self
|
28
30
|
ATTRS = [:low_range, :medium_range, :high_range, :critical_range].freeze
|
29
31
|
attr_accessor :program
|
@@ -29,12 +29,28 @@ module HackerOne
|
|
29
29
|
class BountyAwarded < Activity
|
30
30
|
def bounty_amount
|
31
31
|
formatted_bounty_amount = attributes.bounty_amount || "0"
|
32
|
-
|
32
|
+
if ENV[HackerOne::Client::LENIENT_MODE_ENV_VARIABLE]
|
33
|
+
Float(formatted_bounty_amount) rescue 0
|
34
|
+
else
|
35
|
+
begin
|
36
|
+
Float(formatted_bounty_amount)
|
37
|
+
rescue ArgumentError
|
38
|
+
raise ArgumentError.new("Improperly formatted bounty amount")
|
39
|
+
end
|
40
|
+
end
|
33
41
|
end
|
34
42
|
|
35
43
|
def bonus_amount
|
36
44
|
formatted_bonus_amount = attributes.bonus_amount || "0"
|
37
|
-
|
45
|
+
if ENV[HackerOne::Client::LENIENT_MODE_ENV_VARIABLE]
|
46
|
+
Float(formatted_bonus_amount) rescue 0
|
47
|
+
else
|
48
|
+
begin
|
49
|
+
Float(formatted_bonus_amount)
|
50
|
+
rescue ArgumentError
|
51
|
+
raise ArgumentError.new("Improperly formatted bonus amount")
|
52
|
+
end
|
53
|
+
end
|
38
54
|
end
|
39
55
|
end
|
40
56
|
|
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.14.
|
4
|
+
version: 0.14.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:
|
11
|
+
date: 2020-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
194
|
- !ruby/object:Gem::Version
|
195
195
|
version: '0'
|
196
196
|
requirements: []
|
197
|
-
rubygems_version: 3.0.
|
197
|
+
rubygems_version: 3.0.3
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: A limited client for the HackerOne API
|