sonar-client 0.0.9 → 0.1.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
  SHA1:
3
- metadata.gz: 44bc1c4f74efaf45f7278f7d6c9088aac904ba12
4
- data.tar.gz: 4eefe89872fa73d36ee480cbdea39bd259937e73
3
+ metadata.gz: b5300d330259f4b803e14cde0d03922a93d31536
4
+ data.tar.gz: b79890de15b23b1cdead6778d90b20a33d182ad7
5
5
  SHA512:
6
- metadata.gz: 2c1a22b2aa4749e1d86d88d146bdcbb983d3f15f4b4fdc690915dd1f88c25c026e4df50025b3884d924ac38f73938a70401ca448f07ce2d8ecdda2ef77c4e403
7
- data.tar.gz: 7ee849d4e4e84add1cad073fcf1b9d507ba987fd7e28aa870a19677fe4fb0d6963da88dc9c69078fadbfea66eebe9e89a3a2bcab3be15506ab651838d6eca708
6
+ metadata.gz: 7c3e3181cf69d1bc9f2de4fc63f10414f7e414b73bc7144b818e63725d5f40fc49fa24f97e0cf990f05c7a42cbd459c12d5367a8e1a76e6b1b4ee61c5e631492
7
+ data.tar.gz: 69e4119f5780e963b34adc3cd63a96bec198a9e4da2a88b7dc14f7e2c106eb911ddc7a226ecdb78301f4056107d1858a7ffcfac583312e8f53373895bfe330a1
data/.gitignore CHANGED
@@ -7,7 +7,6 @@ lib/bundler/man
7
7
  pkg
8
8
  rdoc
9
9
  spec/reports
10
- spec/cassette
11
10
  test/tmp
12
11
  test/version_tmp
13
12
  tmp
data/.travis.yml ADDED
@@ -0,0 +1,18 @@
1
+ language: ruby
2
+ sudo: false
3
+ cache: bundler
4
+ rvm:
5
+ - 2.1.5
6
+ - jruby
7
+ before_install:
8
+ - "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
9
+ - rake --version
10
+ before_script:
11
+ - bundle exec rake --version
12
+ script: bundle exec rspec
13
+ #
14
+ # Environment variables should be set in Travis repository settings per
15
+ # https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
16
+ #
17
+ # Required vars are SONAR_API_URL, SONAR_EMAIL, and SONAR_TOKEN
18
+ #
data/README.md CHANGED
@@ -3,6 +3,9 @@ sonar-client
3
3
 
4
4
  Ruby API Wrapper and CLI for [Sonar](https://sonar.labs.rapid7.com)
5
5
 
6
+ [![Gem Version](https://badge.fury.io/rb/sonar-client.svg)](http://badge.fury.io/rb/sonar-client)
7
+ [![Build Status](https://travis-ci.org/rapid7/sonar-client.svg?branch=master)](https://travis-ci.org/rapid7/sonar-client)
8
+
6
9
  ## Installation
7
10
 
8
11
  Install the gem by running
@@ -57,7 +60,7 @@ Until they're mocked, specs are run against a live API, either production, stagi
57
60
  ```
58
61
  # Sonar config
59
62
  export SONAR_TOKEN=asldkstokenalskdjf
60
- export SONAR_API_URL=http://sonar-staging.labs.rapid7.com/
63
+ export SONAR_API_URL=http://sonar.labs.rapid7.com/
61
64
  export SONAR_EMAIL=youremail@example.com
62
65
  ```
63
66
 
data/lib/sonar/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sonar
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -0,0 +1,103 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://sonar.labs.rapid7.com/api/v2/metasploit_verify
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"product_key":"SOME-VALID-KEY"}'
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Content-Type:
13
+ - application/json
14
+ User-Agent:
15
+ - Sonar 0.0.8 Ruby Gem
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Thu, 19 Nov 2015 04:53:25 GMT
25
+ Server:
26
+ - Apache
27
+ X-Frame-Options:
28
+ - SAMEORIGIN
29
+ X-Xss-Protection:
30
+ - 1; mode=block
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ Cache-Control:
34
+ - max-age=0, private, must-revalidate
35
+ X-Runtime:
36
+ - '3.898589'
37
+ X-Powered-By:
38
+ - Phusion Passenger 4.0.53
39
+ Set-Cookie:
40
+ - request_method=POST; path=/
41
+ Status:
42
+ - 200 OK
43
+ Transfer-Encoding:
44
+ - chunked
45
+ Content-Type:
46
+ - application/json; charset=utf-8
47
+ body:
48
+ encoding: UTF-8
49
+ string: '{"valid":true,"api_key":"YOUR-VALID-API-KEY","email":"metasploit-sdafsaefaef@rapid7.com"}'
50
+ http_version:
51
+ recorded_at: Thu, 19 Nov 2015 04:54:20 GMT
52
+ - request:
53
+ method: post
54
+ uri: https://sonar.labs.rapid7.com/api/v2/metasploit_verify
55
+ body:
56
+ encoding: UTF-8
57
+ string: '{"product_key":"SOME-VALID-KEY"}'
58
+ headers:
59
+ Accept:
60
+ - application/json
61
+ Content-Type:
62
+ - application/json
63
+ User-Agent:
64
+ - Sonar 0.0.8 Ruby Gem
65
+ X-Sonar-Token:
66
+ - 6e28da9c72c1e2cecd2ac8ae890853fa72d26d55
67
+ X-Sonar-Email:
68
+ - marklinstop@gmail.com
69
+ Accept-Encoding:
70
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
71
+ response:
72
+ status:
73
+ code: 404
74
+ message: Not Found
75
+ headers:
76
+ Content-Type:
77
+ - application/json; charset=utf-8
78
+ Date:
79
+ - Mon, 23 Nov 2015 02:48:56 GMT
80
+ Server:
81
+ - Apache
82
+ Status:
83
+ - 404 Not Found
84
+ X-Content-Type-Options:
85
+ - nosniff
86
+ X-Frame-Options:
87
+ - sameorigin
88
+ X-Powered-By:
89
+ - Phusion Passenger 5.0.16
90
+ X-Request-Id:
91
+ - c5151aa7-f5d9-42d3-963e-6ce32a968921
92
+ X-Runtime:
93
+ - '0.003344'
94
+ Content-Length:
95
+ - '36'
96
+ Connection:
97
+ - keep-alive
98
+ body:
99
+ encoding: UTF-8
100
+ string: '{"status":"404","error":"Not Found"}'
101
+ http_version:
102
+ recorded_at: Mon, 23 Nov 2015 02:49:51 GMT
103
+ recorded_with: VCR 2.8.0
@@ -1,3 +1,3 @@
1
1
  email: email@asdfasdfasfd.com
2
2
  access_token: asdfasdfasdfasdf
3
- api_url: https://sonar-staging.labs.rapid7.com/
3
+ api_url: https://sonar.labs.rapid7.com/
@@ -28,11 +28,11 @@ describe Sonar::Registration do
28
28
  context 'POSTing an invalid product key' do
29
29
  let (:resp) { client.register_metasploit("DDXXXX") }
30
30
 
31
- it 'responds that the license is invalid' do
31
+ xit 'responds that the license is invalid' do
32
32
  expect(resp).to have_key('valid')
33
33
  expect(resp['valid']).to be(false)
34
34
  end
35
- it 'responds with an error message' do
35
+ xit 'responds with an error message' do
36
36
  expect(resp).to have_key('error')
37
37
  expect(resp['error']).to match(/not appear to be valid/)
38
38
  end
data/spec/sonar_spec.rb CHANGED
@@ -54,8 +54,8 @@ describe Sonar, skip_autoconfig: true do
54
54
  c.email = "wrong@sowrong.com"
55
55
  c.access_token = "somewrongkey"
56
56
  c.api_version = "v2"
57
- c.api_url = "https://sonar-staging.labs.rapid7.com"
58
57
  end
58
+ puts Sonar.api_url
59
59
  client = Sonar::Client.new
60
60
  @resp = client.search(rdns: "hp.com")
61
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sonar-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Deardorff & HD Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-26 00:00:00.000000000 Z
11
+ date: 2015-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday_middleware
@@ -232,6 +232,7 @@ files:
232
232
  - .gitignore
233
233
  - .rspec
234
234
  - .rubocop.yml
235
+ - .travis.yml
235
236
  - Gemfile
236
237
  - LICENSE
237
238
  - README.md
@@ -248,6 +249,7 @@ files:
248
249
  - lib/sonar/user.rb
249
250
  - lib/sonar/version.rb
250
251
  - sonar-client.gemspec
252
+ - spec/cassette/valid_ms_registration.yml
251
253
  - spec/fixtures/sonar-stock.rc
252
254
  - spec/fixtures/sonar.rc
253
255
  - spec/sonar/certificate_spec.rb
@@ -283,6 +285,7 @@ signing_key:
283
285
  specification_version: 4
284
286
  summary: API Wrapper for Sonar
285
287
  test_files:
288
+ - spec/cassette/valid_ms_registration.yml
286
289
  - spec/fixtures/sonar-stock.rc
287
290
  - spec/fixtures/sonar.rc
288
291
  - spec/sonar/certificate_spec.rb