chef-zero 4.2.3 → 4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +201 -201
- data/README.md +155 -150
- data/Rakefile +31 -31
- data/bin/chef-zero +100 -100
- data/lib/chef_zero.rb +10 -7
- data/lib/chef_zero/chef_data/acl_path.rb +139 -139
- data/lib/chef_zero/chef_data/cookbook_data.rb +240 -240
- data/lib/chef_zero/chef_data/data_normalizer.rb +207 -207
- data/lib/chef_zero/chef_data/default_creator.rb +446 -446
- data/lib/chef_zero/data_store/data_already_exists_error.rb +29 -29
- data/lib/chef_zero/data_store/data_error.rb +31 -31
- data/lib/chef_zero/data_store/data_not_found_error.rb +28 -28
- data/lib/chef_zero/data_store/default_facade.rb +149 -149
- data/lib/chef_zero/data_store/interface_v1.rb +67 -67
- data/lib/chef_zero/data_store/interface_v2.rb +18 -18
- data/lib/chef_zero/data_store/memory_store.rb +33 -33
- data/lib/chef_zero/data_store/memory_store_v2.rb +155 -155
- data/lib/chef_zero/data_store/raw_file_store.rb +147 -147
- data/lib/chef_zero/data_store/v1_to_v2_adapter.rb +142 -142
- data/lib/chef_zero/data_store/v2_to_v1_adapter.rb +107 -107
- data/lib/chef_zero/endpoints/acl_endpoint.rb +38 -38
- data/lib/chef_zero/endpoints/acls_endpoint.rb +29 -29
- data/lib/chef_zero/endpoints/actor_endpoint.rb +94 -88
- data/lib/chef_zero/endpoints/actors_endpoint.rb +64 -64
- data/lib/chef_zero/endpoints/authenticate_user_endpoint.rb +31 -31
- data/lib/chef_zero/endpoints/container_endpoint.rb +22 -22
- data/lib/chef_zero/endpoints/containers_endpoint.rb +13 -13
- data/lib/chef_zero/endpoints/cookbook_endpoint.rb +39 -39
- data/lib/chef_zero/endpoints/cookbook_version_endpoint.rb +119 -119
- data/lib/chef_zero/endpoints/cookbooks_base.rb +65 -65
- data/lib/chef_zero/endpoints/cookbooks_endpoint.rb +19 -19
- data/lib/chef_zero/endpoints/data_bag_endpoint.rb +45 -45
- data/lib/chef_zero/endpoints/data_bag_item_endpoint.rb +25 -25
- data/lib/chef_zero/endpoints/data_bags_endpoint.rb +23 -23
- data/lib/chef_zero/endpoints/environment_cookbook_endpoint.rb +24 -24
- data/lib/chef_zero/endpoints/environment_cookbook_versions_endpoint.rb +123 -123
- data/lib/chef_zero/endpoints/environment_cookbooks_endpoint.rb +22 -22
- data/lib/chef_zero/endpoints/environment_endpoint.rb +33 -33
- data/lib/chef_zero/endpoints/environment_nodes_endpoint.rb +23 -23
- data/lib/chef_zero/endpoints/environment_recipes_endpoint.rb +22 -22
- data/lib/chef_zero/endpoints/environment_role_endpoint.rb +36 -36
- data/lib/chef_zero/endpoints/file_store_file_endpoint.rb +22 -22
- data/lib/chef_zero/endpoints/group_endpoint.rb +20 -20
- data/lib/chef_zero/endpoints/groups_endpoint.rb +13 -13
- data/lib/chef_zero/endpoints/license_endpoint.rb +25 -25
- data/lib/chef_zero/endpoints/node_endpoint.rb +17 -17
- data/lib/chef_zero/endpoints/node_identifiers_endpoint.rb +22 -0
- data/lib/chef_zero/endpoints/not_found_endpoint.rb +11 -11
- data/lib/chef_zero/endpoints/organization_association_request_endpoint.rb +22 -22
- data/lib/chef_zero/endpoints/organization_association_requests_endpoint.rb +30 -29
- data/lib/chef_zero/endpoints/organization_authenticate_user_endpoint.rb +26 -26
- data/lib/chef_zero/endpoints/organization_endpoint.rb +46 -41
- data/lib/chef_zero/endpoints/organization_user_base.rb +15 -0
- data/lib/chef_zero/endpoints/organization_user_endpoint.rb +26 -48
- data/lib/chef_zero/endpoints/organization_users_endpoint.rb +43 -14
- data/lib/chef_zero/endpoints/organization_validator_key_endpoint.rb +20 -20
- data/lib/chef_zero/endpoints/organizations_endpoint.rb +62 -55
- data/lib/chef_zero/endpoints/policies_endpoint.rb +151 -154
- data/lib/chef_zero/endpoints/principal_endpoint.rb +42 -42
- data/lib/chef_zero/endpoints/rest_list_endpoint.rb +42 -42
- data/lib/chef_zero/endpoints/rest_object_endpoint.rb +63 -63
- data/lib/chef_zero/endpoints/role_endpoint.rb +16 -16
- data/lib/chef_zero/endpoints/role_environments_endpoint.rb +14 -14
- data/lib/chef_zero/endpoints/sandbox_endpoint.rb +27 -27
- data/lib/chef_zero/endpoints/sandboxes_endpoint.rb +50 -50
- data/lib/chef_zero/endpoints/search_endpoint.rb +194 -192
- data/lib/chef_zero/endpoints/searches_endpoint.rb +18 -18
- data/lib/chef_zero/endpoints/server_api_version_endpoint.rb +14 -0
- data/lib/chef_zero/endpoints/system_recovery_endpoint.rb +30 -30
- data/lib/chef_zero/endpoints/user_association_request_endpoint.rb +40 -40
- data/lib/chef_zero/endpoints/user_association_requests_count_endpoint.rb +19 -19
- data/lib/chef_zero/endpoints/user_association_requests_endpoint.rb +19 -19
- data/lib/chef_zero/endpoints/user_organizations_endpoint.rb +22 -22
- data/lib/chef_zero/endpoints/version_endpoint.rb +12 -12
- data/lib/chef_zero/log.rb +7 -7
- data/lib/chef_zero/rest_base.rb +242 -214
- data/lib/chef_zero/rest_error_response.rb +11 -11
- data/lib/chef_zero/rest_request.rb +69 -65
- data/lib/chef_zero/rest_router.rb +45 -45
- data/lib/chef_zero/rspec.rb +308 -308
- data/lib/chef_zero/server.rb +642 -637
- data/lib/chef_zero/socketless_server_map.rb +92 -92
- data/lib/chef_zero/solr/query/binary_operator.rb +52 -52
- data/lib/chef_zero/solr/query/phrase.rb +23 -23
- data/lib/chef_zero/solr/query/range_query.rb +46 -46
- data/lib/chef_zero/solr/query/regexpable_query.rb +29 -29
- data/lib/chef_zero/solr/query/subquery.rb +37 -37
- data/lib/chef_zero/solr/query/term.rb +45 -45
- data/lib/chef_zero/solr/query/unary_operator.rb +43 -43
- data/lib/chef_zero/solr/solr_doc.rb +53 -53
- data/lib/chef_zero/solr/solr_parser.rb +203 -203
- data/lib/chef_zero/version.rb +3 -3
- data/spec/run_oc_pedant.rb +63 -56
- data/spec/search_spec.rb +32 -32
- data/spec/server_spec.rb +92 -91
- data/spec/socketless_server_map_spec.rb +76 -76
- data/spec/support/oc_pedant.rb +132 -134
- data/spec/support/stickywicket.pem +27 -27
- metadata +10 -15
- data/spec/run_pedant.rb +0 -103
- data/spec/support/pedant.rb +0 -129
data/spec/support/pedant.rb
DELETED
@@ -1,129 +0,0 @@
|
|
1
|
-
# Copyright: Copyright (c) 2012 Opscode, Inc.
|
2
|
-
# License: Apache License, Version 2.0
|
3
|
-
#
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
# See the License for the specific language governing permissions and
|
14
|
-
# limitations under the License.
|
15
|
-
|
16
|
-
# This annotated Pedant configuration file details the various
|
17
|
-
# configuration settings available to you. It is separate from the
|
18
|
-
# actual Pedant::Config class because not all settings have sane
|
19
|
-
# defaults, and not all settings are appropriate in all settings.
|
20
|
-
|
21
|
-
################################################################################
|
22
|
-
# You MUST specify the address of the server the API requests will be
|
23
|
-
# sent to. Only specify protocol, hostname, and port.
|
24
|
-
if ENV['SINGLE_ORG'] || ENV['FILE_STORE']
|
25
|
-
chef_server 'http://127.0.0.1:8889'
|
26
|
-
else
|
27
|
-
chef_server 'http://127.0.0.1:8889/organizations/pedant'
|
28
|
-
end
|
29
|
-
|
30
|
-
# If you are doing development testing, you can specify the address of
|
31
|
-
# the Solr server. The presence of this parameter will enable tests
|
32
|
-
# to force commits to Solr, greatly decreasing the amout of time
|
33
|
-
# needed for testing the search endpoint. This is only an
|
34
|
-
# optimization for development! If you are testing a "live" Chef
|
35
|
-
# Server, or otherwise do not have access to the Solr server from your
|
36
|
-
# testing location, you should not specify a value for this parameter.
|
37
|
-
# The tests will still run, albeit slower, as they will now need to
|
38
|
-
# poll for a period to ensure they are querying committed results.
|
39
|
-
#search_server "http://localhost:8983"
|
40
|
-
|
41
|
-
# Related to the 'search_server' parameter, this specifies the maximum
|
42
|
-
# amout of time (in seconds) that search endpoint requests should be
|
43
|
-
# retried before giving up. If not explicitly set, it will default to
|
44
|
-
# 65 seconds; only set it if you know that your Solr commit interval
|
45
|
-
# differs significantly from this.
|
46
|
-
maximum_search_time 0
|
47
|
-
|
48
|
-
# OSC sends erchef a host header with a port, so this option needs
|
49
|
-
# # to be enabled for Pedant tests to work correctly
|
50
|
-
explicit_port_url true
|
51
|
-
|
52
|
-
# We're starting to break tests up into groups based on different
|
53
|
-
# criteria. The proper API tests (the results of which are viewable
|
54
|
-
# to OPC customers) should be the only ones run by Pedant embedded in
|
55
|
-
# OPC installs. There are other specs that help us keep track of API
|
56
|
-
# cruft that we want to come back and fix later; these shouldn't be
|
57
|
-
# viewable to customers, but we should be able to run them in
|
58
|
-
# development and CI environments. If this parameter is missing or
|
59
|
-
# explicitly `false` only the customer-friendly tests will be run.
|
60
|
-
#
|
61
|
-
# This is mainly here for documentation purposes, since the
|
62
|
-
# command-line `opscode-pedant` utility ultimately determines this
|
63
|
-
# value.
|
64
|
-
include_internal false
|
65
|
-
|
66
|
-
# Test users. The five users specified below are required; their
|
67
|
-
# names (:user, :non_org_user, etc.) are indicative of their role
|
68
|
-
# within the tests. All users must have a ':name' key. If they have
|
69
|
-
# a ':create_me' key, Pedant will create these users for you. If you
|
70
|
-
# are using pre-existing users, you must supply a ':key_file' key,
|
71
|
-
# which should be the fully-qualified path /on the machine Pedant is
|
72
|
-
# running on/ to a private key for that user.
|
73
|
-
key = 'spec/support/stickywicket.pem'
|
74
|
-
superuser_name 'admin'
|
75
|
-
superuser_key key
|
76
|
-
webui_key key
|
77
|
-
|
78
|
-
# The Policies endpoint is feature-flagged during development. Zero supports
|
79
|
-
# the policies endpoint, so turn it on:
|
80
|
-
policies? true
|
81
|
-
|
82
|
-
# Set the platform_class
|
83
|
-
platform_class Pedant::OpenSourcePlatform
|
84
|
-
|
85
|
-
requestors({
|
86
|
-
:clients => {
|
87
|
-
# The the admin user, for the purposes of getting things rolling
|
88
|
-
:admin => {
|
89
|
-
:name => "pedant_admin_client",
|
90
|
-
:create_me => true,
|
91
|
-
:create_knife => true,
|
92
|
-
:admin => true
|
93
|
-
},
|
94
|
-
:non_admin => {
|
95
|
-
:name => 'pedant_client',
|
96
|
-
:create_me => true,
|
97
|
-
:create_knife => true
|
98
|
-
},
|
99
|
-
:bad => {
|
100
|
-
:name => 'bad_client',
|
101
|
-
:bogus => true
|
102
|
-
}
|
103
|
-
},
|
104
|
-
:users => {
|
105
|
-
:admin => {
|
106
|
-
:name => "admin",
|
107
|
-
:key_file => key,
|
108
|
-
:create_me => false,
|
109
|
-
:create_knife => false,
|
110
|
-
:admin => true
|
111
|
-
},
|
112
|
-
:non_admin => {
|
113
|
-
:name => "pedant_non_admin_user",
|
114
|
-
:create_me => true,
|
115
|
-
:create_knife => true,
|
116
|
-
:admin => false
|
117
|
-
},
|
118
|
-
# A user for Knife tests. A knife.rb and key files will be set up
|
119
|
-
# for this user
|
120
|
-
:knife_user => {
|
121
|
-
:name => "knifey",
|
122
|
-
:create_me => true,
|
123
|
-
:create_knife => true
|
124
|
-
}
|
125
|
-
}
|
126
|
-
})
|
127
|
-
|
128
|
-
self[:tags] = [:validation, :authentication, :authorization]
|
129
|
-
verify_error_messages false
|