knife-okta 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: bb9cdd9e808fa7dcb17c281979b026ee1fdc832e8dc5319aa56fc218ce7da02d
4
- data.tar.gz: 253fe557465c1192638852f027b3e8224a10aa87e30cf8c0aa5501cf5a7972a5
3
+ metadata.gz: eb8ee4afdd314e77c758ca261ca131a6e89d928dbf3600f182d9a5378fd30084
4
+ data.tar.gz: f6deea10b5358356ea5e5d5f31cd85b1f7409c99a3a28df735dd6d3972adbe88
5
5
  SHA512:
6
- metadata.gz: d8f6253e3095c2c7c8939bdfddb3166edf0e4dcfaa6d2b4d53bb33e31aedd16ac6b6a59bb8ad5bf694bb7164b86551332a7d000291294f1d35353bdb4ee5f311
7
- data.tar.gz: 97dc236a24c5370679010db019d6d2b7319eb8f4d2490bafdd77028066bf8d8879b911dcff7d194a169b239f66642ca461a773c5fe32d1e4bfdf726463445a3f
6
+ metadata.gz: 1ae326dd1a0a77dba315d893c44e3657976faa23febe3ed2e9d33ea12e3173e60796a142122369f8ffb6a3f03aa44f63f0f70d9bc3098062116b99f8b550f503
7
+ data.tar.gz: 4a3671a147aa3bc960f8b4557656c0a204e51a7fb4c181241804e732cbb2919ecc36181b016f49725f714732c7e7f1479faa5f7667084dfd39db8ebe3bd8ab96
data/CHANGELOG.md CHANGED
@@ -4,7 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
- ## 0.1.1 (2018-03-06)
7
+ ## 0.1.2 (2018-03-07)
8
+
9
+ ### Fixed
10
+
11
+ * Fix returned group hash - previously the first group that matched the name was returned, now we only return groups with `:type => okta_group`
12
+ * Fix how changes are displayed:
13
+ * New and old data bags will be correctly compared
14
+ * Now caching the data bag response to speed things up a bit
15
+
16
+ ## 0.1.1 (2018-02-06)
8
17
 
9
18
  ### Fixed
10
19
 
@@ -171,7 +171,8 @@ class Chef
171
171
  end
172
172
 
173
173
  def data_bag_item_data
174
- rest.get("data/#{@data_bag_name}/#{@data_bag_item_name}")
174
+ return @data_bag_item_data if @data_bag_item_data
175
+ @data_bag_item_data = rest.get("data/#{@data_bag_name}/#{@data_bag_item_name}")
175
176
  rescue Net::HTTPServerException
176
177
  nil
177
178
  end
@@ -205,12 +206,12 @@ class Chef
205
206
 
206
207
  def data_bag_item_additions
207
208
  return attribute_key_values if data_bag_item_data.nil?
208
- attribute_key_values - data_bag_item_data[config[:okta_attribute].to_sym]
209
+ attribute_key_values - data_bag_item_data[config[:okta_attribute]]
209
210
  end
210
211
 
211
212
  def data_bag_item_removals
212
213
  return [] if data_bag_item_data.nil?
213
- data_bag_item_data[config[:okta_attribute].to_sym] - attribute_key_values
214
+ data_bag_item_data[config[:okta_attribute]] - attribute_key_values
214
215
  end
215
216
 
216
217
  def display_data_bag_item_additions
@@ -230,7 +231,7 @@ class Chef
230
231
 
231
232
  if data_bag_item_data.nil?
232
233
  display_data_bag_item_additions
233
- elsif data_bag_item_data.keys.reject { |e| e == :id }.shift.to_s == config[:okta_attribute]
234
+ elsif data_bag_item_data.keys.reject { |e| e == "id" }.shift.to_s == config[:okta_attribute]
234
235
  display_data_bag_item_removals
235
236
  display_data_bag_item_additions
236
237
  else
@@ -266,7 +267,7 @@ class Chef
266
267
  end
267
268
 
268
269
  def group_hash(group_name)
269
- group_hash = groups.select { |group| group[:profile][:name] =~ /^#{group_name}$/i }.shift
270
+ group_hash = groups.select { |group| group[:type] == "OKTA_GROUP" && group[:profile][:name] =~ /^#{group_name}$/i }.shift
270
271
  if group_hash.nil?
271
272
  ui.fatal("Cannot find a group with the name \"#{group_name}\" in the specified Okta tenant")
272
273
  exit(1)
data/lib/knife-okta.rb CHANGED
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module KnifeOkta
19
- VERSION = "0.1.1"
19
+ VERSION = "0.1.2"
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-okta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Hoekstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-06 00:00:00.000000000 Z
11
+ date: 2018-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef