wm_okta_helper 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/wm_okta_helper/get_user_groups.rb +10 -6
- data/lib/wm_okta_helper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c7aa02f11102390e977513389af9287dace7440
|
4
|
+
data.tar.gz: 1fde83ec917ff1311a2a6b863380831e0fa47e9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cc00508aac733cda66f624d811e690214910b88e085c77038abb98486369b5511bf5b5127b3a0d64ef9145c8750cc77b09f8446e32c24a794d3d659688de9ce
|
7
|
+
data.tar.gz: eadd03a83b10e6c64efe506c2d15a8925bd2543abf53042fd831de2df76aa8803def3e1a66675a6fce470073e4ada2ccd095c3783e9ac8566eb0e39a4af6f1ba
|
data/Gemfile.lock
CHANGED
@@ -38,18 +38,14 @@ module WmOktaHelper
|
|
38
38
|
groups = []
|
39
39
|
fetch_data.each do |g|
|
40
40
|
group_name = g.dig('profile', 'name')
|
41
|
-
groups << group_name if group_name.
|
41
|
+
groups << group_name if group_name.include?('otto_')
|
42
42
|
end
|
43
|
+
groups
|
43
44
|
end
|
44
45
|
end
|
45
46
|
|
46
47
|
def fetch_data
|
47
48
|
uri = URI.parse(site)
|
48
|
-
request = Net::HTTP::Get.new(request_url)
|
49
|
-
request.content_type = 'application/json'
|
50
|
-
request['Accept'] = 'application/json'
|
51
|
-
request['Authorization'] = "SSWS #{@api_key}"
|
52
|
-
|
53
49
|
req_options = { use_ssl: uri.scheme == 'https' }
|
54
50
|
|
55
51
|
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
|
@@ -57,5 +53,13 @@ module WmOktaHelper
|
|
57
53
|
end
|
58
54
|
response.body.present? ? JSON.parse(response.body) : []
|
59
55
|
end
|
56
|
+
|
57
|
+
def request
|
58
|
+
@request ||= Net::HTTP::Get.new(request_url)
|
59
|
+
@request.content_type = 'application/json'
|
60
|
+
@request['Accept'] = 'application/json'
|
61
|
+
@request['Authorization'] = "SSWS #{@api_key}"
|
62
|
+
@request
|
63
|
+
end
|
60
64
|
end
|
61
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wm_okta_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jose C Fernandez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-jwt
|
@@ -200,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
200
|
version: '0'
|
201
201
|
requirements: []
|
202
202
|
rubyforge_project:
|
203
|
-
rubygems_version: 2.6.14
|
203
|
+
rubygems_version: 2.6.14
|
204
204
|
signing_key:
|
205
205
|
specification_version: 4
|
206
206
|
summary: Helper library for validating Okta jwt token.
|