workos 0.4.2 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a179e7a1a9dcd3e5bb85ab328900de17d3987e0763bb285ce4539e44fb11524
4
- data.tar.gz: 52586ff03484f8550db6e1f538e3ffdbc22b0ccc2dd275e3dc75056c8d18a407
3
+ metadata.gz: 56cf52cb4a104516de13499b34f7c6f36a102c0c2af1bf6934e963579f27a596
4
+ data.tar.gz: 45dee16f5ed91f99133e7f974d607e76effa73e0d0d3b271fd7e9756e72055c5
5
5
  SHA512:
6
- metadata.gz: cd6378af304ecb31e392dfe8c1a8807b48e8290e466865937aae9565f79fe3e598df0a9a165d0849db8ae548e45076f1a2f8e5fc54ad2962fda1cc1060ea34ee
7
- data.tar.gz: 9249a469a463e5bb9e9cfb8e300bde22b153e8c39b2e7327f2aefa628a932607635bc2df5309d109336177024f8b8157ba2622b0245faf5b3cf11a223650956f
6
+ metadata.gz: 00d537dcaf496aa3b8244f72b04137496fef5613100ec61d32f837f20f42f6f5ed20180d41eb560dd6bfe6491810f07d4f4401d0e0cacc121c991b5c74d80676
7
+ data.tar.gz: 843f4d8558e3412ed6fa3becaf6c7717a301121baa7fd6edb292184518d335b2f616f024fdf13a9adf8659110aae3411744525be76f25f1bf238dd05acf14d99
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (0.4.2)
4
+ workos (0.5.0)
5
5
  sorbet-runtime (~> 0.5)
6
6
 
7
7
  GEM
@@ -10,17 +10,16 @@ GEM
10
10
  addressable (2.7.0)
11
11
  public_suffix (>= 2.0.2, < 5.0)
12
12
  ast (2.4.0)
13
- codecov (0.1.16)
13
+ codecov (0.2.8)
14
14
  json
15
15
  simplecov
16
- url
17
16
  crack (0.4.3)
18
17
  safe_yaml (~> 1.0.0)
19
18
  diff-lcs (1.3)
20
19
  docile (1.3.2)
21
20
  hashdiff (1.0.0)
22
21
  jaro_winkler (1.5.4)
23
- json (2.3.0)
22
+ json (2.3.1)
24
23
  parallel (1.19.1)
25
24
  parser (2.7.0.0)
26
25
  ast (~> 2.4.0)
@@ -49,17 +48,15 @@ GEM
49
48
  unicode-display_width (>= 1.4.0, < 1.7)
50
49
  ruby-progressbar (1.10.1)
51
50
  safe_yaml (1.0.5)
52
- simplecov (0.17.1)
51
+ simplecov (0.19.0)
53
52
  docile (~> 1.1)
54
- json (>= 1.8, < 3)
55
- simplecov-html (~> 0.10.0)
56
- simplecov-html (0.10.2)
53
+ simplecov-html (~> 0.11)
54
+ simplecov-html (0.12.2)
57
55
  sorbet (0.5.5560)
58
56
  sorbet-static (= 0.5.5560)
59
- sorbet-runtime (0.5.5870)
57
+ sorbet-runtime (0.5.5877)
60
58
  sorbet-static (0.5.5560-universal-darwin-14)
61
59
  unicode-display_width (1.6.0)
62
- url (0.3.2)
63
60
  vcr (5.0.0)
64
61
  webmock (3.7.6)
65
62
  addressable (>= 2.3.6)
@@ -72,7 +69,7 @@ PLATFORMS
72
69
 
73
70
  DEPENDENCIES
74
71
  bundler (>= 2.0.1)
75
- codecov (~> 0.1.16)
72
+ codecov (~> 0.2.8)
76
73
  rake
77
74
  rspec (~> 3.9.0)
78
75
  rubocop (~> 0.77)
data/README.md CHANGED
@@ -157,6 +157,13 @@ This method will return an instance of a `WorkOS::Profile` with the following at
157
157
  @connection_type="OktaSAML",
158
158
  @last_name="Demo",
159
159
  @idp_id="00u1klkowm8EGah2H357",
160
+ @raw_attributes={
161
+ :id=>"prof_01DRA1XNSJDZ19A31F183ECQW5",
162
+ :email=>"demo@workos-okta.com",
163
+ :first_name=>"WorkOS",
164
+ :last_name=>"Demo",
165
+ :idp_id=>"00u1klkowm8EGah2H357"
166
+ },
160
167
  >
161
168
  ```
162
169
 
@@ -14,7 +14,7 @@ module WorkOS
14
14
 
15
15
  sig { returns(String) }
16
16
  attr_accessor :id, :email, :first_name, :last_name,
17
- :connection_type, :idp_id
17
+ :connection_type, :idp_id, :raw_attributes
18
18
 
19
19
  sig { params(profile_json: String).void }
20
20
  def initialize(profile_json)
@@ -26,6 +26,7 @@ module WorkOS
26
26
  @last_name = raw.last_name
27
27
  @connection_type = T.let(raw.connection_type, String)
28
28
  @idp_id = raw.idp_id
29
+ @raw_attributes = raw.raw_attributes
29
30
  end
30
31
 
31
32
  sig { returns(String) }
@@ -41,11 +42,13 @@ module WorkOS
41
42
  last_name: last_name,
42
43
  connection_type: connection_type,
43
44
  idp_id: idp_id,
45
+ raw_attributes: raw_attributes,
44
46
  }
45
47
  end
46
48
 
47
49
  private
48
50
 
51
+ # rubocop:disable Metrics/AbcSize
49
52
  sig { params(json_string: String).returns(WorkOS::Types::ProfileStruct) }
50
53
  def parse_json(json_string)
51
54
  hash = JSON.parse(json_string, symbolize_names: true)
@@ -57,7 +60,9 @@ module WorkOS
57
60
  last_name: hash[:profile][:last_name],
58
61
  connection_type: hash[:profile][:connection_type],
59
62
  idp_id: hash[:profile][:idp_id],
63
+ raw_attributes: hash[:profile][:raw_attributes],
60
64
  )
61
65
  end
66
+ # rubocop:enable Metrics/AbcSize
62
67
  end
63
68
  end
@@ -12,6 +12,7 @@ module WorkOS
12
12
  const :last_name, T.nilable(String)
13
13
  const :connection_type, String
14
14
  const :idp_id, T.nilable(String)
15
+ const :raw_attributes, T::Hash[Symbol, Object]
15
16
  end
16
17
  end
17
18
  end
@@ -2,5 +2,5 @@
2
2
  # typed: strong
3
3
 
4
4
  module WorkOS
5
- VERSION = '0.4.2'
5
+ VERSION = '0.5.0'
6
6
  end
@@ -161,6 +161,24 @@ describe WorkOS::SSO do
161
161
  it 'returns a WorkOS::Profile' do
162
162
  profile = described_class.profile(**args)
163
163
  expect(profile).to be_a(WorkOS::Profile)
164
+
165
+ expectation = {
166
+ connection_type: 'OktaSAML',
167
+ email: 'demo@workos-okta.com',
168
+ first_name: 'WorkOS',
169
+ id: 'prof_01DRA1XNSJDZ19A31F183ECQW5',
170
+ idp_id: '00u1klkowm8EGah2H357',
171
+ last_name: 'Demo',
172
+ raw_attributes: {
173
+ email: 'demo@workos-okta.com',
174
+ first_name: 'WorkOS',
175
+ id: 'prof_01DRA1XNSJDZ19A31F183ECQW5',
176
+ idp_id: '00u1klkowm8EGah2H357',
177
+ last_name: 'Demo',
178
+ },
179
+ }
180
+
181
+ expect(profile.to_json).to eq(expectation)
164
182
  end
165
183
  end
166
184
 
@@ -1 +1 @@
1
- {"profile":{"object":"profile","id":"prof_01DRA1XNSJDZ19A31F183ECQW5","email":"demo@workos-okta.com","first_name":"WorkOS","connection_type":"OktaSAML","last_name":"Demo","idp_id":"00u1klkowm8EGah2H357"},"access_token":"01DVX6QBS3EG6FHY2ESAA5Q65X"}
1
+ {"profile":{"object":"profile","id":"prof_01DRA1XNSJDZ19A31F183ECQW5","email":"demo@workos-okta.com","first_name":"WorkOS","connection_type":"OktaSAML","last_name":"Demo","idp_id":"00u1klkowm8EGah2H357","raw_attributes":{"id":"prof_01DRA1XNSJDZ19A31F183ECQW5","email":"demo@workos-okta.com","first_name":"WorkOS","last_name":"Demo","idp_id":"00u1klkowm8EGah2H357"}},"access_token":"01DVX6QBS3EG6FHY2ESAA5Q65X"}
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency 'sorbet-runtime', '~> 0.5'
26
26
 
27
27
  spec.add_development_dependency 'bundler', '>= 2.0.1'
28
- spec.add_development_dependency 'codecov', '~> 0.1.16'
28
+ spec.add_development_dependency 'codecov', '~> 0.2.8'
29
29
  spec.add_development_dependency 'rake'
30
30
  spec.add_development_dependency 'rspec', '~> 3.9.0'
31
31
  spec.add_development_dependency 'rubocop', '~> 0.77'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-17 00:00:00.000000000 Z
11
+ date: 2020-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.16
47
+ version: 0.2.8
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.16
54
+ version: 0.2.8
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement