chef-zero 15.0.9 → 15.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +4 -2
- data/chef-zero.gemspec +7 -2
- data/lib/chef_zero/endpoints/policy_revision_endpoint.rb +44 -1
- data/lib/chef_zero/endpoints/sandboxes_endpoint.rb +2 -1
- data/lib/chef_zero/server.rb +2 -1
- data/lib/chef_zero/version.rb +1 -1
- data/spec/run_oc_pedant.rb +2 -1
- metadata +48 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04c149e0bfc367d62c582cb488f9a4a36c98e126e1f956be300905cff7ce79c2
|
4
|
+
data.tar.gz: 8dd05e4e6d51d7b875e406deadfc59814ca76f7be56433a149665ddab9312123
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c7f1b16510d565922b70b0643969fa9a15b780a8da0a2d6e81c9d2bd246b1bcef74b58ab04ab84430273b179194252b4f48ff7fe2941472319bfa8a37b7dade
|
7
|
+
data.tar.gz: 6ec5789ca973167914b30a7aef7093669f74be46e0f2ffaf4de51fcc1a1ed110ece46f07c46e0f5c6a7309f1a32af28087d30935b753ed2905c16ff8605c6286
|
data/Gemfile
CHANGED
@@ -8,6 +8,8 @@ group :pedant do
|
|
8
8
|
gem "oc-chef-pedant", git: "https://github.com/chef/chef-server.git", branch: "main"
|
9
9
|
end
|
10
10
|
|
11
|
+
gem "ffi", ">= 1.15.5", "< 1.17.0"
|
12
|
+
|
11
13
|
group :development, :test do
|
12
14
|
gem "chefstyle"
|
13
15
|
gem "rake"
|
@@ -18,8 +20,8 @@ if ENV["GEMFILE_MOD"]
|
|
18
20
|
puts "GEMFILE_MOD: #{ENV["GEMFILE_MOD"]}"
|
19
21
|
instance_eval(ENV["GEMFILE_MOD"])
|
20
22
|
else
|
21
|
-
gem "chef", "~>
|
22
|
-
gem "ohai", "~>
|
23
|
+
gem "chef", "~> 18.6"
|
24
|
+
gem "ohai", "~> 18.0"
|
23
25
|
end
|
24
26
|
|
25
27
|
group :debug do
|
data/chef-zero.gemspec
CHANGED
@@ -11,13 +11,18 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.homepage = "https://github.com/chef/chef-zero"
|
12
12
|
s.license = "Apache-2.0"
|
13
13
|
|
14
|
-
s.required_ruby_version = ">=
|
14
|
+
s.required_ruby_version = ">= 3.0"
|
15
15
|
|
16
|
+
# Note: 7.1.0 does not defaults its cache_format_version to 7.1 but 6.1 instead which gives deprecation warnings
|
17
|
+
# Remove the version constraint when we can upgrade to 7.1.1 post stable release of Activesupport 7.1
|
18
|
+
# Similar issue with 7.0 existed: https://github.com/rails/rails/pull/45293
|
19
|
+
s.add_dependency "activesupport", "~> 7.0", "< 7.1"
|
16
20
|
s.add_dependency "mixlib-log", ">= 2.0", "< 4.0"
|
17
21
|
s.add_dependency "hashie", ">= 2.0", "< 5.0"
|
18
22
|
s.add_dependency "uuidtools", "~> 2.1"
|
19
23
|
s.add_dependency "ffi-yajl", "~> 2.2"
|
20
|
-
s.add_dependency "rack", "~>
|
24
|
+
s.add_dependency "rack", "~> 3.1", ">= 3.1.10"
|
25
|
+
s.add_dependency "rackup", "~> 2.2", ">= 2.2.1"
|
21
26
|
s.add_dependency "webrick"
|
22
27
|
|
23
28
|
s.bindir = "bin"
|
@@ -7,7 +7,50 @@ module ChefZero
|
|
7
7
|
# GET /organizations/ORG/policies/NAME/revisions/REVISION
|
8
8
|
def get(request)
|
9
9
|
data = parse_json(get_data(request))
|
10
|
-
|
10
|
+
|
11
|
+
# need to add another field in the response called 'policy_group_list'
|
12
|
+
# example response
|
13
|
+
# {
|
14
|
+
# "revision_id": "909c26701e291510eacdc6c06d626b9fa5350d25",
|
15
|
+
# "name": "some_policy_name",
|
16
|
+
# "run_list": [
|
17
|
+
# "recipe[policyfile_demo::default]"
|
18
|
+
# ],
|
19
|
+
# "cookbook_locks": {
|
20
|
+
# "policyfile_demo": {
|
21
|
+
# "identifier": "f04cc40faf628253fe7d9566d66a1733fb1afbe9",
|
22
|
+
# "version": "1.2.3"
|
23
|
+
# }
|
24
|
+
# },
|
25
|
+
# "policy_group_list": ["some_policy_group"]
|
26
|
+
# }
|
27
|
+
data[:policy_group_list] = Array.new
|
28
|
+
|
29
|
+
# extracting policy name and revision
|
30
|
+
request_policy_name = request.rest_path[3]
|
31
|
+
request_policy_revision = request.rest_path[5]
|
32
|
+
|
33
|
+
# updating the request to fetch the policy group list
|
34
|
+
request.rest_path[2] = "policy_groups"
|
35
|
+
request.rest_path = request.rest_path.slice(0,3)
|
36
|
+
|
37
|
+
list_data(request).each do |group_name|
|
38
|
+
group_path = request.rest_path + [group_name]
|
39
|
+
|
40
|
+
# fetching all the policies associated with each group
|
41
|
+
policy_list = list_data(request, group_path + ["policies"])
|
42
|
+
policy_list.each do |policy_name|
|
43
|
+
revision_id = parse_json(get_data(request, group_path + ["policies", policy_name]))
|
44
|
+
|
45
|
+
# if the name and revision matchs, we add the group to the response
|
46
|
+
if (policy_name == request_policy_name) && (revision_id == request_policy_revision)
|
47
|
+
policy_group_list = data[:policy_group_list]
|
48
|
+
data[:policy_group_list] = [group_name] + policy_group_list
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
data = ChefData::DataNormalizer.normalize_policy(data, request_policy_name, request_policy_revision)
|
11
54
|
json_response(200, data)
|
12
55
|
end
|
13
56
|
|
@@ -15,8 +15,9 @@ module ChefZero
|
|
15
15
|
|
16
16
|
needed_checksums = FFI_Yajl::Parser.parse(request.body)["checksums"]
|
17
17
|
result_checksums = {}
|
18
|
+
available_checksums = list_data(request, request.rest_path[0..1] + %w{file_store checksums})
|
18
19
|
needed_checksums.keys.each do |needed_checksum|
|
19
|
-
if
|
20
|
+
if available_checksums.include?(needed_checksum)
|
20
21
|
result_checksums[needed_checksum] = { needs_upload: false }
|
21
22
|
else
|
22
23
|
result_checksums[needed_checksum] = {
|
data/lib/chef_zero/server.rb
CHANGED
@@ -23,6 +23,7 @@ require "timeout" unless defined?(Timeout)
|
|
23
23
|
require "stringio" unless defined?(StringIO)
|
24
24
|
|
25
25
|
require "rack" unless defined?(Rack)
|
26
|
+
require "rackup" unless defined?(Rackup)
|
26
27
|
require "webrick" unless defined?(WEBrick)
|
27
28
|
require "webrick/https"
|
28
29
|
|
@@ -295,7 +296,7 @@ module ChefZero
|
|
295
296
|
end
|
296
297
|
)
|
297
298
|
ENV["HTTPS"] = "on" if options[:ssl]
|
298
|
-
@server.mount("/",
|
299
|
+
@server.mount("/", Rackup::Handler::WEBrick, app)
|
299
300
|
|
300
301
|
# Pick a port
|
301
302
|
# If options[:port] can be an Enumerator, an Array, or an Integer,
|
data/lib/chef_zero/version.rb
CHANGED
data/spec/run_oc_pedant.rb
CHANGED
@@ -191,7 +191,8 @@ begin
|
|
191
191
|
|
192
192
|
"--skip-status",
|
193
193
|
"--skip=email_case_insensitive",
|
194
|
-
"--skip=nginx_default_error"
|
194
|
+
"--skip=nginx_default_error",
|
195
|
+
"--skip=response_headers"
|
195
196
|
]
|
196
197
|
|
197
198
|
# The knife tests are very slow and don't give us a lot of extra coverage,
|
metadata
CHANGED
@@ -1,15 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 15.0.
|
4
|
+
version: 15.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '7.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '7.1'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '7.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '7.1'
|
13
33
|
- !ruby/object:Gem::Dependency
|
14
34
|
name: mixlib-log
|
15
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,20 +104,40 @@ dependencies:
|
|
84
104
|
requirements:
|
85
105
|
- - "~>"
|
86
106
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
107
|
+
version: '3.1'
|
88
108
|
- - ">="
|
89
109
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
110
|
+
version: 3.1.10
|
91
111
|
type: :runtime
|
92
112
|
prerelease: false
|
93
113
|
version_requirements: !ruby/object:Gem::Requirement
|
94
114
|
requirements:
|
95
115
|
- - "~>"
|
96
116
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
117
|
+
version: '3.1'
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: 3.1.10
|
121
|
+
- !ruby/object:Gem::Dependency
|
122
|
+
name: rackup
|
123
|
+
requirement: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - "~>"
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '2.2'
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 2.2.1
|
131
|
+
type: :runtime
|
132
|
+
prerelease: false
|
133
|
+
version_requirements: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '2.2'
|
98
138
|
- - ">="
|
99
139
|
- !ruby/object:Gem::Version
|
100
|
-
version: 2.
|
140
|
+
version: 2.2.1
|
101
141
|
- !ruby/object:Gem::Dependency
|
102
142
|
name: webrick
|
103
143
|
requirement: !ruby/object:Gem::Requirement
|
@@ -252,14 +292,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
252
292
|
requirements:
|
253
293
|
- - ">="
|
254
294
|
- !ruby/object:Gem::Version
|
255
|
-
version: '
|
295
|
+
version: '3.0'
|
256
296
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
257
297
|
requirements:
|
258
298
|
- - ">="
|
259
299
|
- !ruby/object:Gem::Version
|
260
300
|
version: '0'
|
261
301
|
requirements: []
|
262
|
-
rubygems_version: 3.
|
302
|
+
rubygems_version: 3.2.3
|
263
303
|
signing_key:
|
264
304
|
specification_version: 4
|
265
305
|
summary: Self-contained, easy-setup, fast-start in-memory Chef server for testing
|