workos 5.17.1 → 5.18.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/.rubocop.yml +6 -2
- data/Gemfile.lock +1 -1
- data/lib/workos/client.rb +1 -1
- data/lib/workos/mfa.rb +0 -1
- data/lib/workos/session.rb +0 -1
- data/lib/workos/user_management.rb +3 -2
- data/lib/workos/version.rb +1 -1
- data/spec/lib/workos/user_management_spec.rb +11 -0
- data/spec/support/fixtures/vcr_cassettes/user_management/update_user/email.yml +82 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7bcbc31ee2fd99bc75f92dd89397a5acb223fcd12f7ce5d24e396b966240cb1
|
4
|
+
data.tar.gz: 7f21e67f61a6d63c746e50dd3e6753acea90ab39d765bdd0c4f9566b5b0135e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f48581ece4c6ee347403cdc865b4bb6ed0637ad7fec62ecd7926016f709988cd9106d37f8a138bbddf15a8fa0aa95fa65c3d496356fb6bcb56ce70163f1c0004
|
7
|
+
data.tar.gz: ed1e358de54b404eca9ef2036dae4a4a777b519d4c00583a789221cb08393e5d4a8fbe79dfc5fe1ed632522ae02734fb1b3145a649fa6c1e0813b2d25fab4719
|
data/.rubocop.yml
CHANGED
@@ -12,10 +12,14 @@ Layout/LineLength:
|
|
12
12
|
- '(\A|\s)/.*?/'
|
13
13
|
Metrics/BlockLength:
|
14
14
|
AllowedMethods: ['describe', 'context', 'before', 'it']
|
15
|
+
Metrics/ClassLength:
|
16
|
+
Enabled: false
|
17
|
+
Metrics/CyclomaticComplexity:
|
18
|
+
Enabled: false
|
15
19
|
Metrics/MethodLength:
|
16
|
-
|
20
|
+
Enabled: false
|
17
21
|
Metrics/ModuleLength:
|
18
|
-
|
22
|
+
Enabled: false
|
19
23
|
Metrics/ParameterLists:
|
20
24
|
Max: 6
|
21
25
|
Naming/ConstantName:
|
data/Gemfile.lock
CHANGED
data/lib/workos/client.rb
CHANGED
@@ -86,7 +86,7 @@ module WorkOS
|
|
86
86
|
].join('; ')
|
87
87
|
end
|
88
88
|
|
89
|
-
# rubocop:disable Metrics/
|
89
|
+
# rubocop:disable Metrics/AbcSize:
|
90
90
|
def handle_error_response(response:)
|
91
91
|
http_status = response.code.to_i
|
92
92
|
json = JSON.parse(response.body)
|
data/lib/workos/mfa.rb
CHANGED
data/lib/workos/session.rb
CHANGED
@@ -64,7 +64,6 @@ module WorkOS
|
|
64
64
|
# @return [Hash] A hash containing a new sealed session, the authentication response,
|
65
65
|
# and a reason if the refresh failed
|
66
66
|
# rubocop:disable Metrics/AbcSize
|
67
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
68
67
|
# rubocop:disable Metrics/PerceivedComplexity
|
69
68
|
def refresh(options = nil)
|
70
69
|
cookie_password = options.nil? || options[:cookie_password].nil? ? @cookie_password : options[:cookie_password]
|
@@ -6,8 +6,6 @@ require 'uri'
|
|
6
6
|
module WorkOS
|
7
7
|
# The UserManagement module provides convenience methods for working with the
|
8
8
|
# WorkOS User platform. You'll need a valid API key.
|
9
|
-
|
10
|
-
# rubocop:disable Metrics/ModuleLength
|
11
9
|
module UserManagement
|
12
10
|
module Types
|
13
11
|
# The ProviderEnum is a declaration of a
|
@@ -217,6 +215,7 @@ module WorkOS
|
|
217
215
|
# Update a user
|
218
216
|
#
|
219
217
|
# @param [String] id of the user.
|
218
|
+
# @param [String] email of the user.
|
220
219
|
# @param [String] first_name The user's first name.
|
221
220
|
# @param [String] last_name The user's last name.
|
222
221
|
# @param [Boolean] email_verified Whether the user's email address was previously verified.
|
@@ -228,6 +227,7 @@ module WorkOS
|
|
228
227
|
# @return [WorkOS::User]
|
229
228
|
def update_user(
|
230
229
|
id:,
|
230
|
+
email: nil,
|
231
231
|
first_name: nil,
|
232
232
|
last_name: nil,
|
233
233
|
email_verified: nil,
|
@@ -238,6 +238,7 @@ module WorkOS
|
|
238
238
|
request = put_request(
|
239
239
|
path: "/user_management/users/#{id}",
|
240
240
|
body: {
|
241
|
+
email: email,
|
241
242
|
first_name: first_name,
|
242
243
|
last_name: last_name,
|
243
244
|
email_verified: email_verified,
|
data/lib/workos/version.rb
CHANGED
@@ -343,6 +343,17 @@ describe WorkOS::UserManagement do
|
|
343
343
|
end
|
344
344
|
end
|
345
345
|
|
346
|
+
it 'can update email addresses' do
|
347
|
+
VCR.use_cassette 'user_management/update_user/email' do
|
348
|
+
user = described_class.update_user(
|
349
|
+
id: 'user_01H7TVSKS45SDHN5V9XPSM6H44',
|
350
|
+
email: 'jane@example.com',
|
351
|
+
)
|
352
|
+
expect(user.email).to eq('jane@example.com')
|
353
|
+
expect(user.email_verified).to eq(false)
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
346
357
|
context 'with an invalid payload' do
|
347
358
|
it 'returns an error' do
|
348
359
|
VCR.use_cassette 'user_management/update_user/invalid' do
|
@@ -0,0 +1,82 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: put
|
5
|
+
uri: https://api.workos.com/user_management/users/user_01H7TVSKS45SDHN5V9XPSM6H44
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"email":"jane@example.com"}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
User-Agent:
|
17
|
+
- WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Fri, 25 Aug 2023 23:37:04 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Cf-Ray:
|
34
|
+
- 7fc7a9287d0330ba-SEA
|
35
|
+
Cf-Cache-Status:
|
36
|
+
- DYNAMIC
|
37
|
+
Etag:
|
38
|
+
- W/"153-w5d8Z7u7b9Obt9NziECtNSAY9Ac"
|
39
|
+
Strict-Transport-Security:
|
40
|
+
- max-age=15552000; includeSubDomains
|
41
|
+
Vary:
|
42
|
+
- Origin, Accept-Encoding
|
43
|
+
Via:
|
44
|
+
- 1.1 spaces-router (devel)
|
45
|
+
Access-Control-Allow-Credentials:
|
46
|
+
- 'true'
|
47
|
+
Content-Security-Policy:
|
48
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
49
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
50
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
51
|
+
Expect-Ct:
|
52
|
+
- max-age=0
|
53
|
+
Referrer-Policy:
|
54
|
+
- no-referrer
|
55
|
+
X-Content-Type-Options:
|
56
|
+
- nosniff
|
57
|
+
X-Dns-Prefetch-Control:
|
58
|
+
- 'off'
|
59
|
+
X-Download-Options:
|
60
|
+
- noopen
|
61
|
+
X-Frame-Options:
|
62
|
+
- SAMEORIGIN
|
63
|
+
X-Permitted-Cross-Domain-Policies:
|
64
|
+
- none
|
65
|
+
X-Request-Id:
|
66
|
+
- b333b9e1-c9ec-4e99-ae4f-17a854859cf1
|
67
|
+
X-Xss-Protection:
|
68
|
+
- '0'
|
69
|
+
Set-Cookie:
|
70
|
+
- __cf_bm=adC6w3NUNGTpdZDzNn39guANJ9wi798uCuqc_EI8190-1693006624-0-AcpsuyzFE/KdM7ev5pSVTt2vnGqCSZBOuQYZ0iKFiJT0mBlAuNITn3hICEKvcZ4LH7JUIyjnEOWfq2w7JyRmrJ4=;
|
71
|
+
path=/; expires=Sat, 26-Aug-23 00:07:04 GMT; domain=.workos.com; HttpOnly;
|
72
|
+
Secure; SameSite=None
|
73
|
+
- __cfruid=1d0cc3edf886cc7b90bd0c9c3226f5611a385c1a-1693006624; path=/; domain=.workos.com;
|
74
|
+
HttpOnly; Secure; SameSite=None
|
75
|
+
Server:
|
76
|
+
- cloudflare
|
77
|
+
body:
|
78
|
+
encoding: ASCII-8BIT
|
79
|
+
string: '{"object":"user","id":"user_01H7TVSKS45SDHN5V9XPSM6H44","email":"jane@example.com","email_verified":false,"first_name":"Jane","last_name":"Doe","created_at":"2023-08-14T20:28:58.929Z","updated_at":"2023-08-25T22:57:44.262Z","user_type":"unmanaged","email_verified_at":null,"google_oauth_profile_id":null,"microsoft_oauth_profile_id":null}'
|
80
|
+
http_version:
|
81
|
+
recorded_at: Fri, 12 May 2025 23:37:04 GMT
|
82
|
+
recorded_with: VCR 5.0.0
|
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: 5.
|
4
|
+
version: 5.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WorkOS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: encryptor
|
@@ -368,6 +368,7 @@ files:
|
|
368
368
|
- spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/valid.yml
|
369
369
|
- spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/invalid.yml
|
370
370
|
- spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid.yml
|
371
|
+
- spec/support/fixtures/vcr_cassettes/user_management/update_user/email.yml
|
371
372
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml
|
372
373
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml
|
373
374
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user_password/invalid.yml
|
@@ -590,6 +591,7 @@ test_files:
|
|
590
591
|
- spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/valid.yml
|
591
592
|
- spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/invalid.yml
|
592
593
|
- spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid.yml
|
594
|
+
- spec/support/fixtures/vcr_cassettes/user_management/update_user/email.yml
|
593
595
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml
|
594
596
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml
|
595
597
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user_password/invalid.yml
|