chef-api 0.10.7 → 0.10.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef-api.rb +2 -2
- data/lib/chef-api/authentication.rb +4 -4
- data/lib/chef-api/connection.rb +5 -5
- data/lib/chef-api/defaults.rb +2 -2
- data/lib/chef-api/errors.rb +1 -1
- data/lib/chef-api/multipart.rb +2 -2
- data/lib/chef-api/resources/base.rb +3 -1
- data/lib/chef-api/resources/user.rb +3 -1
- data/lib/chef-api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9190cfe613a46da5a280ffc69ba7f58a0a955a354e3272c166f8e76c8bbbbc49
|
4
|
+
data.tar.gz: a8851cab2284d7935300c90883eb27ffc3c88673cb1d3566528fb37167a120de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5275c0487d47da3cb81c1a9eff0bb07cdd5a71fe24534dff2b5e78e547db9c8c2e65b63fc817b0041f952770ea10a97e5438083829ed4c0a76439a37b225970e
|
7
|
+
data.tar.gz: bf8f4fb60b9c8da3a4071da529f4b54093bf73c80d0e806594f6ed741f4d8df8e2dc6ddd69bcc4fae9779c65a2d4f305d73919fc19dbcd7d19a1343cff114ad1
|
data/lib/chef-api.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require "base64"
|
2
|
-
require "digest"
|
3
|
-
require "openssl"
|
4
|
-
require "time"
|
1
|
+
require "base64" unless defined?(Base64)
|
2
|
+
require "digest" unless defined?(Digest)
|
3
|
+
require "openssl" unless defined?(OpenSSL)
|
4
|
+
require "time" unless defined?(Time)
|
5
5
|
|
6
6
|
#
|
7
7
|
# DEBUG steps:
|
data/lib/chef-api/connection.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require "net/http"
|
2
|
-
require "
|
3
|
-
require "
|
4
|
-
require "
|
1
|
+
require "net/http" unless defined?(Net::HTTP)
|
2
|
+
require "openssl" unless defined?(OpenSSL)
|
3
|
+
require "uri" unless defined?(URI)
|
4
|
+
require "cgi" unless defined?(CGI)
|
5
5
|
|
6
6
|
module ChefAPI
|
7
7
|
#
|
@@ -376,7 +376,7 @@ module ChefAPI
|
|
376
376
|
#
|
377
377
|
def to_query_string(hash)
|
378
378
|
hash.map do |key, value|
|
379
|
-
"#{
|
379
|
+
"#{CGI.escape(key.to_s)}=#{CGI.escape(value.to_s)}"
|
380
380
|
end.join("&")[/.+/]
|
381
381
|
end
|
382
382
|
|
data/lib/chef-api/defaults.rb
CHANGED
data/lib/chef-api/errors.rb
CHANGED
data/lib/chef-api/multipart.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module ChefAPI
|
2
2
|
class Resource::Base
|
3
3
|
class << self
|
4
|
+
require "cgi" unless defined?(CGI)
|
5
|
+
|
4
6
|
# Including the Enumberable module gives us magic
|
5
7
|
include Enumerable
|
6
8
|
|
@@ -512,7 +514,7 @@ module ChefAPI
|
|
512
514
|
raise Error::MissingURLParameter.new(param: key)
|
513
515
|
end
|
514
516
|
|
515
|
-
|
517
|
+
CGI.escape(value)
|
516
518
|
end.sub(%r{^/}, "") # Remove leading slash
|
517
519
|
end
|
518
520
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module ChefAPI
|
2
2
|
class Resource::User < Resource::Base
|
3
|
+
require "cgi" unless defined?(CGI)
|
4
|
+
|
3
5
|
collection_path "/users"
|
4
6
|
|
5
7
|
schema do
|
@@ -38,7 +40,7 @@ module ChefAPI
|
|
38
40
|
# HEC/EC returns a slightly different response than OSC/CZ
|
39
41
|
if users.is_a?(Array)
|
40
42
|
users.each do |info|
|
41
|
-
name =
|
43
|
+
name = CGI.escape(info["user"]["username"])
|
42
44
|
response = connection.get("/users/#{name}")
|
43
45
|
result = from_json(response, prefix)
|
44
46
|
|
data/lib/chef-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Vargo
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mixlib-log
|