workos 4.6.0 → 4.7.0
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/email_verification.rb +37 -0
- data/lib/workos/invitation.rb +5 -1
- data/lib/workos/password_reset.rb +37 -0
- data/lib/workos/user_management.rb +54 -0
- data/lib/workos/version.rb +1 -1
- data/lib/workos.rb +2 -0
- data/spec/lib/workos/user_management_spec.rb +65 -0
- data/spec/support/fixtures/vcr_cassettes/user_management/create_password_reset/valid.yml +80 -0
- data/spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/invalid.yml +80 -0
- data/spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/valid.yml +80 -0
- data/spec/support/fixtures/vcr_cassettes/user_management/get_password_reset/invalid.yml +80 -0
- data/spec/support/fixtures/vcr_cassettes/user_management/get_password_reset/valid.yml +80 -0
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a8eee76f744e675549099b150414fde6c8fb299bd40efd35f4765f4491a7896
|
4
|
+
data.tar.gz: de96239fdd72faf0e772146a7532b1e9a948f001c43e217d8af7636a75c2aa43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abc6d1b314105f5fb113e178015376d3ea607970ebb7d28cd1cdea8b914d558803504bdc420148aae0649fbcf997ee6cecf3602732b76fe356447e87fa5121a8
|
7
|
+
data.tar.gz: 36d55ffc100b13b92a172002fc921ffd980399c395b2f7bffea9d266eb9c9f01db4439b16dbb10371bb08f6d23b4e6f101c5b92559754be29b03bbc16e2b2f93
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module WorkOS
|
4
|
+
# The EmailVerification class provides a lightweight wrapper around a WorkOS email
|
5
|
+
# verification resource. This class is not meant to be instantiated in a user space,
|
6
|
+
# and is instantiated internally but exposed.
|
7
|
+
class EmailVerification
|
8
|
+
include HashProvider
|
9
|
+
|
10
|
+
attr_accessor :id, :user_id, :email,
|
11
|
+
:expires_at, :code, :created_at, :updated_at
|
12
|
+
|
13
|
+
def initialize(json)
|
14
|
+
hash = JSON.parse(json, symbolize_names: true)
|
15
|
+
|
16
|
+
@id = hash[:id]
|
17
|
+
@user_id = hash[:user_id]
|
18
|
+
@email = hash[:email]
|
19
|
+
@code = hash[:code]
|
20
|
+
@expires_at = hash[:expires_at]
|
21
|
+
@created_at = hash[:created_at]
|
22
|
+
@updated_at = hash[:updated_at]
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_json(*)
|
26
|
+
{
|
27
|
+
id: id,
|
28
|
+
user_id: user_id,
|
29
|
+
email: email,
|
30
|
+
code: code,
|
31
|
+
expires_at: expires_at,
|
32
|
+
created_at: created_at,
|
33
|
+
updated_at: updated_at,
|
34
|
+
}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/workos/invitation.rb
CHANGED
@@ -8,8 +8,9 @@ module WorkOS
|
|
8
8
|
include HashProvider
|
9
9
|
|
10
10
|
attr_accessor :id, :email, :state, :accepted_at, :revoked_at, :accept_invitation_url,
|
11
|
-
:expires_at, :token, :organization_id, :created_at, :updated_at
|
11
|
+
:expires_at, :token, :organization_id, :inviter_user_id, :created_at, :updated_at
|
12
12
|
|
13
|
+
# rubocop:disable Metrics/AbcSize
|
13
14
|
def initialize(json)
|
14
15
|
hash = JSON.parse(json, symbolize_names: true)
|
15
16
|
|
@@ -19,12 +20,14 @@ module WorkOS
|
|
19
20
|
@token = hash[:token]
|
20
21
|
@accept_invitation_url = hash[:accept_invitation_url]
|
21
22
|
@organization_id = hash[:organization_id]
|
23
|
+
@inviter_user_id = hash[:inviter_user_id]
|
22
24
|
@accepted_at = hash[:accepted_at]
|
23
25
|
@revoked_at = hash[:revoked_at]
|
24
26
|
@expires_at = hash[:expires_at]
|
25
27
|
@created_at = hash[:created_at]
|
26
28
|
@updated_at = hash[:updated_at]
|
27
29
|
end
|
30
|
+
# rubocop:enable Metrics/AbcSize
|
28
31
|
|
29
32
|
def to_json(*)
|
30
33
|
{
|
@@ -34,6 +37,7 @@ module WorkOS
|
|
34
37
|
token: token,
|
35
38
|
accept_invitation_url: accept_invitation_url,
|
36
39
|
organization_id: organization_id,
|
40
|
+
inviter_user_id: inviter_user_id,
|
37
41
|
accepted_at: accepted_at,
|
38
42
|
revoked_at: revoked_at,
|
39
43
|
expires_at: expires_at,
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module WorkOS
|
4
|
+
# The PasswordReset class provides a lightweight wrapper around a WorkOS password
|
5
|
+
# reset resource. This class is not meant to be instantiated in a user space,
|
6
|
+
# and is instantiated internally but exposed.
|
7
|
+
class PasswordReset
|
8
|
+
include HashProvider
|
9
|
+
|
10
|
+
attr_accessor :id, :user_id, :email, :password_reset_token,
|
11
|
+
:password_reset_url, :expires_at, :created_at
|
12
|
+
|
13
|
+
def initialize(json)
|
14
|
+
hash = JSON.parse(json, symbolize_names: true)
|
15
|
+
|
16
|
+
@id = hash[:id]
|
17
|
+
@user_id = hash[:user_id]
|
18
|
+
@email = hash[:email]
|
19
|
+
@password_reset_token = hash[:password_reset_token]
|
20
|
+
@password_reset_url = hash[:password_reset_url]
|
21
|
+
@expires_at = hash[:expires_at]
|
22
|
+
@created_at = hash[:created_at]
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_json(*)
|
26
|
+
{
|
27
|
+
id: id,
|
28
|
+
user_id: user_id,
|
29
|
+
email: email,
|
30
|
+
password_reset_token: password_reset_token,
|
31
|
+
password_reset_url: password_reset_url,
|
32
|
+
expires_at: expires_at,
|
33
|
+
created_at: created_at,
|
34
|
+
}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -650,6 +650,22 @@ module WorkOS
|
|
650
650
|
)
|
651
651
|
end
|
652
652
|
|
653
|
+
# Gets an email verification object
|
654
|
+
#
|
655
|
+
# @param [String] id The unique ID of the EmailVerification object.
|
656
|
+
#
|
657
|
+
# @return WorkOS::EmailVerification
|
658
|
+
def get_email_verification(id:)
|
659
|
+
response = execute_request(
|
660
|
+
request: get_request(
|
661
|
+
path: "/user_management/email_verification/#{id}",
|
662
|
+
auth: true,
|
663
|
+
),
|
664
|
+
)
|
665
|
+
|
666
|
+
WorkOS::EmailVerification.new(response.body)
|
667
|
+
end
|
668
|
+
|
653
669
|
# Sends a verification email to the provided user.
|
654
670
|
#
|
655
671
|
# @param [String] user_id The unique ID of the User whose email address will be verified.
|
@@ -686,6 +702,41 @@ module WorkOS
|
|
686
702
|
WorkOS::UserResponse.new(response.body)
|
687
703
|
end
|
688
704
|
|
705
|
+
# Gets a password reset object
|
706
|
+
#
|
707
|
+
# @param [String] id The unique ID of the PasswordReset object.
|
708
|
+
#
|
709
|
+
# @return WorkOS::PasswordReset
|
710
|
+
def get_password_reset(id:)
|
711
|
+
response = execute_request(
|
712
|
+
request: get_request(
|
713
|
+
path: "/user_management/password_reset/#{id}",
|
714
|
+
auth: true,
|
715
|
+
),
|
716
|
+
)
|
717
|
+
|
718
|
+
WorkOS::PasswordReset.new(response.body)
|
719
|
+
end
|
720
|
+
|
721
|
+
# Creates a password reset token
|
722
|
+
#
|
723
|
+
# @param [String] email The email address of the user.
|
724
|
+
#
|
725
|
+
# @return WorkOS::PasswordReset
|
726
|
+
def create_password_reset(email:)
|
727
|
+
response = execute_request(
|
728
|
+
request: post_request(
|
729
|
+
path: '/user_management/password_reset',
|
730
|
+
body: {
|
731
|
+
email: email,
|
732
|
+
},
|
733
|
+
auth: true,
|
734
|
+
),
|
735
|
+
)
|
736
|
+
|
737
|
+
WorkOS::PasswordReset.new(response.body)
|
738
|
+
end
|
739
|
+
|
689
740
|
# Create a password reset challenge and emails a password reset link to a user.
|
690
741
|
#
|
691
742
|
# @param [String] email The email of the user that wishes to reset their password.
|
@@ -693,6 +744,9 @@ module WorkOS
|
|
693
744
|
#
|
694
745
|
# @return [Bool] - returns `true` if successful
|
695
746
|
def send_password_reset_email(email:, password_reset_url:)
|
747
|
+
warn_deprecation '`send_password_reset_email` is deprecated.
|
748
|
+
Please use `create_password_reset` instead. This method will be removed in a future major version.'
|
749
|
+
|
696
750
|
request = post_request(
|
697
751
|
path: '/user_management/password_reset/send',
|
698
752
|
body: {
|
data/lib/workos/version.rb
CHANGED
data/lib/workos.rb
CHANGED
@@ -54,6 +54,7 @@ module WorkOS
|
|
54
54
|
autoload :DirectoryGroup, 'workos/directory_group'
|
55
55
|
autoload :DirectorySync, 'workos/directory_sync'
|
56
56
|
autoload :DirectoryUser, 'workos/directory_user'
|
57
|
+
autoload :EmailVerification, 'workos/email_verification'
|
57
58
|
autoload :Event, 'workos/event'
|
58
59
|
autoload :Events, 'workos/events'
|
59
60
|
autoload :Factor, 'workos/factor'
|
@@ -65,6 +66,7 @@ module WorkOS
|
|
65
66
|
autoload :Organizations, 'workos/organizations'
|
66
67
|
autoload :OrganizationMembership, 'workos/organization_membership'
|
67
68
|
autoload :Passwordless, 'workos/passwordless'
|
69
|
+
autoload :PasswordReset, 'workos/password_reset'
|
68
70
|
autoload :Portal, 'workos/portal'
|
69
71
|
autoload :Profile, 'workos/profile'
|
70
72
|
autoload :ProfileAndToken, 'workos/profile_and_token'
|
@@ -736,6 +736,31 @@ describe WorkOS::UserManagement do
|
|
736
736
|
end
|
737
737
|
end
|
738
738
|
|
739
|
+
describe '.get_email_verification' do
|
740
|
+
context 'with a valid id' do
|
741
|
+
it 'returns an email_verification object' do
|
742
|
+
VCR.use_cassette 'user_management/get_email_verification/valid' do
|
743
|
+
email_verification = described_class.get_email_verification(
|
744
|
+
id: 'email_verification_01HYK9VKNJQ0MJDXEXQP0DA1VK',
|
745
|
+
)
|
746
|
+
|
747
|
+
expect(email_verification.id.instance_of?(String))
|
748
|
+
expect(email_verification.instance_of?(WorkOS::EmailVerification))
|
749
|
+
end
|
750
|
+
end
|
751
|
+
end
|
752
|
+
|
753
|
+
context 'with an invalid id' do
|
754
|
+
it 'raises an error' do
|
755
|
+
VCR.use_cassette('user_management/get_email_verification/invalid') do
|
756
|
+
expect do
|
757
|
+
WorkOS::UserManagement.get_email_verification(id: 'invalid')
|
758
|
+
end.to raise_error(WorkOS::APIError, /Email Verification not found/)
|
759
|
+
end
|
760
|
+
end
|
761
|
+
end
|
762
|
+
end
|
763
|
+
|
739
764
|
describe '.send_verification_email' do
|
740
765
|
context 'with valid parameters' do
|
741
766
|
it 'sends an email to that user and the magic auth challenge' do
|
@@ -804,6 +829,46 @@ describe WorkOS::UserManagement do
|
|
804
829
|
end
|
805
830
|
end
|
806
831
|
|
832
|
+
describe '.get_password_reset' do
|
833
|
+
context 'with a valid id' do
|
834
|
+
it 'returns a password_reset object' do
|
835
|
+
VCR.use_cassette 'user_management/get_password_reset/valid' do
|
836
|
+
password_reset = described_class.get_password_reset(
|
837
|
+
id: 'password_reset_01HYKA8DTF8TW5YD30MF0ZXZKT',
|
838
|
+
)
|
839
|
+
|
840
|
+
expect(password_reset.id.instance_of?(String))
|
841
|
+
expect(password_reset.instance_of?(WorkOS::PasswordReset))
|
842
|
+
end
|
843
|
+
end
|
844
|
+
end
|
845
|
+
|
846
|
+
context 'with an invalid id' do
|
847
|
+
it 'raises an error' do
|
848
|
+
VCR.use_cassette('user_management/get_password_reset/invalid') do
|
849
|
+
expect do
|
850
|
+
WorkOS::UserManagement.get_password_reset(id: 'invalid')
|
851
|
+
end.to raise_error(WorkOS::APIError, /Password Reset not found/)
|
852
|
+
end
|
853
|
+
end
|
854
|
+
end
|
855
|
+
end
|
856
|
+
|
857
|
+
describe '.create_password_reset' do
|
858
|
+
context 'with valid payload' do
|
859
|
+
it 'creates a password_reset object' do
|
860
|
+
VCR.use_cassette 'user_management/create_password_reset/valid' do
|
861
|
+
password_reset = described_class.create_password_reset(
|
862
|
+
email: 'test@workos.com',
|
863
|
+
)
|
864
|
+
|
865
|
+
expect(password_reset.id).to eq('password_reset_01HYKA8DTF8TW5YD30MF0ZXZKT')
|
866
|
+
expect(password_reset.email).to eq('test@workos.com')
|
867
|
+
end
|
868
|
+
end
|
869
|
+
end
|
870
|
+
end
|
871
|
+
|
807
872
|
describe '.send_password_reset_email' do
|
808
873
|
context 'with a valid payload' do
|
809
874
|
it 'sends a password reset email' do
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/user_management/password_reset
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"email":"blair@workos.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; x86_64-darwin19; v4.6.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Thu, 23 May 2024 18:08:51 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Content-Length:
|
30
|
+
- '397'
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Cf-Ray:
|
34
|
+
- 8886fe5e1c317b24-DEN
|
35
|
+
Cf-Cache-Status:
|
36
|
+
- DYNAMIC
|
37
|
+
Etag:
|
38
|
+
- W/"18d-Z6VC8jkvZuXmNL0BcJcqkF7M0BQ"
|
39
|
+
Strict-Transport-Security:
|
40
|
+
- max-age=15552000; includeSubDomains
|
41
|
+
Vary:
|
42
|
+
- Origin, Accept-Encoding
|
43
|
+
Access-Control-Allow-Credentials:
|
44
|
+
- 'true'
|
45
|
+
Content-Security-Policy:
|
46
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
47
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
48
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
49
|
+
Expect-Ct:
|
50
|
+
- max-age=0
|
51
|
+
Referrer-Policy:
|
52
|
+
- no-referrer
|
53
|
+
X-Content-Type-Options:
|
54
|
+
- nosniff
|
55
|
+
X-Dns-Prefetch-Control:
|
56
|
+
- 'off'
|
57
|
+
X-Download-Options:
|
58
|
+
- noopen
|
59
|
+
X-Frame-Options:
|
60
|
+
- SAMEORIGIN
|
61
|
+
X-Permitted-Cross-Domain-Policies:
|
62
|
+
- none
|
63
|
+
X-Request-Id:
|
64
|
+
- db59df36-fce8-4174-a031-bd259bca32f8
|
65
|
+
X-Xss-Protection:
|
66
|
+
- '0'
|
67
|
+
Set-Cookie:
|
68
|
+
- __cf_bm=d6moUiiUczj82CNolGPFWxb99g4YP_C.ZlaH9W7xnF8-1716487731-1.0.1.1-pRG1tKVpL4EV8NrdL78THPAhMdBiKwY_tOlgnuanVHgNFvw6MeMv2wJG0Nkp4oLwXdW629gkH1OwSaLIv9EuYQ;
|
69
|
+
path=/; expires=Thu, 23-May-24 18:38:51 GMT; domain=.workos.com; HttpOnly;
|
70
|
+
Secure; SameSite=None
|
71
|
+
- __cfruid=bd64ac4e2572b6fc609d5cc06577eed03bc1bbcb-1716487731; path=/; domain=.workos.com;
|
72
|
+
HttpOnly; Secure; SameSite=None
|
73
|
+
Server:
|
74
|
+
- cloudflare
|
75
|
+
body:
|
76
|
+
encoding: UTF-8
|
77
|
+
string: '{"object":"password_reset","id":"password_reset_01HYKA8DTF8TW5YD30MF0ZXZKT","user_id":"user_01HH5GTVSP6PEXV0SRB9ANFE9G","email":"test@workos.com","password_reset_token":"DmNQt1ZWOz7k5hulOoGDN0TZd","password_reset_url":"https://my-app.com/reset-password/?token=DmNQt1ZWOz7k5hulOoGDN0TZd","expires_at":"2024-05-23T18:23:51.024Z","created_at":"2024-05-23T18:08:51.024Z"}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Thu, 23 May 2024 18:08:50 GMT
|
80
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/user_management/email_verification/invalid
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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; x86_64-darwin19; v4.6.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 404
|
23
|
+
message: Not Found
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Thu, 23 May 2024 18:04:34 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Cf-Ray:
|
34
|
+
- 8886f81a5d7e7b18-DEN
|
35
|
+
Cf-Cache-Status:
|
36
|
+
- DYNAMIC
|
37
|
+
Etag:
|
38
|
+
- W/"66-ESd/ROLsUvsCu/wiWkoaXfmv1gY"
|
39
|
+
Strict-Transport-Security:
|
40
|
+
- max-age=15552000; includeSubDomains
|
41
|
+
Vary:
|
42
|
+
- Origin, Accept-Encoding
|
43
|
+
Access-Control-Allow-Credentials:
|
44
|
+
- 'true'
|
45
|
+
Content-Security-Policy:
|
46
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
47
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
48
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
49
|
+
Expect-Ct:
|
50
|
+
- max-age=0
|
51
|
+
Referrer-Policy:
|
52
|
+
- no-referrer
|
53
|
+
X-Content-Type-Options:
|
54
|
+
- nosniff
|
55
|
+
X-Dns-Prefetch-Control:
|
56
|
+
- 'off'
|
57
|
+
X-Download-Options:
|
58
|
+
- noopen
|
59
|
+
X-Frame-Options:
|
60
|
+
- SAMEORIGIN
|
61
|
+
X-Permitted-Cross-Domain-Policies:
|
62
|
+
- none
|
63
|
+
X-Request-Id:
|
64
|
+
- 777e6230-9045-4858-9925-efb5c5783aa7
|
65
|
+
X-Xss-Protection:
|
66
|
+
- '0'
|
67
|
+
Set-Cookie:
|
68
|
+
- __cf_bm=jfT91VpwVMXi901oaS57bdvcPNjXwzgT0NN.TADMkSA-1716487474-1.0.1.1-D3FZIQ5VQOMnMl3UudReuAR600DpJh8NzCxffFA.bRKl_H6zziPQu7Kk3_.wsy8_ESDjlcUQ3suhVmUb5Iwbhg;
|
69
|
+
path=/; expires=Thu, 23-May-24 18:34:34 GMT; domain=.workos.com; HttpOnly;
|
70
|
+
Secure; SameSite=None
|
71
|
+
- __cfruid=387f8a46c39c44e43af2f39cd9fd8aea810da563-1716487474; path=/; domain=.workos.com;
|
72
|
+
HttpOnly; Secure; SameSite=None
|
73
|
+
Server:
|
74
|
+
- cloudflare
|
75
|
+
body:
|
76
|
+
encoding: ASCII-8BIT
|
77
|
+
string: '{"message":"Email Verification not found: ''invalid''.","code":"entity_not_found","entity_id":"invalid"}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Thu, 23 May 2024 18:04:34 GMT
|
80
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/user_management/email_verification/email_verification_01HYK9VKNJQ0MJDXEXQP0DA1VK
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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; x86_64-darwin19; v4.6.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Thu, 23 May 2024 18:20:20 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Cf-Ray:
|
34
|
+
- 88870f32dcd07c2e-DEN
|
35
|
+
Cf-Cache-Status:
|
36
|
+
- DYNAMIC
|
37
|
+
Etag:
|
38
|
+
- W/"12b-ekjr8XAvfdiqyjIkVD8WtynlLBo"
|
39
|
+
Strict-Transport-Security:
|
40
|
+
- max-age=15552000; includeSubDomains
|
41
|
+
Vary:
|
42
|
+
- Origin, Accept-Encoding
|
43
|
+
Access-Control-Allow-Credentials:
|
44
|
+
- 'true'
|
45
|
+
Content-Security-Policy:
|
46
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
47
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
48
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
49
|
+
Expect-Ct:
|
50
|
+
- max-age=0
|
51
|
+
Referrer-Policy:
|
52
|
+
- no-referrer
|
53
|
+
X-Content-Type-Options:
|
54
|
+
- nosniff
|
55
|
+
X-Dns-Prefetch-Control:
|
56
|
+
- 'off'
|
57
|
+
X-Download-Options:
|
58
|
+
- noopen
|
59
|
+
X-Frame-Options:
|
60
|
+
- SAMEORIGIN
|
61
|
+
X-Permitted-Cross-Domain-Policies:
|
62
|
+
- none
|
63
|
+
X-Request-Id:
|
64
|
+
- 52bf7914-d672-454b-bd61-353e397fdad5
|
65
|
+
X-Xss-Protection:
|
66
|
+
- '0'
|
67
|
+
Set-Cookie:
|
68
|
+
- __cf_bm=huBpGvZo0rq1TOrNY2F0wBwT69_y.Paz9joecCAWK2Y-1716488420-1.0.1.1-YY9yAQE6aOIbVg6Vf8Rxc8ScBPueEKTcUGUXIQmi_AYXfCtcQUa3MzjWeeC0.vmO0AetYPSX3FmmWUf26GH2Fw;
|
69
|
+
path=/; expires=Thu, 23-May-24 18:50:20 GMT; domain=.workos.com; HttpOnly;
|
70
|
+
Secure; SameSite=None
|
71
|
+
- __cfruid=823df799452104e182687db9c4f57d862b59f78e-1716488420; path=/; domain=.workos.com;
|
72
|
+
HttpOnly; Secure; SameSite=None
|
73
|
+
Server:
|
74
|
+
- cloudflare
|
75
|
+
body:
|
76
|
+
encoding: ASCII-8BIT
|
77
|
+
string: '{"object":"email_verification","id":"email_verification_01HYK9VKNJQ0MJDXEXQP0DA1VK","user_id":"user_01HYK9VAAW34TPP0KSYXCX44SB","email":"blairlunceford@gmail.com","code":"561814","expires_at":"2024-05-23T18:11:51.024Z","created_at":"2024-05-23T18:01:50.997Z","updated_at":"2024-05-23T18:01:50.997Z"}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Thu, 23 May 2024 18:20:20 GMT
|
80
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/user_management/password_reset/invalid
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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; x86_64-darwin19; v4.6.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 404
|
23
|
+
message: Not Found
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Thu, 23 May 2024 18:04:34 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Cf-Ray:
|
34
|
+
- 8886f81cb89c7b00-DEN
|
35
|
+
Cf-Cache-Status:
|
36
|
+
- DYNAMIC
|
37
|
+
Etag:
|
38
|
+
- W/"62-MwEIS86+oNNsmjVX0JyWZTcjZ9s"
|
39
|
+
Strict-Transport-Security:
|
40
|
+
- max-age=15552000; includeSubDomains
|
41
|
+
Vary:
|
42
|
+
- Origin, Accept-Encoding
|
43
|
+
Access-Control-Allow-Credentials:
|
44
|
+
- 'true'
|
45
|
+
Content-Security-Policy:
|
46
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
47
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
48
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
49
|
+
Expect-Ct:
|
50
|
+
- max-age=0
|
51
|
+
Referrer-Policy:
|
52
|
+
- no-referrer
|
53
|
+
X-Content-Type-Options:
|
54
|
+
- nosniff
|
55
|
+
X-Dns-Prefetch-Control:
|
56
|
+
- 'off'
|
57
|
+
X-Download-Options:
|
58
|
+
- noopen
|
59
|
+
X-Frame-Options:
|
60
|
+
- SAMEORIGIN
|
61
|
+
X-Permitted-Cross-Domain-Policies:
|
62
|
+
- none
|
63
|
+
X-Request-Id:
|
64
|
+
- 5b33aeae-7a47-4893-8fef-f014e6692866
|
65
|
+
X-Xss-Protection:
|
66
|
+
- '0'
|
67
|
+
Set-Cookie:
|
68
|
+
- __cf_bm=nkAinUzRPwshxLJMd18TIu20ff0fkGCILsc2NGkWLcs-1716487474-1.0.1.1-Ci9e5PwUuKRRSCrdjfPf3hLETEBr8qGDcVdllyCDW39my5OtwL58BZDu0vB0kuC_6vsPe4UrLSzfoz6XMyjmmw;
|
69
|
+
path=/; expires=Thu, 23-May-24 18:34:34 GMT; domain=.workos.com; HttpOnly;
|
70
|
+
Secure; SameSite=None
|
71
|
+
- __cfruid=387f8a46c39c44e43af2f39cd9fd8aea810da563-1716487474; path=/; domain=.workos.com;
|
72
|
+
HttpOnly; Secure; SameSite=None
|
73
|
+
Server:
|
74
|
+
- cloudflare
|
75
|
+
body:
|
76
|
+
encoding: ASCII-8BIT
|
77
|
+
string: '{"message":"Password Reset not found: ''invalid''.","code":"entity_not_found","entity_id":"invalid"}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Thu, 23 May 2024 18:04:34 GMT
|
80
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/user_management/password_reset/password_reset_01HYKA8DTF8TW5YD30MF0ZXZKT
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
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; x86_64-darwin19; v4.6.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Thu, 23 May 2024 18:10:20 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Cf-Ray:
|
34
|
+
- 8887008eb83c51eb-DEN
|
35
|
+
Cf-Cache-Status:
|
36
|
+
- DYNAMIC
|
37
|
+
Etag:
|
38
|
+
- W/"18d-Z6VC8jkvZuXmNL0BcJcqkF7M0BQ"
|
39
|
+
Strict-Transport-Security:
|
40
|
+
- max-age=15552000; includeSubDomains
|
41
|
+
Vary:
|
42
|
+
- Origin, Accept-Encoding
|
43
|
+
Access-Control-Allow-Credentials:
|
44
|
+
- 'true'
|
45
|
+
Content-Security-Policy:
|
46
|
+
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self''
|
47
|
+
https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src
|
48
|
+
''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
|
49
|
+
Expect-Ct:
|
50
|
+
- max-age=0
|
51
|
+
Referrer-Policy:
|
52
|
+
- no-referrer
|
53
|
+
X-Content-Type-Options:
|
54
|
+
- nosniff
|
55
|
+
X-Dns-Prefetch-Control:
|
56
|
+
- 'off'
|
57
|
+
X-Download-Options:
|
58
|
+
- noopen
|
59
|
+
X-Frame-Options:
|
60
|
+
- SAMEORIGIN
|
61
|
+
X-Permitted-Cross-Domain-Policies:
|
62
|
+
- none
|
63
|
+
X-Request-Id:
|
64
|
+
- bd5403d4-e651-4b63-acde-50287326e0d7
|
65
|
+
X-Xss-Protection:
|
66
|
+
- '0'
|
67
|
+
Set-Cookie:
|
68
|
+
- __cf_bm=YhPLb6u6gDZZcI3AVyfPTCitp9JKWpSMhZ236D6EPJI-1716487820-1.0.1.1-F0GOL.FAH1ROxtTJumLoe_YGWkO6uoozp7qv4oFniAc0aX20kqay7JvCfszxpxRsEbvj5mPTJcqVyvDm7qedeA;
|
69
|
+
path=/; expires=Thu, 23-May-24 18:40:20 GMT; domain=.workos.com; HttpOnly;
|
70
|
+
Secure; SameSite=None
|
71
|
+
- __cfruid=cdbb09208777e3b5b5ee0ae80b61e07279d590c0-1716487820; path=/; domain=.workos.com;
|
72
|
+
HttpOnly; Secure; SameSite=None
|
73
|
+
Server:
|
74
|
+
- cloudflare
|
75
|
+
body:
|
76
|
+
encoding: ASCII-8BIT
|
77
|
+
string: '{"object":"password_reset","id":"password_reset_01HYKA8DTF8TW5YD30MF0ZXZKT","user_id":"user_01HH5GTVSP6PEXV0SRB9ANFE9G","email":"blair@workos.com","password_reset_token":"DmNQt1ZWOz7k5hulOoGDN0TZd","password_reset_url":"https://manageable-child-63-staging.authkit.app/reset-password/?token=DmNQt1ZWOz7k5hulOoGDN0TZd","expires_at":"2024-05-23T18:23:51.024Z","created_at":"2024-05-23T18:08:51.024Z"}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Thu, 23 May 2024 18:10:20 GMT
|
80
|
+
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: 4.
|
4
|
+
version: 4.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WorkOS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- lib/workos/directory_group.rb
|
119
119
|
- lib/workos/directory_sync.rb
|
120
120
|
- lib/workos/directory_user.rb
|
121
|
+
- lib/workos/email_verification.rb
|
121
122
|
- lib/workos/errors.rb
|
122
123
|
- lib/workos/event.rb
|
123
124
|
- lib/workos/events.rb
|
@@ -130,6 +131,7 @@ files:
|
|
130
131
|
- lib/workos/organization.rb
|
131
132
|
- lib/workos/organization_membership.rb
|
132
133
|
- lib/workos/organizations.rb
|
134
|
+
- lib/workos/password_reset.rb
|
133
135
|
- lib/workos/passwordless.rb
|
134
136
|
- lib/workos/portal.rb
|
135
137
|
- lib/workos/profile.rb
|
@@ -272,6 +274,7 @@ files:
|
|
272
274
|
- spec/support/fixtures/vcr_cassettes/user_management/create_magic_auth/valid.yml
|
273
275
|
- spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/invalid.yml
|
274
276
|
- spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml
|
277
|
+
- spec/support/fixtures/vcr_cassettes/user_management/create_password_reset/valid.yml
|
275
278
|
- spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml
|
276
279
|
- spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml
|
277
280
|
- spec/support/fixtures/vcr_cassettes/user_management/deactivate_organization_membership.yml
|
@@ -281,11 +284,15 @@ files:
|
|
281
284
|
- spec/support/fixtures/vcr_cassettes/user_management/delete_user/valid.yml
|
282
285
|
- spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/invalid.yml
|
283
286
|
- spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/valid.yml
|
287
|
+
- spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/invalid.yml
|
288
|
+
- spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/valid.yml
|
284
289
|
- spec/support/fixtures/vcr_cassettes/user_management/get_invitation/invalid.yml
|
285
290
|
- spec/support/fixtures/vcr_cassettes/user_management/get_invitation/valid.yml
|
286
291
|
- spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/invalid.yml
|
287
292
|
- spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/valid.yml
|
288
293
|
- spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml
|
294
|
+
- spec/support/fixtures/vcr_cassettes/user_management/get_password_reset/invalid.yml
|
295
|
+
- spec/support/fixtures/vcr_cassettes/user_management/get_password_reset/valid.yml
|
289
296
|
- spec/support/fixtures/vcr_cassettes/user_management/get_user.yml
|
290
297
|
- spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/invalid.yml
|
291
298
|
- spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/valid.yml
|
@@ -472,6 +479,7 @@ test_files:
|
|
472
479
|
- spec/support/fixtures/vcr_cassettes/user_management/create_magic_auth/valid.yml
|
473
480
|
- spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/invalid.yml
|
474
481
|
- spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml
|
482
|
+
- spec/support/fixtures/vcr_cassettes/user_management/create_password_reset/valid.yml
|
475
483
|
- spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml
|
476
484
|
- spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml
|
477
485
|
- spec/support/fixtures/vcr_cassettes/user_management/deactivate_organization_membership.yml
|
@@ -481,11 +489,15 @@ test_files:
|
|
481
489
|
- spec/support/fixtures/vcr_cassettes/user_management/delete_user/valid.yml
|
482
490
|
- spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/invalid.yml
|
483
491
|
- spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/valid.yml
|
492
|
+
- spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/invalid.yml
|
493
|
+
- spec/support/fixtures/vcr_cassettes/user_management/get_email_verification/valid.yml
|
484
494
|
- spec/support/fixtures/vcr_cassettes/user_management/get_invitation/invalid.yml
|
485
495
|
- spec/support/fixtures/vcr_cassettes/user_management/get_invitation/valid.yml
|
486
496
|
- spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/invalid.yml
|
487
497
|
- spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/valid.yml
|
488
498
|
- spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml
|
499
|
+
- spec/support/fixtures/vcr_cassettes/user_management/get_password_reset/invalid.yml
|
500
|
+
- spec/support/fixtures/vcr_cassettes/user_management/get_password_reset/valid.yml
|
489
501
|
- spec/support/fixtures/vcr_cassettes/user_management/get_user.yml
|
490
502
|
- spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/invalid.yml
|
491
503
|
- spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/valid.yml
|