workos 0.8.1 → 0.9.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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +1 -0
- data/lib/workos/profile.rb +8 -4
- data/lib/workos/types/profile_struct.rb +1 -0
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/sso_spec.rb +1 -0
- data/spec/support/profile.txt +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: 9fd3e38d33d428497a46f40df28c4d142bc9adaf90c166b61c05914030c50b25
|
4
|
+
data.tar.gz: c445aa218658fe1fb57add7cc9081b1e63223641d29cac1e276429d3fb1244fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b94cf0c103286a457c3a73ab4ead5196ad2a8111f486ff22adbf4ecbdd5a21685dcb9483325b15813dcd5a25ea2383aec7d64fbc7545d4c80267731e97ed4a48
|
7
|
+
data.tar.gz: 30d4256a4b9218890dd880a5513dd90a09052f746085dffc282532bbf9ed5683b04d690181cfe1b209f02edc1fd1e37e04149819c8731afb81f5aba5561a2c18
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
workos (0.
|
4
|
+
workos (0.9.0)
|
5
5
|
sorbet-runtime (~> 0.5)
|
6
6
|
|
7
7
|
GEM
|
@@ -54,7 +54,7 @@ GEM
|
|
54
54
|
simplecov-html (0.12.2)
|
55
55
|
sorbet (0.5.5560)
|
56
56
|
sorbet-static (= 0.5.5560)
|
57
|
-
sorbet-runtime (0.5.
|
57
|
+
sorbet-runtime (0.5.5943)
|
58
58
|
sorbet-static (0.5.5560-universal-darwin-14)
|
59
59
|
unicode-display_width (1.6.0)
|
60
60
|
vcr (5.0.0)
|
data/README.md
CHANGED
@@ -154,6 +154,7 @@ This method will return an instance of a `WorkOS::Profile` with the following at
|
|
154
154
|
@id="prof_01DRA1XNSJDZ19A31F183ECQW5",
|
155
155
|
@email="demo@workos-okta.com",
|
156
156
|
@first_name="WorkOS",
|
157
|
+
@connection_id="conn_01EMH8WAK20T42N2NBMNBCYHAG",
|
157
158
|
@connection_type="OktaSAML",
|
158
159
|
@last_name="Demo",
|
159
160
|
@idp_id="00u1klkowm8EGah2H357",
|
data/lib/workos/profile.rb
CHANGED
@@ -13,9 +13,9 @@ module WorkOS
|
|
13
13
|
extend T::Sig
|
14
14
|
|
15
15
|
sig { returns(String) }
|
16
|
-
attr_accessor :id, :email, :first_name, :last_name,
|
16
|
+
attr_accessor :id, :email, :first_name, :last_name, :connection_id,
|
17
17
|
:connection_type, :idp_id, :raw_attributes
|
18
|
-
|
18
|
+
# rubocop:disable Metrics/AbcSize
|
19
19
|
sig { params(profile_json: String).void }
|
20
20
|
def initialize(profile_json)
|
21
21
|
raw = parse_json(profile_json)
|
@@ -24,10 +24,12 @@ module WorkOS
|
|
24
24
|
@email = T.let(raw.email, String)
|
25
25
|
@first_name = raw.first_name
|
26
26
|
@last_name = raw.last_name
|
27
|
+
@connection_id = T.let(raw.connection_id, String)
|
27
28
|
@connection_type = T.let(raw.connection_type, String)
|
28
29
|
@idp_id = raw.idp_id
|
29
30
|
@raw_attributes = raw.raw_attributes
|
30
31
|
end
|
32
|
+
# rubocop:enable Metrics/AbcSize
|
31
33
|
|
32
34
|
sig { returns(String) }
|
33
35
|
def full_name
|
@@ -40,6 +42,7 @@ module WorkOS
|
|
40
42
|
email: email,
|
41
43
|
first_name: first_name,
|
42
44
|
last_name: last_name,
|
45
|
+
connection_id: connection_id,
|
43
46
|
connection_type: connection_type,
|
44
47
|
idp_id: idp_id,
|
45
48
|
raw_attributes: raw_attributes,
|
@@ -48,7 +51,7 @@ module WorkOS
|
|
48
51
|
|
49
52
|
private
|
50
53
|
|
51
|
-
# rubocop:disable Metrics/AbcSize
|
54
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
52
55
|
sig { params(json_string: String).returns(WorkOS::Types::ProfileStruct) }
|
53
56
|
def parse_json(json_string)
|
54
57
|
hash = JSON.parse(json_string, symbolize_names: true)
|
@@ -58,11 +61,12 @@ module WorkOS
|
|
58
61
|
email: hash[:profile][:email],
|
59
62
|
first_name: hash[:profile][:first_name],
|
60
63
|
last_name: hash[:profile][:last_name],
|
64
|
+
connection_id: hash[:profile][:connection_id],
|
61
65
|
connection_type: hash[:profile][:connection_type],
|
62
66
|
idp_id: hash[:profile][:idp_id],
|
63
67
|
raw_attributes: hash[:profile][:raw_attributes],
|
64
68
|
)
|
65
69
|
end
|
66
|
-
# rubocop:enable Metrics/AbcSize
|
70
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
67
71
|
end
|
68
72
|
end
|
@@ -10,6 +10,7 @@ module WorkOS
|
|
10
10
|
const :email, String
|
11
11
|
const :first_name, T.nilable(String)
|
12
12
|
const :last_name, T.nilable(String)
|
13
|
+
const :connection_id, String
|
13
14
|
const :connection_type, String
|
14
15
|
const :idp_id, T.nilable(String)
|
15
16
|
const :raw_attributes, T::Hash[Symbol, Object]
|
data/lib/workos/version.rb
CHANGED
data/spec/lib/workos/sso_spec.rb
CHANGED
data/spec/support/profile.txt
CHANGED
@@ -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","raw_attributes":{"id":"prof_01DRA1XNSJDZ19A31F183ECQW5","email":"demo@workos-okta.com","first_name":"WorkOS","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_id":"conn_01EMH8WAK20T42N2NBMNBCYHAG","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"}
|
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
|
+
version: 0.9.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-
|
11
|
+
date: 2020-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|