vinyldns-ruby 0.8.0 → 0.8.1

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: 4ef5dde452df46bed5a65f615d7ab5f4b2660976dbc15bbc5097169620752caa
4
- data.tar.gz: 60ee81b14146092efb081c6a413a7ba966dad7fbddf97d444346c624540ae36d
3
+ metadata.gz: 4fea355780ee7ab55c1337a3e4535594277c8aa110a33f8c8a987a387e565e6f
4
+ data.tar.gz: b4dae93a5333284838208a6af657223861ebce58954f4b6765cc418b927778f3
5
5
  SHA512:
6
- metadata.gz: 8d238071ef2c492033c770de76c50ae4935b1611f73f1862b2130aa5286d2218fcc0ebfe079e998efcb7001003b3ccdd70fb145d1808b3610219baa3da018db3
7
- data.tar.gz: 51e9a3621e7997544c905067cfd84741c5708348570f42f874e63bfa7978caf948284a12cd674ffaa40028884a199a7d1bca98a5542b8069626a8943e14753fa
6
+ metadata.gz: f0d2c26747c776ff20307cbb7079dc058a694deec582ee29b52df330fc82e72de100b7f9c876f3fc40a8544afadc0188d2bafcacd72c7fd3216383f8b322cdec
7
+ data.tar.gz: 64c1b77c83ce367e64da7f66fb6feb62c94d588ffd0e40b0484a42481473145559d40ec75a5fda20caf06d05f416cb292e08d190cc8a292108c2ec7fedbd85fc
data/.gitignore CHANGED
@@ -1,4 +1,6 @@
1
1
  Gemfile.lock
2
2
  .idea
3
3
  pkg
4
- .DS_Store
4
+ .DS_Store
5
+ *.gem
6
+ api
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ sudo: false
2
+ language: ruby
3
+
4
+ services:
5
+ - docker
6
+
7
+ script:
8
+ - make test
9
+
data/CONTRIBUTING.md CHANGED
@@ -64,6 +64,12 @@ Include details about your configuration and environment:
64
64
  * Fill in [the required template](PULL_REQUEST_TEMPLATE.md)
65
65
  * Do not include issue numbers in the PR title
66
66
 
67
+ ### Contributor License Agreement
68
+
69
+ Before Comcast merges your code into the project you must sign the [Comcast Contributor License Agreement (CLA)](https://gist.github.com/ComcastOSS/a7b8933dd8e368535378cda25c92d19a).
70
+
71
+ If you haven't previously signed a Comcast CLA, you'll automatically be asked to when you open a pull request. Alternatively, we can send you a PDF that you can sign and scan back to us. Please create a new GitHub issue to request a PDF version of the CLA.
72
+
67
73
  ## Styleguides
68
74
 
69
75
  ### Git Commit Messages
data/Makefile CHANGED
@@ -1,5 +1,8 @@
1
- init:
2
- pip install -r requirements.txt
1
+ start-api:
2
+ ./scripts/start_api
3
3
 
4
- test:
5
- nosetests tests
4
+ stop-api:
5
+ ./scripts/stop_api
6
+
7
+ test: start-api
8
+ ./scripts/run_tests
data/NOTICE ADDED
@@ -0,0 +1,17 @@
1
+ vinyldns-ruby
2
+
3
+ Copyright 2018 Comcast Cable Communications Management, LLC
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+
17
+ This product includes software developed at Comcast (http://www.comcast.com/).
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Ruby gem for working with VinylDNS.
4
4
 
5
- * It was built around the API documentation
5
+ * It was built around [the API](https://www.vinyldns.io/api/)
6
6
  * It relies, currently, on the AWS-SDK to sign the HTTP requests it makes
7
7
 
8
8
  # Requirements
@@ -11,7 +11,7 @@ Ruby gem for working with VinylDNS.
11
11
  2. ```ENV['VINYLDNS_ACCESS_KEY_ID']``` & ```ENV['VINYLDNS_SECRET_ACCESS_KEY']``` are set in your application or local shell
12
12
  * You can find both of these within the portal by downloading your credentials file
13
13
  3. ```ENV['VINYLDNS_API_URL']``` is set with your api url (if applicable include http[s]:// and port)
14
-
14
+
15
15
  # Installation
16
16
 
17
17
  Add this line to your application's Gemfile:
@@ -34,7 +34,8 @@ This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDU
34
34
 
35
35
  * Each method returns a JSON object
36
36
  * The methods request an 'api_request_object' with the HTTP Method specified like: ```Vinyldns::API.new('get')```, then perform a variation of ```Vinyldns::API.make_request(api_request_object, "zones/#{zone_id}")```
37
- * Method parameters match the HTTP Request Parameter requirements in the API. See the API Reference for more information.
37
+ * Method parameters match the HTTP Request Parameter requirements in the API. See the [API Reference](https://www.vinyldns.io/api/) for more information.
38
+ * SSL verification is enabled by default; `ENV['VINYLDNS_VERIFY_SSL']` can be set to false in order to disable.
38
39
 
39
40
  ## Contributing
40
41
 
@@ -156,3 +157,6 @@ If you decide to contribute, please read over our [contributor documentation](CO
156
157
  - list_group_members(id, max_items = 5, start_from = nil)
157
158
 
158
159
  - get_group_activity(id, max_items = 5, start_from = nil)
160
+
161
+ # Maintainers
162
+ * [Nathan Pierce](https://github.com/NorseGaud)
data/Rakefile CHANGED
@@ -21,3 +21,12 @@ end
21
21
  require 'rake'
22
22
 
23
23
  require 'bundler/gem_tasks'
24
+
25
+ begin
26
+ require 'rspec/core/rake_task'
27
+
28
+ RSpec::Core::RakeTask.new(:spec)
29
+
30
+ task default: :spec
31
+ rescue LoadError
32
+ end
data/lib/vinyldns/api.rb CHANGED
@@ -52,8 +52,12 @@ module Vinyldns
52
52
  )
53
53
  url = URI(signed_object.api_url)
54
54
  https = Net::HTTP.new(url.host, url.port)
55
- https.use_ssl = true
56
- https.verify_mode = OpenSSL::SSL::VERIFY_NONE # SSL not signed? Don't care!
55
+ https.use_ssl = true ? url.scheme == "https" : https.use_ssl = false
56
+ if ENV['VINYLDNS_VERIFY_SSL'] == false || ENV['VINYLDNS_VERIFY_SSL'] =~ /^false$/i
57
+ https.verify_mode = OpenSSL::SSL::VERIFY_NONE
58
+ else
59
+ https.verify_mode = OpenSSL::SSL::VERIFY_PEER
60
+ end
57
61
  request = Net::HTTP::Post.new(uri == '/' ? uri : "/#{uri}") if signed_object.method == 'POST'
58
62
  request = Net::HTTP::Put.new(uri == '/' ? uri : "/#{uri}") if signed_object.method == 'PUT'
59
63
  request = Net::HTTP::Get.new(uri == '/' ? uri : "/#{uri}") if signed_object.method == 'GET'
@@ -66,7 +70,7 @@ module Vinyldns
66
70
  JSON.parse(response.body)
67
71
  else
68
72
  return response
69
- #"HTTP Error: #{response.code} #{response.message} : #{response.body}"
73
+ # "HTTP Error: #{response.code} #{response.message} : #{response.body}"
70
74
  end
71
75
  end
72
76
  end
@@ -8,5 +8,5 @@
8
8
  # See the License for the specific language governing permissions and
9
9
  # limitations under the License.
10
10
  module Vinyldns
11
- VERSION = '0.8.0'.freeze
11
+ VERSION = '0.8.1'.freeze
12
12
  end
data/scripts/run_tests ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+
3
+ VINYLDNS_ACCESS_KEY_ID=okAccessKey \
4
+ VINYLDNS_SECRET_ACCESS_KEY=okSecretKey \
5
+ VINYLDNS_API_URL=http://localhost:9000 \
6
+ bundle exec rspec
data/scripts/start_api ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+
3
+ mkdir -p ./api
4
+ git clone https://github.com/vinyldns/vinyldns ./api/
5
+ ./api/bin/docker-up-vinyldns.sh
data/scripts/stop_api ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ./api/bin/remove-vinyl-containers.sh
4
+ rm -rf ./api
data/vinyldns.gemspec CHANGED
@@ -42,5 +42,5 @@ Gem::Specification.new do |gem|
42
42
  # Dependencies
43
43
  # Licensed uses the the libgit2 bindings for Ruby provided by rugged. rugged has its own dependencies - cmake and pkg-config - which you may need to install before you can install Licensed.
44
44
  # For example, on macOS with Homebrew: brew install cmake pkg-config and on Ubuntu: apt-get install cmake pkg-config.
45
- gem.add_development_dependency 'licensed', '1.0.0'
45
+ gem.add_development_dependency 'licensed', '1.5.2'
46
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vinyldns-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Pierce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-26 00:00:00.000000000 Z
11
+ date: 2019-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sigv4
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 1.0.0
75
+ version: 1.5.2
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 1.0.0
82
+ version: 1.5.2
83
83
  description: Ruby gem containing methods to perform various API requests in VinylDNS
84
84
  email: nathan_pierce@comcast.com
85
85
  executables: []
@@ -92,12 +92,14 @@ files:
92
92
  - ".licenses/rubygem/vinyldns-ruby.txt"
93
93
  - ".rspec"
94
94
  - ".rubocop.yml"
95
+ - ".travis.yml"
95
96
  - CODE_OF_CONDUCT.md
96
97
  - CONTRIBUTING.md
97
98
  - Gemfile
98
99
  - ISSUE_TEMPLATE.md
99
100
  - LICENSE
100
101
  - Makefile
102
+ - NOTICE
101
103
  - PULL_REQUEST_TEMPLATE.md
102
104
  - README.md
103
105
  - Rakefile
@@ -106,6 +108,9 @@ files:
106
108
  - lib/vinyldns/api/group/group.rb
107
109
  - lib/vinyldns/api/zone/zone.rb
108
110
  - lib/vinyldns/version.rb
111
+ - scripts/run_tests
112
+ - scripts/start_api
113
+ - scripts/stop_api
109
114
  - vinyldns.gemspec
110
115
  homepage: https://github.com/vinyldns/vinyldns-ruby
111
116
  licenses:
@@ -126,8 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
131
  - !ruby/object:Gem::Version
127
132
  version: '0'
128
133
  requirements: []
129
- rubyforge_project:
130
- rubygems_version: 2.7.4
134
+ rubygems_version: 3.0.1
131
135
  signing_key:
132
136
  specification_version: 4
133
137
  summary: Ruby gem for VinylDNS