chef-zero 14.0.6 → 14.0.11

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -1
  3. data/Rakefile +11 -14
  4. data/chef-zero.gemspec +4 -8
  5. data/lib/chef_zero.rb +3 -3
  6. data/lib/chef_zero/chef_data/acl_path.rb +2 -2
  7. data/lib/chef_zero/chef_data/cookbook_data.rb +6 -6
  8. data/lib/chef_zero/chef_data/data_normalizer.rb +4 -4
  9. data/lib/chef_zero/chef_data/default_creator.rb +4 -4
  10. data/lib/chef_zero/data_store/default_facade.rb +1 -1
  11. data/lib/chef_zero/data_store/memory_store_v2.rb +5 -5
  12. data/lib/chef_zero/data_store/raw_file_store.rb +2 -2
  13. data/lib/chef_zero/endpoints/acl_endpoint.rb +2 -2
  14. data/lib/chef_zero/endpoints/actor_keys_endpoint.rb +2 -2
  15. data/lib/chef_zero/endpoints/container_endpoint.rb +1 -1
  16. data/lib/chef_zero/endpoints/cookbook_version_endpoint.rb +3 -3
  17. data/lib/chef_zero/endpoints/data_bag_item_endpoint.rb +1 -1
  18. data/lib/chef_zero/endpoints/data_bags_endpoint.rb +1 -1
  19. data/lib/chef_zero/endpoints/environment_cookbook_versions_endpoint.rb +1 -1
  20. data/lib/chef_zero/endpoints/environment_endpoint.rb +1 -1
  21. data/lib/chef_zero/endpoints/file_store_file_endpoint.rb +1 -1
  22. data/lib/chef_zero/endpoints/group_endpoint.rb +1 -1
  23. data/lib/chef_zero/endpoints/node_endpoint.rb +5 -5
  24. data/lib/chef_zero/endpoints/node_identifiers_endpoint.rb +3 -3
  25. data/lib/chef_zero/endpoints/nodes_endpoint.rb +5 -5
  26. data/lib/chef_zero/endpoints/not_found_endpoint.rb +1 -1
  27. data/lib/chef_zero/endpoints/organization_endpoint.rb +3 -3
  28. data/lib/chef_zero/endpoints/organization_users_endpoint.rb +1 -1
  29. data/lib/chef_zero/endpoints/organization_validator_key_endpoint.rb +1 -1
  30. data/lib/chef_zero/endpoints/organizations_endpoint.rb +4 -4
  31. data/lib/chef_zero/endpoints/rest_list_endpoint.rb +2 -2
  32. data/lib/chef_zero/endpoints/rest_object_endpoint.rb +1 -1
  33. data/lib/chef_zero/endpoints/role_endpoint.rb +1 -1
  34. data/lib/chef_zero/endpoints/sandbox_endpoint.rb +5 -5
  35. data/lib/chef_zero/endpoints/sandboxes_endpoint.rb +9 -9
  36. data/lib/chef_zero/endpoints/user_association_request_endpoint.rb +1 -1
  37. data/lib/chef_zero/rest_base.rb +4 -4
  38. data/lib/chef_zero/rspec.rb +3 -3
  39. data/lib/chef_zero/server.rb +19 -19
  40. data/lib/chef_zero/solr/query/range_query.rb +1 -1
  41. data/lib/chef_zero/solr/query/regexpable_query.rb +3 -3
  42. data/lib/chef_zero/solr/solr_parser.rb +1 -1
  43. data/lib/chef_zero/version.rb +1 -1
  44. data/spec/server_spec.rb +4 -4
  45. data/spec/support/oc_pedant.rb +32 -32
  46. metadata +8 -45
  47. data/README.md +0 -168
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.0.6
4
+ version: 14.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-23 00:00:00.000000000 Z
11
+ date: 2018-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log
@@ -79,6 +79,9 @@ dependencies:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
81
  version: '2.0'
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 2.0.6
82
85
  type: :runtime
83
86
  prerelease: false
84
87
  version_requirements: !ruby/object:Gem::Requirement
@@ -86,48 +89,9 @@ dependencies:
86
89
  - - "~>"
87
90
  - !ruby/object:Gem::Version
88
91
  version: '2.0'
89
- - !ruby/object:Gem::Dependency
90
- name: pry
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: '0'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: '0'
103
- - !ruby/object:Gem::Dependency
104
- name: pry-byebug
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
92
  - - ">="
108
93
  - !ruby/object:Gem::Version
109
- version: '0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- version: '0'
117
- - !ruby/object:Gem::Dependency
118
- name: pry-stack_explorer
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - ">="
122
- - !ruby/object:Gem::Version
123
- version: '0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- version: '0'
94
+ version: 2.0.6
131
95
  - !ruby/object:Gem::Dependency
132
96
  name: rake
133
97
  requirement: !ruby/object:Gem::Requirement
@@ -166,7 +130,6 @@ extra_rdoc_files: []
166
130
  files:
167
131
  - Gemfile
168
132
  - LICENSE
169
- - README.md
170
133
  - Rakefile
171
134
  - bin/chef-zero
172
135
  - chef-zero.gemspec
@@ -284,9 +247,9 @@ files:
284
247
  - spec/support/oc_pedant.rb
285
248
  - spec/support/secrets.json
286
249
  - spec/support/stickywicket.pem
287
- homepage: http://www.chef.io
250
+ homepage: https://github.com/chef/chef-zero
288
251
  licenses:
289
- - Apache 2.0
252
+ - Apache-2.0
290
253
  metadata: {}
291
254
  post_install_message:
292
255
  rdoc_options: []
data/README.md DELETED
@@ -1,168 +0,0 @@
1
- # Chef Zero
2
-
3
- [![Status](https://travis-ci.org/chef/chef-zero.svg?branch=master)](https://travis-ci.org/chef/chef-zero) [![Gem Version](https://badge.fury.io/rb/chef-zero.svg)](http://badge.fury.io/rb/chef-zero)
4
-
5
- ## Description
6
-
7
- Chef Zero is a simple, easy-install, in-memory Chef server that can be useful for Chef Client testing and chef-solo-like tasks that require a full Chef Server. It IS intended to be simple, Chef 11+ compliant, easy to run and fast to start. It is NOT intended to be secure, scalable, performant or persistent. It does NO input validation, authentication or authorization (it will not throw a 400, 401 or 403). It does not save data, and will start up empty each time you start it.
8
-
9
- Because Chef Zero runs in memory, it's super fast and lightweight. This makes it perfect for testing against a "real" Chef Server without mocking the entire Internet.
10
-
11
- ## Installation
12
-
13
- This server can be installed as a Ruby Gem.
14
-
15
- ```bash
16
- $ gem install chef-zero
17
- ```
18
-
19
- If you're using bundler, add `chef-zero` as a development dependency:
20
-
21
- ```ruby
22
- group :development do
23
- gem 'chef-zero'
24
- end
25
- ```
26
-
27
- Or in a `.gemspec`
28
-
29
- ```ruby
30
- s.add_development_dependency 'chef-zero'
31
- ```
32
-
33
- You can also clone the source repository and install it using `rake install`.
34
-
35
- ## Usage
36
-
37
- One of chef-zero's primary uses is as a small test server for people writing and testing clients. Here's a simple example of starting it up:
38
-
39
- ```ruby
40
- require 'chef_zero/server'
41
- server = ChefZero::Server.new(port: 4000)
42
- server.start
43
- ```
44
-
45
- This will create a server instance in the foreground. To stop the server:
46
-
47
- ```ruby
48
- server.stop
49
- ```
50
-
51
- This is great for debugging and logging requests, but you'll probably want to run this in the background so you have full control of your thread.
52
-
53
- To run Chef Zero in the background, simply issue the `start_background` command:
54
-
55
- ```ruby
56
- require 'chef_zero/server'
57
- server = ChefZero::Server.new(port: 4000)
58
- server.start_background
59
- ```
60
-
61
- You can stop the server the same way:
62
-
63
- ```ruby
64
- server.stop
65
- ```
66
-
67
- ### Valid Options
68
-
69
- You may currently pass the following options to the initializer:
70
-
71
- - `host` - the host to run on (Default: '127.0.0.1')
72
- - `port` - the port to run on (Default: 8889)
73
- - `debug` - run in debug mode to see all requests and responses (Default: false)
74
-
75
- ## CLI (Command Line)
76
-
77
- If you don't want to use Chef Zero as a library, you can simply start an instance with the included `chef-zero` executable:
78
-
79
- ```bash
80
- $ chef-zero
81
- ```
82
-
83
- Note, this will run in the foreground.
84
-
85
- You now have a fully functional (empty) Chef Server running.
86
-
87
- To try it out, go into the `chef-zero/playground` directory and run `knife`. It will behave the same as a normal Chef Server, and all normal knife commands will work (show, list, delete, from file, upload, download, diff ...). For example, with +knife-essentials+ (or Chef 11) you can upload everything in the repo:
88
-
89
- ```bash
90
- chef-zero/playground> knife upload .
91
- Created nodes/desktop.json
92
- Created data_bags/dns
93
- Created environments/production.json
94
- Created nodes/lb.json
95
- Created nodes/dns.json
96
- Created nodes/ldap.json
97
- Created nodes/www.json
98
- Created data_bags/dns/services.json
99
- Created environments/staging.json
100
- Created data_bags/passwords
101
- Created data_bags/users
102
- Created data_bags/users/jkeiser.json
103
- Created data_bags/passwords/github.json
104
- Created data_bags/passwords/twitter.json
105
- Created data_bags/users/schisamo.json
106
- Created data_bags/users/sethvargo.json
107
- Created cookbooks/apache2
108
- Created cookbooks/php
109
-
110
- chef-zero/playground> knife environment list
111
- _default
112
- production
113
- staging
114
- ```
115
-
116
- To use it in your own repository, create a `knife.rb` like so:
117
-
118
- ```ruby
119
- chef_server_url 'http://127.0.0.1:8889'
120
- node_name 'stickywicket'
121
- client_key 'path_to_any_pem_file.pem'
122
- ```
123
-
124
- And use knife like you normally would.
125
-
126
- Since Chef Zero does no authentication, any `.pem` file will do. The client just needs something to sign requests with (which will be ignored on the server). Even though it's ignored, the `.pem` must still be a valid format.
127
-
128
- Now, stop the Chef Zero server and all the data is gone!
129
-
130
- Run `chef-zero --help` to see a list of the supported flags and options:
131
-
132
- ```text
133
- Usage: chef-zero [ARGS]
134
- -H, --host HOST Host to bind to (default: 127.0.0.1)
135
- -p, --port PORT Port to listen on (e.g. 8889, or 8500-8600 or 8885,8888)
136
- --[no-]generate-keys Whether to generate actual keys or fake it (faster). Default: false.
137
- -d, --daemon Run as a daemon process
138
- -l, --log-level LEVEL Set the output log level
139
- --log-file FILE Log to a file
140
- --enterprise Whether to run in enterprise mode
141
- --multi-org Whether to run in multi-org mode
142
- --file-store PATH Persist data to files at the given path
143
- --[no-]ssl Use SSL with self-signed certificate(Auto generate before every run). Default: false.
144
- -h, --help Show this message
145
- --version Show version
146
- ```
147
-
148
- ## Contributing
149
-
150
- For information on contributing to this project see <https://github.com/chef/chef/blob/master/CONTRIBUTING.md>
151
-
152
- ## License
153
-
154
- Copyright 2012-2016, Chef Software, Inc.
155
-
156
- ```
157
- Licensed under the Apache License, Version 2.0 (the "License");
158
- you may not use this file except in compliance with the License.
159
- You may obtain a copy of the License at
160
-
161
- http://www.apache.org/licenses/LICENSE-2.0
162
-
163
- Unless required by applicable law or agreed to in writing, software
164
- distributed under the License is distributed on an "AS IS" BASIS,
165
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
166
- See the License for the specific language governing permissions and
167
- limitations under the License.
168
- ```