checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
---
2
2
SHA1:
3
- metadata.gz: 2b12e20bcfd16dc8c7a615a7afab48102145d010
4
- data.tar.gz: 58243c8ba5aa45206188924f29ace72c66303848
3
+ metadata.gz: 8c7aa02f11102390e977513389af9287dace7440
4
+ data.tar.gz: 1fde83ec917ff1311a2a6b863380831e0fa47e9e
5
5
SHA512:
6
- metadata.gz: d75bac711ae068b6d0677cd2e1ac774e59ceddb69bcbbc75684431d4d10ba359ba67148a0419f515214065701fabab50b7a9bc6719a235804c64ad845fd21130
7
- data.tar.gz: ebd161332ba932fe52393e35935a7eb048559098037f70fa7b1f163d0748afae72cdca50c275e5770cd3e933533c782c5eb7ba0b2d36cb9ef2a858121ef6091d
6
+ metadata.gz: 5cc00508aac733cda66f624d811e690214910b88e085c77038abb98486369b5511bf5b5127b3a0d64ef9145c8750cc77b09f8446e32c24a794d3d659688de9ce
7
+ data.tar.gz: eadd03a83b10e6c64efe506c2d15a8925bd2543abf53042fd831de2df76aa8803def3e1a66675a6fce470073e4ada2ccd095c3783e9ac8566eb0e39a4af6f1ba
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
PATH
2
2
remote: .
3
3
specs:
4
- wm_okta_helper (0.2.4)
4
+ wm_okta_helper (0.2.5)
5
5
json-jwt
6
6
jwt
7
7
data/lib/wm_okta_helper/get_user_groups.rb 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.includes('otto_')
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
data/lib/wm_okta_helper/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
# frozen_string_literal: true
2
2
3
3
module WmOktaHelper
4
- VERSION = '0.2.4'
4
+ VERSION = '0.2.5'
5
5
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
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 00:00:00.000000000 Z
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.1
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.