workos 2.11.0 → 2.12.1
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/workos/client.rb +6 -0
- data/lib/workos/profile.rb +4 -1
- data/lib/workos/types/profile_struct.rb +1 -0
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/sso_spec.rb +5 -0
- data/spec/support/profile.txt +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fe71c6f50e97277badc27d4d7b1143ecc9ce1ec943248d58eaeb75b4f2a6a0a
|
4
|
+
data.tar.gz: '066885439925ec27b6a219d0865d15f90e7785184c75e599d47eed9b65c5a207'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cd6d8624d1d73ec2d1616d6d86105fc9e201eae5f8ecc05ee5178da2a5d1fd81decada38e118ae7c798a955daa7c4b07dc6e58f190d4a1b8ef51bffce80ef1f
|
7
|
+
data.tar.gz: faf0fe4d4b13c45788a9770c90d25e22d1a0a88e7ea5357f7b07010ac3081466c4519a5231170d9515c81df9dc8dc2025eaf2d61053013a8b4d1a02e5f172914
|
data/Gemfile.lock
CHANGED
data/lib/workos/client.rb
CHANGED
@@ -165,6 +165,12 @@ module WorkOS
|
|
165
165
|
request_id: response['x-request-id'],
|
166
166
|
code: code,
|
167
167
|
)
|
168
|
+
else
|
169
|
+
raise APIError.new(
|
170
|
+
message: json['message'],
|
171
|
+
http_status: http_status,
|
172
|
+
request_id: response['x-request-id'],
|
173
|
+
)
|
168
174
|
end
|
169
175
|
end
|
170
176
|
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
data/lib/workos/profile.rb
CHANGED
@@ -12,7 +12,7 @@ module WorkOS
|
|
12
12
|
extend T::Sig
|
13
13
|
|
14
14
|
sig { returns(String) }
|
15
|
-
attr_accessor :id, :email, :first_name, :last_name, :organization_id,
|
15
|
+
attr_accessor :id, :email, :first_name, :last_name, :groups, :organization_id,
|
16
16
|
:connection_id, :connection_type, :idp_id, :raw_attributes
|
17
17
|
|
18
18
|
# rubocop:disable Metrics/AbcSize
|
@@ -24,6 +24,7 @@ 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
|
+
@groups = raw.groups
|
27
28
|
@organization_id = raw.organization_id
|
28
29
|
@connection_id = T.let(raw.connection_id, String)
|
29
30
|
@connection_type = T.let(raw.connection_type, String)
|
@@ -43,6 +44,7 @@ module WorkOS
|
|
43
44
|
email: email,
|
44
45
|
first_name: first_name,
|
45
46
|
last_name: last_name,
|
47
|
+
groups: groups,
|
46
48
|
organization_id: organization_id,
|
47
49
|
connection_id: connection_id,
|
48
50
|
connection_type: connection_type,
|
@@ -62,6 +64,7 @@ module WorkOS
|
|
62
64
|
email: hash[:email],
|
63
65
|
first_name: hash[:first_name],
|
64
66
|
last_name: hash[:last_name],
|
67
|
+
groups: hash[:groups],
|
65
68
|
organization_id: hash[:organization_id],
|
66
69
|
connection_id: hash[:connection_id],
|
67
70
|
connection_type: hash[:connection_type],
|
@@ -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 :groups, T.nilable(T::Array[String])
|
13
14
|
const :organization_id, T.nilable(String)
|
14
15
|
const :connection_id, String
|
15
16
|
const :connection_type, String
|
data/lib/workos/version.rb
CHANGED
data/spec/lib/workos/sso_spec.rb
CHANGED
@@ -289,6 +289,7 @@ describe WorkOS::SSO do
|
|
289
289
|
end
|
290
290
|
|
291
291
|
describe '.get_profile' do
|
292
|
+
# rubocop:disable Metrics/BlockLength
|
292
293
|
it 'returns a profile' do
|
293
294
|
VCR.use_cassette 'sso/profile' do
|
294
295
|
profile = described_class.get_profile(access_token: 'access_token')
|
@@ -301,6 +302,7 @@ describe WorkOS::SSO do
|
|
301
302
|
id: 'prof_01EEJTY9SZ1R350RB7B73SNBKF',
|
302
303
|
idp_id: '116485463307139932699',
|
303
304
|
last_name: 'Loblaw',
|
305
|
+
groups: nil,
|
304
306
|
organization_id: 'org_01FG53X8636WSNW2WEKB2C31ZB',
|
305
307
|
raw_attributes: {
|
306
308
|
email: 'bob.loblaw@workos.com',
|
@@ -317,6 +319,7 @@ describe WorkOS::SSO do
|
|
317
319
|
expect(profile.to_json).to eq(expectation)
|
318
320
|
end
|
319
321
|
end
|
322
|
+
# rubocop:enable Metrics/BlockLength
|
320
323
|
end
|
321
324
|
|
322
325
|
describe '.profile_and_token' do
|
@@ -370,6 +373,7 @@ describe WorkOS::SSO do
|
|
370
373
|
id: 'prof_01DRA1XNSJDZ19A31F183ECQW5',
|
371
374
|
idp_id: '00u1klkowm8EGah2H357',
|
372
375
|
last_name: 'Demo',
|
376
|
+
groups: %w[Admins Developers],
|
373
377
|
organization_id: 'org_01FG53X8636WSNW2WEKB2C31ZB',
|
374
378
|
raw_attributes: {
|
375
379
|
email: 'demo@workos-okta.com',
|
@@ -377,6 +381,7 @@ describe WorkOS::SSO do
|
|
377
381
|
id: 'prof_01DRA1XNSJDZ19A31F183ECQW5',
|
378
382
|
idp_id: '00u1klkowm8EGah2H357',
|
379
383
|
last_name: 'Demo',
|
384
|
+
groups: %w[Admins Developers],
|
380
385
|
},
|
381
386
|
}
|
382
387
|
|
data/spec/support/profile.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"profile":{"object":"profile","id":"prof_01DRA1XNSJDZ19A31F183ECQW5","email":"demo@workos-okta.com","first_name":"WorkOS","organization_id":"org_01FG53X8636WSNW2WEKB2C31ZB","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"}
|
1
|
+
{"profile":{"object":"profile","id":"prof_01DRA1XNSJDZ19A31F183ECQW5","email":"demo@workos-okta.com","first_name":"WorkOS","organization_id":"org_01FG53X8636WSNW2WEKB2C31ZB","connection_id":"conn_01EMH8WAK20T42N2NBMNBCYHAG","connection_type":"OktaSAML","last_name":"Demo","groups":["Admins","Developers"],"idp_id":"00u1klkowm8EGah2H357","raw_attributes":{"id":"prof_01DRA1XNSJDZ19A31F183ECQW5","email":"demo@workos-okta.com","first_name":"WorkOS","last_name":"Demo","groups":["Admins","Developers"],"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: 2.
|
4
|
+
version: 2.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WorkOS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|
@@ -413,7 +413,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
413
413
|
- !ruby/object:Gem::Version
|
414
414
|
version: '0'
|
415
415
|
requirements: []
|
416
|
-
rubygems_version: 3.4.
|
416
|
+
rubygems_version: 3.4.10
|
417
417
|
signing_key:
|
418
418
|
specification_version: 4
|
419
419
|
summary: API client for WorkOS
|