workos 0.8.0 → 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 -4
- data/README.md +1 -0
- data/lib/workos/profile.rb +8 -4
- data/lib/workos/types/profile_struct.rb +1 -0
- data/lib/workos/types.rb +8 -3
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/sso_spec.rb +1 -0
- data/spec/support/profile.txt +1 -1
- data/workos.gemspec +0 -1
- metadata +2 -16
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,8 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
workos (0.
|
|
5
|
-
require_all (~> 3.0.0)
|
|
4
|
+
workos (0.9.0)
|
|
6
5
|
sorbet-runtime (~> 0.5)
|
|
7
6
|
|
|
8
7
|
GEM
|
|
@@ -27,7 +26,6 @@ GEM
|
|
|
27
26
|
public_suffix (4.0.2)
|
|
28
27
|
rainbow (3.0.0)
|
|
29
28
|
rake (13.0.1)
|
|
30
|
-
require_all (3.0.0)
|
|
31
29
|
rspec (3.9.0)
|
|
32
30
|
rspec-core (~> 3.9.0)
|
|
33
31
|
rspec-expectations (~> 3.9.0)
|
|
@@ -56,7 +54,7 @@ GEM
|
|
|
56
54
|
simplecov-html (0.12.2)
|
|
57
55
|
sorbet (0.5.5560)
|
|
58
56
|
sorbet-static (= 0.5.5560)
|
|
59
|
-
sorbet-runtime (0.5.
|
|
57
|
+
sorbet-runtime (0.5.5943)
|
|
60
58
|
sorbet-static (0.5.5560-universal-darwin-14)
|
|
61
59
|
unicode-display_width (1.6.0)
|
|
62
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/types.rb
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'require_all'
|
|
2
|
+
# typed: strong
|
|
4
3
|
|
|
5
4
|
module WorkOS
|
|
6
5
|
# WorkOS believes strongly in typed languages,
|
|
7
6
|
# so we're using Sorbet throughout this Ruby gem.
|
|
8
7
|
module Types
|
|
9
|
-
|
|
8
|
+
require_relative 'types/connection_struct'
|
|
9
|
+
require_relative 'types/intent_enum'
|
|
10
|
+
require_relative 'types/list_struct'
|
|
11
|
+
require_relative 'types/organization_struct'
|
|
12
|
+
require_relative 'types/passwordless_session_struct'
|
|
13
|
+
require_relative 'types/profile_struct'
|
|
14
|
+
require_relative 'types/provider_enum'
|
|
10
15
|
end
|
|
11
16
|
end
|
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"}
|
data/workos.gemspec
CHANGED
|
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
23
23
|
spec.require_paths = ['lib']
|
|
24
24
|
|
|
25
|
-
spec.add_dependency 'require_all', '~> 3.0.0'
|
|
26
25
|
spec.add_dependency 'sorbet-runtime', '~> 0.5'
|
|
27
26
|
|
|
28
27
|
spec.add_development_dependency 'bundler', '>= 2.0.1'
|
metadata
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
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
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: require_all
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: 3.0.0
|
|
20
|
-
type: :runtime
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: 3.0.0
|
|
27
13
|
- !ruby/object:Gem::Dependency
|
|
28
14
|
name: sorbet-runtime
|
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|