hackerone-client 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2370cf42a3dcd4313a377a530f46fd704334f4a3ce1c4e3dce4ac62f16751b47
4
- data.tar.gz: 129b9b5b1cfe2cccb7919f57ff44491486c2379344374fe4072a4185244e081d
3
+ metadata.gz: 6d4b1c014b6e1db5054e8f357a035fcd7280dfc7883fed91dc3a8ae379595591
4
+ data.tar.gz: a7c73cd1930859cf4869dd582b0ee9b9386deabf0459332b1a8c6af70cf16d92
5
5
  SHA512:
6
- metadata.gz: a4f9b5ffbae89c6e089ad8bae84372941629e50de704c693913467483e564479bf4be7ac0183e2293cc30709832dd2c2fc656b40fd46b5ce57b62428900c0484
7
- data.tar.gz: 5d1a11a5d9fd315a48f29327410207c7e6d6aa6cea806ab6bab74f6f79642fdaee5255156955772e77496176f01fa4f8bb796ba54ce84612e3f023b6b3fe696b
6
+ metadata.gz: 576b7efb77016dfa6ffbe2e9c73c887ebb2439ff048bcb0dc763786c93f5248a082b27fce8211206648252754f0f8566bd2981a8e9667fd3e73e122fbcc54b92
7
+ data.tar.gz: 9906f890a07c6d6e717e1eda4f70e327eec345d30a88c91cb5953b47e3ab7f01e53212c8a640a37ebff41ddad31fd32641392e41edd3ce0a9ca4b2082600bcc9
@@ -0,0 +1,19 @@
1
+ name: Build + Test
2
+ on: [push]
3
+
4
+ jobs:
5
+ build:
6
+ name: Build + Test
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - uses: actions/checkout@master
11
+ - name: Set up Ruby 2.6
12
+ uses: actions/setup-ruby@v1
13
+ with:
14
+ version: 2.6.x
15
+ - name: Build and test with Rake
16
+ run: |
17
+ gem install bundler --version '1.0.0'
18
+ bundle install --jobs 4 --retry 3
19
+ bundle exec rake spec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.14.0] - 2019-10-28
2
+
3
+ - [Add new swag API support](https://github.com/oreoshake/hackerone-client/pull/41) (@anglinb)
4
+
1
5
  ## [0.13.0] - 2018-10-19
2
6
 
3
7
  - [Fix issue with `#to_owasp` which would raise an error if an issue classification started with `CAPEC-`](https://github.com/oreoshake/hackerone-client/pull/39) (@rzhade3)
@@ -0,0 +1,78 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.hackerone.com/v1/programs/18969/swag?page%5Bnumber%5D=1&page%5Bsize%5D=100
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Authorization:
11
+ - Basic NOPE
12
+ User-Agent:
13
+ - Faraday v0.17.0
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
+ - Mon, 21 Oct 2019 21:22:49 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=deeb30f5e16acf36a6d3a09f555517abb1571692969; expires=Tue, 20-Oct-20
35
+ 21:22:49 GMT; path=/; Domain=api.hackerone.com; HttpOnly; Secure
36
+ X-Request-Id:
37
+ - 996824c2-6dc7-462d-abd1-0b139ac622d3
38
+ Etag:
39
+ - W/"50f9e35881a8d253f80804edc967a7db"
40
+ Cache-Control:
41
+ - max-age=0, private, must-revalidate
42
+ Strict-Transport-Security:
43
+ - max-age=31536000; includeSubDomains; preload
44
+ Expect-Ct:
45
+ - enforce, max-age=86400
46
+ Content-Security-Policy:
47
+ - 'default-src ''none''; base-uri ''self''; block-all-mixed-content; child-src
48
+ www.youtube-nocookie.com; connect-src ''self'' www.google-analytics.com errors.hackerone.net;
49
+ font-src ''self''; form-action ''self''; frame-ancestors ''none''; img-src
50
+ ''self'' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com
51
+ profile-photos.hackerone-user-content.com hackerone-us-west-2-production-attachments.s3.us-west-2.amazonaws.com;
52
+ media-src ''self'' hackerone-us-west-2-production-attachments.s3.us-west-2.amazonaws.com;
53
+ script-src ''self'' www.google-analytics.com; style-src ''self'' ''unsafe-inline'';
54
+ report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=61c1e2f50d21487c97a071737701f598'
55
+ Referrer-Policy:
56
+ - strict-origin-when-cross-origin
57
+ X-Content-Type-Options:
58
+ - nosniff
59
+ X-Download-Options:
60
+ - noopen
61
+ X-Frame-Options:
62
+ - DENY
63
+ X-Permitted-Cross-Domain-Policies:
64
+ - none
65
+ X-Xss-Protection:
66
+ - 1; mode=block
67
+ Cf-Cache-Status:
68
+ - DYNAMIC
69
+ Server:
70
+ - cloudflare
71
+ Cf-Ray:
72
+ - 52964a03f9d48020-SAN
73
+ body:
74
+ encoding: ASCII-8BIT
75
+ string: '{"data":[{"id":"3377","type":"swag","attributes":{"sent":false,"created_at":"2018-12-13T04:06:32.994Z"},"relationships":{"user":{"data":{"id":"175595","type":"user","attributes":{"username":"anglinb_x0rsd","name":"Brian Anglin","disabled":false,"created_at":"2017-06-13T18:42:14.025Z","profile_picture":{"62x62":"/assets/avatars/default-71a302d706457f3d3a31eb30fa3e73e6cf0b1d677b8fa218eaeaffd67ae97918.png","82x82":"/assets/avatars/default-71a302d706457f3d3a31eb30fa3e73e6cf0b1d677b8fa218eaeaffd67ae97918.png","110x110":"/assets/avatars/default-71a302d706457f3d3a31eb30fa3e73e6cf0b1d677b8fa218eaeaffd67ae97918.png","260x260":"/assets/avatars/default-71a302d706457f3d3a31eb30fa3e73e6cf0b1d677b8fa218eaeaffd67ae97918.png"},"signal":null,"impact":null,"reputation":null,"bio":null,"website":null,"location":null,"hackerone_triager":false}}},"address":{"data":{"id":"7374","type":"address","attributes":{"name":"Brian Anglin","street":" 88 Colin P Kelly Jr Street","city":"San Francisco","postal_code":"94107","state":"California","country":"United States","created_at":"2019-10-21T20:50:40.159Z","tshirt_size":"M_Medium","phone_number":"555-555-5555"}}}}},{"id":"2158","type":"swag","attributes":{"sent":false,"created_at":"2017-10-10T23:30:28.494Z"},"relationships":{"user":{"data":{"id":"57690","type":"user","attributes":{"username":"ndm-github","name":"Neil Matatall","disabled":false,"created_at":"2016-02-24T01:33:01.258Z","profile_picture":{"62x62":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxOako0TmpKZUJqc0hWRG9KWTNKdmNFa2lEall5ZURZeUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--c38a870d322217b0422c840e7586b68994be38b4/me.jpg","82x82":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxPREo0T0RKZUJqc0hWRG9KWTNKdmNFa2lEamd5ZURneUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--0e71f6791faebe1c35f4452bd21d67fb6decfbc2/me.jpg","110x110":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSU5NVEV3ZURFeE1GNEdPd2RVT2dsamNtOXdTU0lRTVRFd2VERXhNQ3N3S3pBR093ZFUiLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--1917e7824f1aea53a596a4e6dca1bcd5df9ba837/me.jpg","260x260":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpZd2VESTJNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--046b84087493d0d7ec61d29748cef8b7d4f99dc5/me.jpg"},"signal":null,"impact":null,"reputation":null,"bio":"I am a human.","website":"https://oreoshake.github.io","location":"Kailua Kona, HI","hackerone_triager":false}}},"address":null}},{"id":"2157","type":"swag","attributes":{"sent":false,"created_at":"2017-10-10T23:30:07.259Z"},"relationships":{"user":{"data":{"id":"57690","type":"user","attributes":{"username":"ndm-github","name":"Neil Matatall","disabled":false,"created_at":"2016-02-24T01:33:01.258Z","profile_picture":{"62x62":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxOako0TmpKZUJqc0hWRG9KWTNKdmNFa2lEall5ZURZeUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--c38a870d322217b0422c840e7586b68994be38b4/me.jpg","82x82":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxPREo0T0RKZUJqc0hWRG9KWTNKdmNFa2lEamd5ZURneUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--0e71f6791faebe1c35f4452bd21d67fb6decfbc2/me.jpg","110x110":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSU5NVEV3ZURFeE1GNEdPd2RVT2dsamNtOXdTU0lRTVRFd2VERXhNQ3N3S3pBR093ZFUiLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--1917e7824f1aea53a596a4e6dca1bcd5df9ba837/me.jpg","260x260":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpZd2VESTJNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--046b84087493d0d7ec61d29748cef8b7d4f99dc5/me.jpg"},"signal":null,"impact":null,"reputation":null,"bio":"I am a human.","website":"https://oreoshake.github.io","location":"Kailua Kona, HI","hackerone_triager":false}}},"address":null}},{"id":"2156","type":"swag","attributes":{"sent":false,"created_at":"2017-10-10T23:28:53.437Z"},"relationships":{"user":{"data":{"id":"57690","type":"user","attributes":{"username":"ndm-github","name":"Neil Matatall","disabled":false,"created_at":"2016-02-24T01:33:01.258Z","profile_picture":{"62x62":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxOako0TmpKZUJqc0hWRG9KWTNKdmNFa2lEall5ZURZeUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--c38a870d322217b0422c840e7586b68994be38b4/me.jpg","82x82":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxPREo0T0RKZUJqc0hWRG9KWTNKdmNFa2lEamd5ZURneUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--0e71f6791faebe1c35f4452bd21d67fb6decfbc2/me.jpg","110x110":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSU5NVEV3ZURFeE1GNEdPd2RVT2dsamNtOXdTU0lRTVRFd2VERXhNQ3N3S3pBR093ZFUiLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--1917e7824f1aea53a596a4e6dca1bcd5df9ba837/me.jpg","260x260":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpZd2VESTJNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--046b84087493d0d7ec61d29748cef8b7d4f99dc5/me.jpg"},"signal":null,"impact":null,"reputation":null,"bio":"I am a human.","website":"https://oreoshake.github.io","location":"Kailua Kona, HI","hackerone_triager":false}}},"address":null}},{"id":"2155","type":"swag","attributes":{"sent":false,"created_at":"2017-10-10T23:18:01.239Z"},"relationships":{"user":{"data":{"id":"57690","type":"user","attributes":{"username":"ndm-github","name":"Neil Matatall","disabled":false,"created_at":"2016-02-24T01:33:01.258Z","profile_picture":{"62x62":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxOako0TmpKZUJqc0hWRG9KWTNKdmNFa2lEall5ZURZeUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--c38a870d322217b0422c840e7586b68994be38b4/me.jpg","82x82":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxPREo0T0RKZUJqc0hWRG9KWTNKdmNFa2lEamd5ZURneUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--0e71f6791faebe1c35f4452bd21d67fb6decfbc2/me.jpg","110x110":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSU5NVEV3ZURFeE1GNEdPd2RVT2dsamNtOXdTU0lRTVRFd2VERXhNQ3N3S3pBR093ZFUiLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--1917e7824f1aea53a596a4e6dca1bcd5df9ba837/me.jpg","260x260":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpZd2VESTJNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--046b84087493d0d7ec61d29748cef8b7d4f99dc5/me.jpg"},"signal":null,"impact":null,"reputation":null,"bio":"I am a human.","website":"https://oreoshake.github.io","location":"Kailua Kona, HI","hackerone_triager":false}}},"address":null}},{"id":"2154","type":"swag","attributes":{"sent":true,"created_at":"2017-10-10T23:17:25.413Z"},"relationships":{"user":{"data":{"id":"57690","type":"user","attributes":{"username":"ndm-github","name":"Neil Matatall","disabled":false,"created_at":"2016-02-24T01:33:01.258Z","profile_picture":{"62x62":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxOako0TmpKZUJqc0hWRG9KWTNKdmNFa2lEall5ZURZeUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--c38a870d322217b0422c840e7586b68994be38b4/me.jpg","82x82":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxPREo0T0RKZUJqc0hWRG9KWTNKdmNFa2lEamd5ZURneUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--0e71f6791faebe1c35f4452bd21d67fb6decfbc2/me.jpg","110x110":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSU5NVEV3ZURFeE1GNEdPd2RVT2dsamNtOXdTU0lRTVRFd2VERXhNQ3N3S3pBR093ZFUiLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--1917e7824f1aea53a596a4e6dca1bcd5df9ba837/me.jpg","260x260":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpZd2VESTJNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--046b84087493d0d7ec61d29748cef8b7d4f99dc5/me.jpg"},"signal":null,"impact":null,"reputation":null,"bio":"I am a human.","website":"https://oreoshake.github.io","location":"Kailua Kona, HI","hackerone_triager":false}}},"address":null}},{"id":"536","type":"swag","attributes":{"sent":true,"created_at":"2016-04-18T21:26:05.748Z"},"relationships":{"user":{"data":{"id":"57690","type":"user","attributes":{"username":"ndm-github","name":"Neil Matatall","disabled":false,"created_at":"2016-02-24T01:33:01.258Z","profile_picture":{"62x62":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxOako0TmpKZUJqc0hWRG9KWTNKdmNFa2lEall5ZURZeUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--c38a870d322217b0422c840e7586b68994be38b4/me.jpg","82x82":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxPREo0T0RKZUJqc0hWRG9KWTNKdmNFa2lEamd5ZURneUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--0e71f6791faebe1c35f4452bd21d67fb6decfbc2/me.jpg","110x110":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSU5NVEV3ZURFeE1GNEdPd2RVT2dsamNtOXdTU0lRTVRFd2VERXhNQ3N3S3pBR093ZFUiLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--1917e7824f1aea53a596a4e6dca1bcd5df9ba837/me.jpg","260x260":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbGdpIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--5ede3b2e9a7e6448df986c80c3921ae8487d69c9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpZd2VESTJNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--046b84087493d0d7ec61d29748cef8b7d4f99dc5/me.jpg"},"signal":null,"impact":null,"reputation":null,"bio":"I am a human.","website":"https://oreoshake.github.io","location":"Kailua Kona, HI","hackerone_triager":false}}},"address":null}},{"id":"535","type":"swag","attributes":{"sent":true,"created_at":"2016-04-18T21:21:19.387Z"},"relationships":{"user":{"data":{"id":"3683","type":"user","attributes":{"username":"demo-hacker","name":"Demo Hacker","disabled":false,"created_at":"2014-03-17T20:14:25.383Z","profile_picture":{"62x62":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbW9JIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cf0381cffb6f40a91dc83b5ae360748715193a74/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxOako0TmpKZUJqc0hWRG9KWTNKdmNFa2lEall5ZURZeUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--c38a870d322217b0422c840e7586b68994be38b4/demo_researcher.png","82x82":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbW9JIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cf0381cffb6f40a91dc83b5ae360748715193a74/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSUxPREo0T0RKZUJqc0hWRG9KWTNKdmNFa2lEamd5ZURneUt6QXJNQVk3QjFRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--0e71f6791faebe1c35f4452bd21d67fb6decfbc2/demo_researcher.png","110x110":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbW9JIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cf0381cffb6f40a91dc83b5ae360748715193a74/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VWTI5dFltbHVaVjl2Y0hScGIyNXpld2c2REdkeVlYWnBkSGxKSWd0RFpXNTBaWElHT2daRlZEb0xjbVZ6YVhwbFNTSU5NVEV3ZURFeE1GNEdPd2RVT2dsamNtOXdTU0lRTVRFd2VERXhNQ3N3S3pBR093ZFUiLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--1917e7824f1aea53a596a4e6dca1bcd5df9ba837/demo_researcher.png","260x260":"https://hackerone.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbW9JIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cf0381cffb6f40a91dc83b5ae360748715193a74/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpZd2VESTJNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--046b84087493d0d7ec61d29748cef8b7d4f99dc5/demo_researcher.png"},"signal":null,"impact":null,"reputation":100,"bio":"","website":null,"location":"support@hackerone.com","hackerone_triager":false}}},"address":{"data":{"id":"237","type":"address","attributes":{"name":"John Doe","street":"535 Mission Street","city":"San Francisco","postal_code":"94105","state":"California","country":"United States of America","created_at":"2016-04-18T21:28:15.881Z","phone_number":"+15100000000"}}}}}],"links":{}}'
76
+ http_version:
77
+ recorded_at: Mon, 21 Oct 2019 21:22:49 GMT
78
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,81 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://api.hackerone.com/v1/programs/18969/swag/3377
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"data":{"type":"swag","attributes":{"sent":true}}}'
9
+ headers:
10
+ Authorization:
11
+ - Basic NOPE
12
+ User-Agent:
13
+ - Faraday v0.17.0
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
+ - Mon, 21 Oct 2019 22:00:10 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=d462d381b66fd12f1206f12f1234d8e3d1571695209; expires=Tue, 20-Oct-20
35
+ 22:00:09 GMT; path=/; Domain=api.hackerone.com; HttpOnly; Secure
36
+ X-Request-Id:
37
+ - b5416764-3419-4a27-bd36-9cce7e6f4aa7
38
+ Etag:
39
+ - W/"2e21cfa10ed9d144353542ef658979e8"
40
+ Cache-Control:
41
+ - max-age=0, private, must-revalidate
42
+ Strict-Transport-Security:
43
+ - max-age=31536000; includeSubDomains; preload
44
+ Expect-Ct:
45
+ - enforce, max-age=86400
46
+ Content-Security-Policy:
47
+ - 'default-src ''none''; base-uri ''self''; block-all-mixed-content; child-src
48
+ www.youtube-nocookie.com; connect-src ''self'' www.google-analytics.com errors.hackerone.net;
49
+ font-src ''self''; form-action ''self''; frame-ancestors ''none''; img-src
50
+ ''self'' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com
51
+ profile-photos.hackerone-user-content.com hackerone-us-west-2-production-attachments.s3.us-west-2.amazonaws.com;
52
+ media-src ''self'' hackerone-us-west-2-production-attachments.s3.us-west-2.amazonaws.com;
53
+ script-src ''self'' www.google-analytics.com; style-src ''self'' ''unsafe-inline'';
54
+ report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=61c1e2f50d21487c97a071737701f598'
55
+ Referrer-Policy:
56
+ - strict-origin-when-cross-origin
57
+ X-Content-Type-Options:
58
+ - nosniff
59
+ X-Download-Options:
60
+ - noopen
61
+ X-Frame-Options:
62
+ - DENY
63
+ X-Permitted-Cross-Domain-Policies:
64
+ - none
65
+ X-Xss-Protection:
66
+ - 1; mode=block
67
+ Cf-Cache-Status:
68
+ - DYNAMIC
69
+ Server:
70
+ - cloudflare
71
+ Cf-Ray:
72
+ - 529680b549577fd8-SAN
73
+ body:
74
+ encoding: ASCII-8BIT
75
+ string: '{"id":"3377","type":"swag","attributes":{"sent":true,"created_at":"2018-12-13T04:06:32.994Z"},"relationships":{"user":{"data":{"id":"175595","type":"user","attributes":{"username":"anglinb_x0rsd","name":"Brian
76
+ Anglin","disabled":false,"created_at":"2017-06-13T18:42:14.025Z","profile_picture":{"62x62":"/assets/avatars/default-71a302d706457f3d3a31eb30fa3e73e6cf0b1d677b8fa218eaeaffd67ae97918.png","82x82":"/assets/avatars/default-71a302d706457f3d3a31eb30fa3e73e6cf0b1d677b8fa218eaeaffd67ae97918.png","110x110":"/assets/avatars/default-71a302d706457f3d3a31eb30fa3e73e6cf0b1d677b8fa218eaeaffd67ae97918.png","260x260":"/assets/avatars/default-71a302d706457f3d3a31eb30fa3e73e6cf0b1d677b8fa218eaeaffd67ae97918.png"},"signal":null,"impact":null,"reputation":null,"bio":null,"website":null,"location":null,"hackerone_triager":false}}},"address":{"data":{"id":"7374","type":"address","attributes":{"name":"Brian
77
+ Anglin","street":" 88 Colin P Kelly Jr Street","city":"San Francisco","postal_code":"94107","state":"California","country":"United
78
+ States","created_at":"2019-10-21T20:50:40.159Z","tshirt_size":"M_Medium","phone_number":"555-555-5555"}}}}}'
79
+ http_version:
80
+ recorded_at: Mon, 21 Oct 2019 22:00:10 GMT
81
+ recorded_with: VCR 3.0.3
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_development_dependency "bundler", "~> 1.14"
23
+ spec.add_development_dependency "bundler", "> 1.14"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
25
  spec.add_development_dependency "rspec", "~> 3.0"
26
26
  spec.add_development_dependency "vcr", "~> 3.0"
@@ -0,0 +1,22 @@
1
+ module HackerOne
2
+ module Client
3
+ class Address
4
+ delegate :name, :street, :city, :postal_code, :state, :country, \
5
+ :created_at, :tshirt_size, :phone_number, to: :attributes
6
+
7
+ def initialize(address)
8
+ @address = address
9
+ end
10
+
11
+ def id
12
+ @address[:id]
13
+ end
14
+
15
+ private
16
+
17
+ def attributes
18
+ OpenStruct.new(@address[:attributes])
19
+ end
20
+ end
21
+ end
22
+ end
@@ -56,6 +56,14 @@ module HackerOne
56
56
  )
57
57
  end
58
58
 
59
+ def swag(page_number: 1, page_size: 100)
60
+ response_body = make_get_request(
61
+ "programs/#{id}/swag",
62
+ params: { page: { number: page_number, size: page_size } }
63
+ )
64
+ response_body.map{|r| Swag.new(r, self) }
65
+ end
66
+
59
67
  private
60
68
 
61
69
  def members
@@ -156,7 +156,7 @@ module HackerOne
156
156
  "reports/#{id}/swags",
157
157
  request_body: request_body
158
158
  )
159
- Swag.new(response_body)
159
+ Swag.new(response_body, program)
160
160
  end
161
161
 
162
162
  def suggest_bounty(message:, amount:, bonus_amount: nil)
@@ -12,6 +12,16 @@ module HackerOne
12
12
  )
13
13
  end
14
14
 
15
+ def make_put_request(url, request_body:, extract_data: true)
16
+ response = HackerOne::Client::Api.hackerone_api_connection.put do |req|
17
+ req.headers['Content-Type'] = 'application/json'
18
+ req.url url
19
+ req.body = { data: request_body }.to_json
20
+ end
21
+
22
+ parse_response(response, extract_data: extract_data)
23
+ end
24
+
15
25
  def make_post_request(url, request_body:, extract_data: true)
16
26
  response = HackerOne::Client::Api.hackerone_api_connection.post do |req|
17
27
  req.headers['Content-Type'] = 'application/json'
@@ -1,21 +1,55 @@
1
1
  module HackerOne
2
2
  module Client
3
3
  class Swag
4
+ include ResourceHelper
4
5
  delegate :sent, :created_at, to: :attributes
5
6
 
6
- def initialize(swag)
7
+ def initialize(swag, program = nil)
7
8
  @swag = swag
9
+ @program = program
8
10
  end
9
11
 
10
12
  def id
11
13
  @swag[:id]
12
14
  end
13
15
 
16
+ def sent?
17
+ !!attributes.sent
18
+ end
19
+
20
+ def user
21
+ if user_relationship = relationships[:user]
22
+ HackerOne::Client::User.new(user_relationship[:data])
23
+ end
24
+ end
25
+
26
+ def address
27
+ if address_relationship = relationships[:address]
28
+ HackerOne::Client::Address.new(address_relationship[:data])
29
+ end
30
+ end
31
+
32
+ def mark_as_sent!
33
+ body = {
34
+ type: "swag",
35
+ attributes: {
36
+ sent: true
37
+ }
38
+ }
39
+
40
+ response_json = make_put_request("programs/#{@program.id}/swag/#{id}", request_body: body)
41
+ self.class.new(response_json, @program)
42
+ end
43
+
14
44
  private
15
45
 
16
46
  def attributes
17
47
  OpenStruct.new(@swag[:attributes])
18
48
  end
49
+
50
+ def relationships
51
+ @swag[:relationships]
52
+ end
19
53
  end
20
54
  end
21
55
  end
@@ -1,5 +1,5 @@
1
1
  module Hackerone
2
2
  module Client
3
- VERSION = "0.13.0"
3
+ VERSION = "0.14.0"
4
4
  end
5
5
  end
@@ -11,6 +11,7 @@ require_relative "client/user"
11
11
  require_relative "client/group"
12
12
  require_relative "client/structured_scope"
13
13
  require_relative "client/swag"
14
+ require_relative "client/address"
14
15
  require_relative "client/bounty"
15
16
  require_relative "client/incremental/activities"
16
17
 
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hackerone-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil Matatall
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-19 00:00:00.000000000 Z
11
+ date: 2019-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.14'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.14'
27
27
  - !ruby/object:Gem::Dependency
@@ -115,6 +115,7 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - ".github/workflows/build.yml"
118
119
  - ".gitignore"
119
120
  - ".rspec"
120
121
  - ".travis.yml"
@@ -151,6 +152,8 @@ files:
151
152
  - fixtures/vcr_cassettes/server_error_when_assigning_report_to_user.yml
152
153
  - fixtures/vcr_cassettes/stage_change.yml
153
154
  - fixtures/vcr_cassettes/suggest_a_bounty.yml
155
+ - fixtures/vcr_cassettes/swag.yml
156
+ - fixtures/vcr_cassettes/swag_sent.yml
154
157
  - fixtures/vcr_cassettes/traverse_through_3_activities.yml
155
158
  - fixtures/vcr_cassettes/traverse_through_all_activities.yml
156
159
  - fixtures/vcr_cassettes/triage_and_hook_assign_report_to_user.yml
@@ -158,6 +161,7 @@ files:
158
161
  - hackerone-client.gemspec
159
162
  - lib/hackerone/client.rb
160
163
  - lib/hackerone/client/activity.rb
164
+ - lib/hackerone/client/address.rb
161
165
  - lib/hackerone/client/bounty.rb
162
166
  - lib/hackerone/client/group.rb
163
167
  - lib/hackerone/client/incremental/activities.rb
@@ -190,8 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
194
  - !ruby/object:Gem::Version
191
195
  version: '0'
192
196
  requirements: []
193
- rubyforge_project:
194
- rubygems_version: 2.7.6
197
+ rubygems_version: 3.0.1
195
198
  signing_key:
196
199
  specification_version: 4
197
200
  summary: A limited client for the HackerOne API