knife-okta 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/lib/chef/knife/data_bag_from_okta_group.rb +6 -5
- data/lib/knife-okta.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb8ee4afdd314e77c758ca261ca131a6e89d928dbf3600f182d9a5378fd30084
|
4
|
+
data.tar.gz: f6deea10b5358356ea5e5d5f31cd85b1f7409c99a3a28df735dd6d3972adbe88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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]
|
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]
|
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 ==
|
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
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.
|
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-
|
11
|
+
date: 2018-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|