chef-zero 4.6.2 → 4.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1acaa25987b375f7585f9c0ba11b2b0f508032ea
4
- data.tar.gz: 39c145979190df0cebc077e741f0d94c70e7d391
3
+ metadata.gz: f89ef968f192c0b01a3a0f73ba1e673cfe039849
4
+ data.tar.gz: 99690e56fc15973521597083a17607c943cbab7e
5
5
  SHA512:
6
- metadata.gz: 247ea06777ea0899c5c8e4ad385c920a19c30df5730c7b782b45808e2234b5f7ac02c39450acde589e953818de5b08c7856c29289c7868a37d0b88133bac1c5d
7
- data.tar.gz: 49b1000f437256cc657e09b7dc18a3faec6542d1c1089f0aa097447264864da687301a50d19530a9a7551e9a6b63c033eaa1a6eceec94ea250ad4b05722dc54f
6
+ metadata.gz: b8c05358fe42b17650dc0be8081ffb6d86512999402e919411ba1483692b978e36b91426a12cd2da12c5f63b69f079beaf0ffc06be770848ae006cfeb03e4514
7
+ data.tar.gz: a22b58b10510bc1b6782ad4074202d0d2db5810ffd5b5098a15d3782498017aae7b0b5c206aa067d1e1d690ed4abc9315acdc44f4a4885fb611222acc0d9b3a0
@@ -8,17 +8,17 @@ Gem::Specification.new do |s|
8
8
  s.summary = 'Self-contained, easy-setup, fast-start in-memory Chef server for testing and solo setup purposes'
9
9
  s.description = s.summary
10
10
  s.author = 'John Keiser'
11
- s.email = 'jkeiser@opscode.com'
12
- s.homepage = 'http://www.opscode.com'
11
+ s.email = 'jkeiser@chef.io'
12
+ s.homepage = 'http://www.chef.io'
13
13
  s.license = 'Apache 2.0'
14
14
 
15
15
  s.required_ruby_version = ">= 2.1.0"
16
16
 
17
- s.add_dependency 'mixlib-log', '~> 1.3'
18
- s.add_dependency 'hashie', '>= 2.0', '< 4.0'
17
+ s.add_dependency 'mixlib-log', '~> 1.3'
18
+ s.add_dependency 'hashie', '>= 2.0', '< 4.0'
19
19
  s.add_dependency 'uuidtools', '~> 2.1'
20
20
  s.add_dependency 'ffi-yajl', '~> 2.2'
21
- s.add_dependency 'rack'
21
+ s.add_dependency 'rack', '< 2' # 2.0 requires Ruby 2.2+
22
22
 
23
23
  s.add_development_dependency 'pry'
24
24
  s.add_development_dependency 'pry-byebug'
@@ -8,17 +8,12 @@ module ChefZero
8
8
  def get(request)
9
9
  response = super(request)
10
10
 
11
- if request.query_params['email']
12
- results = parse_json(response[2])
13
- new_results = {}
14
- results.each do |name, url|
15
- record = get_data(request, request.rest_path + [ name ], :nil)
16
- if record
17
- record = parse_json(record)
18
- new_results[name] = url if record['email'] == request.query_params['email']
19
- end
20
- end
21
- response[2] = to_json(new_results)
11
+ # apply query filters: if one applies, stop processing rest
12
+ # (precendence matches chef-server: https://github.com/chef/chef-server/blob/268a0c9/src/oc_erchef/apps/chef_objects/src/chef_user.erl#L554-L559)
13
+ if value = request.query_params['external_authentication_uid']
14
+ response[2] = filter('external_authentication_uid', value, request, response[2])
15
+ elsif value = request.query_params['email']
16
+ response[2] = filter('email', value, request, response[2])
22
17
  end
23
18
 
24
19
  if request.query_params['verbose']
@@ -85,6 +80,21 @@ module ChefZero
85
80
  result
86
81
  end
87
82
  end
83
+
84
+ private
85
+
86
+ def filter(key, value, request, resp)
87
+ results = parse_json(resp)
88
+ new_results = {}
89
+ results.each do |name, url|
90
+ record = get_data(request, request.rest_path + [ name ], :nil)
91
+ if record
92
+ record = parse_json(record)
93
+ new_results[name] = url if record[key] == value
94
+ end
95
+ end
96
+ to_json(new_results)
97
+ end
88
98
  end
89
99
  end
90
100
  end
@@ -1,3 +1,3 @@
1
1
  module ChefZero
2
- VERSION = '4.6.2'
2
+ VERSION = '4.7.0'
3
3
  end
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: 4.6.2
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-28 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log
@@ -76,16 +76,16 @@ dependencies:
76
76
  name: rack
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ">="
79
+ - - "<"
80
80
  - !ruby/object:Gem::Version
81
- version: '0'
81
+ version: '2'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ">="
86
+ - - "<"
87
87
  - !ruby/object:Gem::Version
88
- version: '0'
88
+ version: '2'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: pry
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -172,7 +172,7 @@ dependencies:
172
172
  version: '0'
173
173
  description: Self-contained, easy-setup, fast-start in-memory Chef server for testing
174
174
  and solo setup purposes
175
- email: jkeiser@opscode.com
175
+ email: jkeiser@chef.io
176
176
  executables:
177
177
  - chef-zero
178
178
  extensions: []
@@ -296,7 +296,7 @@ files:
296
296
  - spec/socketless_server_map_spec.rb
297
297
  - spec/support/oc_pedant.rb
298
298
  - spec/support/stickywicket.pem
299
- homepage: http://www.opscode.com
299
+ homepage: http://www.chef.io
300
300
  licenses:
301
301
  - Apache 2.0
302
302
  metadata: {}
@@ -322,3 +322,4 @@ specification_version: 4
322
322
  summary: Self-contained, easy-setup, fast-start in-memory Chef server for testing
323
323
  and solo setup purposes
324
324
  test_files: []
325
+ has_rdoc: