chef-infra-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: c8ca98919801b5c0d0baf4ef0e2b4523efb24b3ee2aa65e04fc9d5473ec6c373
|
4
|
+
data.tar.gz: eff96d984676e726e4a4c0a5b67b9dca76800a4e373d71b8e50b0e5f0fec9b58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1647ff4a3dda7b6e8179417cfbb0c7ba1c56cc0707848e8d65ea4046d6c212c3c0c2e4331e2560a9773e64f261b56c35c93a4c8bf3de1a1e98611333719d25ef
|
7
|
+
data.tar.gz: c6f799df264a08315a6688887be7da5a2c5b516e4b24645fc54d22470c3faac7e1669002b6ae286a073efe6a70a0571ade14c63e585c20d9dcab87a412381c32
|
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-infra-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
|