chef-zero 4.6.0 → 4.6.1

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: ca7530fffb7dc24422a41d298d2411f8661d5e7d
4
- data.tar.gz: a18a46c9da1936c3d89ec33e83d7e97ed0b82bb6
3
+ metadata.gz: 89e89d5a719b55d744d62cea1d0dcfeb87d8e295
4
+ data.tar.gz: b638371b3c6f3570e00037ac3a0952fa11d0ce63
5
5
  SHA512:
6
- metadata.gz: 9e5a78f306534fc4849f8f40c1ba435d3efa9c8cebbd182e26b68e34c92a08aed491c5259780847c0cf05ab19480cc485b61b12b01992b27ddad4a776be81897
7
- data.tar.gz: 4add88aed368a2044f817a5f7caa2429a27c2d6f23e81c3054ba4a68270250c404f926abaf571c354069fcbe61dcbc4163ec9dc31e7255e77d0dd75e5302d553
6
+ metadata.gz: 253ea9e0d6893270f4b98603947dd6cb7da8d4c0e2298ec1312ea693752108696120617eb05e3f373fc7cd9954506b42fcc33cdf25bf14f2089dd365c5a5c370
7
+ data.tar.gz: 2b733043fe37e015d796c2e7353981022ca46a348af15b1185147e8bb73b47a9b73775022eaa823d582a11cae8241649acfe67eaba75535cec33b743dc6904ec
@@ -161,22 +161,23 @@ module ChefZero
161
161
 
162
162
  # Return the data store keys path for the request client or user, e.g.
163
163
  #
164
- # [ "organizations", <org>, "client_keys", <client>, "keys" ]
165
- #
166
- # Or:
167
- #
168
- # [ "user_keys", <user>, "keys" ]
164
+ # /organizations/ORG/clients/CLIENT -> /organizations/ORG/client_keys/CLIENT/keys
165
+ # /organizations/ORG/users/USER -> /organizations/ORG/user_keys/USER/keys
166
+ # /users/USER -> /user_keys/USER
169
167
  #
170
168
  def keys_path_base(request, client_or_user_name=nil)
171
169
  rest_path = (rest_path || request.rest_path).dup
172
- rest_path[-1] = client_or_user_name if client_or_user_name
173
-
174
- if client?(request, rest_path)
175
- [ *rest_path[0..1], "client_keys" ]
170
+ rest_path = rest_path.dup
171
+ case rest_path[-2]
172
+ when "users"
173
+ rest_path[-2] = "user_keys"
174
+ when "clients"
175
+ rest_path[-2] = "client_keys"
176
176
  else
177
- [ "user_keys" ]
177
+ raise "Unexpected URL #{rest_path.join("/")}: cannot determine key path"
178
178
  end
179
- .push(rest_path.last, "keys")
179
+ rest_path << "keys"
180
+ rest_path
180
181
  end
181
182
  end
182
183
  end
@@ -65,7 +65,7 @@ module ChefZero
65
65
 
66
66
  response =
67
67
  if request.api_v0?
68
- user_data.merge(key_data)
68
+ user_data.merge!(key_data)
69
69
  elsif skip_key_create && !public_key
70
70
  user_data
71
71
  else
@@ -1,3 +1,3 @@
1
1
  module ChefZero
2
- VERSION = '4.6.0'
2
+ VERSION = '4.6.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.0
4
+ version: 4.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser