workos 4.4.0 → 4.6.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.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/workos/invitation.rb +3 -1
  4. data/lib/workos/magic_auth.rb +37 -0
  5. data/lib/workos/user_management.rb +75 -2
  6. data/lib/workos/version.rb +1 -1
  7. data/lib/workos.rb +1 -0
  8. data/spec/lib/workos/user_management_spec.rb +117 -0
  9. data/spec/support/fixtures/vcr_cassettes/user_management/create_magic_auth/valid.yml +80 -0
  10. data/spec/support/fixtures/vcr_cassettes/user_management/deactivate_organization_membership.yml +64 -0
  11. data/spec/support/fixtures/vcr_cassettes/user_management/get_invitation/valid.yml +1 -1
  12. data/spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/invalid.yml +80 -0
  13. data/spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/valid.yml +80 -0
  14. data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_after.yml +1 -1
  15. data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_before.yml +1 -1
  16. data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_limit.yml +1 -1
  17. data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_no_options.yml +1 -1
  18. data/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_organization_id.yml +1 -1
  19. data/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_statuses_option.yml +64 -0
  20. data/spec/support/fixtures/vcr_cassettes/user_management/reactivate_organization_membership.yml +64 -0
  21. data/spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/valid.yml +1 -1
  22. data/spec/support/fixtures/vcr_cassettes/user_management/send_invitation/valid.yml +1 -1
  23. metadata +15 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0788087be575732297410a9b832a1290f5615b632560366589db388e1b6ec8d
4
- data.tar.gz: 97493a7743daa8994b65319882e3c3351361ea2a8a289c425abd6fc04023098f
3
+ metadata.gz: 332ad6b582c870d359c308f231c3a9aab661487177b5afb73f9eda7b8c42f3ba
4
+ data.tar.gz: e95ae8f206a0a365a96ecc849b7426c0fd5425b59ac3cb9fde6fae4db1bb3b87
5
5
  SHA512:
6
- metadata.gz: fa8eca58f02a95f137a610033413f408477bdc8bcf66c14ddb9bda85be3e6f2bf008031b5cf7e13fd501962f4ab4c183b73477216879cfe86d9c9c3cf086c123
7
- data.tar.gz: f156a6d7a1d032753dc7f79b478acd492f81b164bf974432ae1f3a7c2770145e347c4b501e1aaf42b8716eb67c7401fd167558859645f7090e79f638519ae1b6
6
+ metadata.gz: b216f6e42eed12702ad449a0370aac224e7c946ea275b48170162a2eb43f4639ee2e7cdf5ef9a1be31edde3d120f3ae7f13d6531233d2974cf27c3af4c7a870a
7
+ data.tar.gz: e1597322a482e0c94fae260b11cc1225f831a80f5e916fbf8b52415df6972054b8eba8b973cb73336c6985396e518535197c9e3fccdc33cd17fd3871a5eff958
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (4.4.0)
4
+ workos (4.6.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -7,7 +7,7 @@ module WorkOS
7
7
  class Invitation
8
8
  include HashProvider
9
9
 
10
- attr_accessor :id, :email, :state, :accepted_at, :revoked_at,
10
+ attr_accessor :id, :email, :state, :accepted_at, :revoked_at, :accept_invitation_url,
11
11
  :expires_at, :token, :organization_id, :created_at, :updated_at
12
12
 
13
13
  def initialize(json)
@@ -17,6 +17,7 @@ module WorkOS
17
17
  @email = hash[:email]
18
18
  @state = hash[:state]
19
19
  @token = hash[:token]
20
+ @accept_invitation_url = hash[:accept_invitation_url]
20
21
  @organization_id = hash[:organization_id]
21
22
  @accepted_at = hash[:accepted_at]
22
23
  @revoked_at = hash[:revoked_at]
@@ -31,6 +32,7 @@ module WorkOS
31
32
  email: email,
32
33
  state: state,
33
34
  token: token,
35
+ accept_invitation_url: accept_invitation_url,
34
36
  organization_id: organization_id,
35
37
  accepted_at: accepted_at,
36
38
  revoked_at: revoked_at,
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WorkOS
4
+ # The MagicAuth class provides a lightweight wrapper around a WorkOS MagicAuth
5
+ # resource. This class is not meant to be instantiated in a user space,
6
+ # and is instantiated internally but exposed.
7
+ class MagicAuth
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
@@ -31,7 +31,7 @@ module WorkOS
31
31
  end
32
32
 
33
33
  class << self
34
- include Client
34
+ include Client, Deprecation
35
35
 
36
36
  PROVIDERS = WorkOS::UserManagement::Types::Provider::ALL
37
37
  AUTH_FACTOR_TYPES = WorkOS::UserManagement::Types::AuthFactorType::ALL
@@ -537,12 +537,52 @@ module WorkOS
537
537
  ).to_s
538
538
  end
539
539
 
540
+ # Gets a Magic Auth object
541
+ #
542
+ # @param [String] id The unique ID of the MagicAuth object.
543
+ #
544
+ # @return WorkOS::MagicAuth
545
+ def get_magic_auth(id:)
546
+ response = execute_request(
547
+ request: get_request(
548
+ path: "/user_management/magic_auth/#{id}",
549
+ auth: true,
550
+ ),
551
+ )
552
+
553
+ WorkOS::MagicAuth.new(response.body)
554
+ end
555
+
556
+ # Creates a MagicAuth code
557
+ #
558
+ # @param [String] email The email address of the recipient.
559
+ # @param [String] invitation_token The token of an Invitation, if required.
560
+ #
561
+ # @return WorkOS::MagicAuth
562
+ def create_magic_auth(email:, invitation_token: nil)
563
+ response = execute_request(
564
+ request: post_request(
565
+ path: '/user_management/magic_auth',
566
+ body: {
567
+ email: email,
568
+ invitation_token: invitation_token,
569
+ },
570
+ auth: true,
571
+ ),
572
+ )
573
+
574
+ WorkOS::MagicAuth.new(response.body)
575
+ end
576
+
540
577
  # Create a one-time Magic Auth code and emails it to the user.
541
578
  #
542
579
  # @param [String] email The email address the one-time code will be sent to.
543
580
  #
544
581
  # @return Boolean
545
582
  def send_magic_auth_code(email:)
583
+ warn_deprecation '`send_magic_auth_code` is deprecated.
584
+ Please use `create_magic_auth` instead. This method will be removed in a future major version.'
585
+
546
586
  response = execute_request(
547
587
  request: post_request(
548
588
  path: '/user_management/magic_auth/send',
@@ -708,7 +748,8 @@ module WorkOS
708
748
  #
709
749
  # @param [Hash] options
710
750
  # @option options [String] user_id The ID of the User.
711
- # @option options [String] organization_id Filter Users by the organization they are members of.
751
+ # @option options [String] organization_id Filter memberships by the organization they are members of.
752
+ # @option options [Array<String>] statuses Filter memberships by status.
712
753
  # @option options [String] limit Maximum number of records to return.
713
754
  # @option options [String] order The order in which to paginate records
714
755
  # @option options [String] before Pagination cursor to receive records
@@ -776,6 +817,38 @@ module WorkOS
776
817
  response.is_a? Net::HTTPSuccess
777
818
  end
778
819
 
820
+ # Deactivate an Organization Membership
821
+ #
822
+ # @param [String] id The unique ID of the Organization Membership.
823
+ #
824
+ # @return WorkOS::OrganizationMembership
825
+ def deactivate_organization_membership(id:)
826
+ response = execute_request(
827
+ request: put_request(
828
+ path: "/user_management/organization_memberships/#{id}/deactivate",
829
+ auth: true,
830
+ ),
831
+ )
832
+
833
+ WorkOS::OrganizationMembership.new(response.body)
834
+ end
835
+
836
+ # Reactivate an Organization Membership
837
+ #
838
+ # @param [String] id The unique ID of the Organization Membership.
839
+ #
840
+ # @return WorkOS::OrganizationMembership
841
+ def reactivate_organization_membership(id:)
842
+ response = execute_request(
843
+ request: put_request(
844
+ path: "/user_management/organization_memberships/#{id}/reactivate",
845
+ auth: true,
846
+ ),
847
+ )
848
+
849
+ WorkOS::OrganizationMembership.new(response.body)
850
+ end
851
+
779
852
  # Gets an Invitation
780
853
  #
781
854
  # @param [String] id The unique ID of the Invitation.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorkOS
4
- VERSION = '4.4.0'
4
+ VERSION = '4.6.0'
5
5
  end
data/lib/workos.rb CHANGED
@@ -59,6 +59,7 @@ module WorkOS
59
59
  autoload :Factor, 'workos/factor'
60
60
  autoload :Impersonator, 'workos/impersonator'
61
61
  autoload :Invitation, 'workos/invitation'
62
+ autoload :MagicAuth, 'workos/magic_auth'
62
63
  autoload :MFA, 'workos/mfa'
63
64
  autoload :Organization, 'workos/organization'
64
65
  autoload :Organizations, 'workos/organizations'
@@ -618,6 +618,46 @@ describe WorkOS::UserManagement do
618
618
  end
619
619
  end
620
620
 
621
+ describe '.get_magic_auth' do
622
+ context 'with a valid id' do
623
+ it 'returns a magic_auth object' do
624
+ VCR.use_cassette 'user_management/get_magic_auth/valid' do
625
+ magic_auth = described_class.get_magic_auth(
626
+ id: 'magic_auth_01HWXVEWWSMR5HS8M6FBGMBJJ9',
627
+ )
628
+
629
+ expect(magic_auth.id.instance_of?(String))
630
+ expect(magic_auth.instance_of?(WorkOS::MagicAuth))
631
+ end
632
+ end
633
+ end
634
+
635
+ context 'with an invalid id' do
636
+ it 'raises an error' do
637
+ VCR.use_cassette('user_management/get_magic_auth/invalid') do
638
+ expect do
639
+ WorkOS::UserManagement.get_magic_auth(id: 'invalid')
640
+ end.to raise_error(WorkOS::APIError, /MagicAuth not found/)
641
+ end
642
+ end
643
+ end
644
+ end
645
+
646
+ describe '.create_magic_auth' do
647
+ context 'with valid payload' do
648
+ it 'creates a magic_auth' do
649
+ VCR.use_cassette 'user_management/create_magic_auth/valid' do
650
+ magic_auth = described_class.create_magic_auth(
651
+ email: 'test@workos.com',
652
+ )
653
+
654
+ expect(magic_auth.id).to eq('magic_auth_01HWXVEWWSMR5HS8M6FBGMBJJ9')
655
+ expect(magic_auth.email).to eq('test@workos.com')
656
+ end
657
+ end
658
+ end
659
+ end
660
+
621
661
  describe '.send_magic_auth_code' do
622
662
  context 'with valid parameters' do
623
663
  it 'sends a magic link to the email address' do
@@ -893,6 +933,33 @@ describe WorkOS::UserManagement do
893
933
  end
894
934
  end
895
935
  end
936
+
937
+ context 'with statuses option' do
938
+ it 'returns a list of matching users' do
939
+ request_args = [
940
+ '/user_management/organization_memberships?user_id=user_01HXYSZBKQE2N3NHBKZHDP1X5X&'\
941
+ 'statuses=active&statuses=inactive&order=desc&limit=5',
942
+ 'Content-Type' => 'application/json'
943
+ ]
944
+
945
+ expected_request = Net::HTTP::Get.new(*request_args)
946
+
947
+ expect(Net::HTTP::Get).to receive(:new).with(*request_args).
948
+ and_return(expected_request)
949
+
950
+ VCR.use_cassette 'user_management/list_organization_memberships/with_statuses_option' do
951
+ organization_memberships = described_class.list_organization_memberships(
952
+ user_id: 'user_01HXYSZBKQE2N3NHBKZHDP1X5X',
953
+ statuses: %w[active inactive],
954
+ order: 'desc',
955
+ limit: '5',
956
+ )
957
+
958
+ expect(organization_memberships.data.size).to eq(1)
959
+ expect(organization_memberships.data[0].user_id).to eq('user_01HXYSZBKQE2N3NHBKZHDP1X5X')
960
+ end
961
+ end
962
+ end
896
963
  end
897
964
 
898
965
  describe '.create_organization_membership' do
@@ -948,6 +1015,56 @@ describe WorkOS::UserManagement do
948
1015
  end
949
1016
  end
950
1017
 
1018
+ describe '.deactivate_organization_membership' do
1019
+ context 'with a valid id' do
1020
+ it 'returns a organization membership' do
1021
+ VCR.use_cassette 'user_management/deactivate_organization_membership' do
1022
+ organization_membership = described_class.deactivate_organization_membership(
1023
+ id: 'om_01HXYT0G3H5QG9YTSHSHFZQE6D',
1024
+ )
1025
+
1026
+ expect(organization_membership.id.instance_of?(String))
1027
+ expect(organization_membership.instance_of?(WorkOS::OrganizationMembership))
1028
+ end
1029
+ end
1030
+ end
1031
+
1032
+ context 'with an invalid id' do
1033
+ it 'returns an error' do
1034
+ expect do
1035
+ described_class.deactivate_organization_membership(
1036
+ id: 'invalid_organization_membership_id',
1037
+ ).to raise_error(WorkOS::APIError)
1038
+ end
1039
+ end
1040
+ end
1041
+ end
1042
+
1043
+ describe '.reactivate_organization_membership' do
1044
+ context 'with a valid id' do
1045
+ it 'returns a organization membership' do
1046
+ VCR.use_cassette 'user_management/reactivate_organization_membership' do
1047
+ organization_membership = described_class.reactivate_organization_membership(
1048
+ id: 'om_01HXYT0G3H5QG9YTSHSHFZQE6D',
1049
+ )
1050
+
1051
+ expect(organization_membership.id.instance_of?(String))
1052
+ expect(organization_membership.instance_of?(WorkOS::OrganizationMembership))
1053
+ end
1054
+ end
1055
+ end
1056
+
1057
+ context 'with an invalid id' do
1058
+ it 'returns an error' do
1059
+ expect do
1060
+ described_class.reactivate_organization_membership(
1061
+ id: 'invalid_organization_membership_id',
1062
+ ).to raise_error(WorkOS::APIError)
1063
+ end
1064
+ end
1065
+ end
1066
+ end
1067
+
951
1068
  describe '.get_invitation' do
952
1069
  context 'with a valid id' do
953
1070
  it 'returns an invitation' do
@@ -0,0 +1,80 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.workos.com/user_management/magic_auth
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"email":"test@workos.com","invitation_token":null}'
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.4.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Date:
26
+ - Thu, 02 May 2024 23:50:29 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Content-Length:
30
+ - '274'
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 87dbe9f0989051df-DEN
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"112-XzVK2s+8XVoqs9cCTPJC7VyC3IQ"
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
+ - 0ffddb81-5eac-4de6-b5a9-e93fade6db93
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Set-Cookie:
68
+ - __cf_bm=Vlzipf6hw8yFfYVC2LuTclSbuxE96I2boK9h6dPBL8Q-1714693829-1.0.1.1-r0i0ukq1UXcWzb3__XYkiwuWdnr5jKhXUTYKG_qhrrhgDNzb7o7cUugM4YPS1YWV5RS1xdvDBXigLY0AV66mAg;
69
+ path=/; expires=Fri, 03-May-24 00:20:29 GMT; domain=.workos.com; HttpOnly;
70
+ Secure; SameSite=None
71
+ - __cfruid=94afbb49471958910ded5cab91db63de8d3d47e6-1714693829; path=/; domain=.workos.com;
72
+ HttpOnly; Secure; SameSite=None
73
+ Server:
74
+ - cloudflare
75
+ body:
76
+ encoding: UTF-8
77
+ string: '{"object":"magic_auth","id":"magic_auth_01HWXVEWWSMR5HS8M6FBGMBJJ9","user_id":"user_01HWXVEWSWSJ66VE29AD14KZ0C","email":"test@workos.com","code":"500013","expires_at":"2024-05-03T00:00:29.528Z","created_at":"2024-05-02T23:50:29.479Z","updated_at":"2024-05-02T23:50:29.479Z"}'
78
+ http_version:
79
+ recorded_at: Thu, 02 May 2024 23:50:29 GMT
80
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://api.workos.com/user_management/organization_memberships/om_01HXYT0G3H5QG9YTSHSHFZQE6D/deactivate
6
+ body:
7
+ encoding: UTF-8
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.3.0; arm64-darwin23; v4.5.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Wed, 15 May 2024 19:13:06 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Strict-Transport-Security:
34
+ - max-age=15552000; includeSubDomains
35
+ Vary:
36
+ - Origin, Accept-Encoding
37
+ Access-Control-Allow-Credentials:
38
+ - "true"
39
+ Content-Security-Policy:
40
+ - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self'
41
+ https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src
42
+ 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"
43
+ Expect-Ct:
44
+ - max-age=0
45
+ Referrer-Policy:
46
+ - no-referrer
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ X-Dns-Prefetch-Control:
50
+ - "off"
51
+ X-Download-Options:
52
+ - noopen
53
+ X-Frame-Options:
54
+ - SAMEORIGIN
55
+ X-Permitted-Cross-Domain-Policies:
56
+ - none
57
+ X-Xss-Protection:
58
+ - "0"
59
+ body:
60
+ encoding: ASCII-8BIT
61
+ string: '{"object":"organization_membership","id":"om_01HXYT0G3H5QG9YTSHSHFZQE6D","organization_id":"org_01HRCVHACPY05V2FP0KEBQZYD3","user_id":"user_01HXYSZBKQE2N3NHBKZHDP1X5X","status":"inactive","role":{"slug":"member"},"created_at":"2024-05-15T19:00:05.359Z","updated_at":"2024-05-15T19:13:06.259Z"}'
62
+ http_version:
63
+ recorded_at: Wed, 15 May 2024 19:13:06 GMT
64
+ recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: ASCII-8BIT
79
- string: '{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
79
+ string: '{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
80
80
  http_version:
81
81
  recorded_at: Mon, 14 Aug 2023 21:42:04 GMT
82
82
  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/magic_auth/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.4.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 404
23
+ message: Not Found
24
+ headers:
25
+ Date:
26
+ - Thu, 02 May 2024 23:53:49 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 87dbeed57a5a7c25-DEN
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"8a-boo9lPL4s/fqPxV0Hun3Ue0NFew"
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
+ - 12cb618c-5540-43f8-8178-49a7be2248f9
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Set-Cookie:
68
+ - __cf_bm=X3.gnPiStpnIVzd_Qb5C1PUDQzD32Tj0PQ8CEME.KTQ-1714694029-1.0.1.1-WDZ9aX_PJfAtBDTUj9ukw8GtaRhOVXH0vH6tThVOZNhRk34Dpc_gqE1yEDegGQYHmlt.iXgul.WNXBE0ARpf_g;
69
+ path=/; expires=Fri, 03-May-24 00:23:49 GMT; domain=.workos.com; HttpOnly;
70
+ Secure; SameSite=None
71
+ - __cfruid=39f5b22af74b005f407c542836af9e55e6d29816-1714694029; path=/; domain=.workos.com;
72
+ HttpOnly; Secure; SameSite=None
73
+ Server:
74
+ - cloudflare
75
+ body:
76
+ encoding: ASCII-8BIT
77
+ string: '{"message":"MagicAuth not found: ''magic_auth_invalid''.","code":"entity_not_found","entity_id":"magic_auth_invalid"}'
78
+ http_version:
79
+ recorded_at: Thu, 02 May 2024 23:53:49 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/magic_auth/magic_auth_01HWXVEWWSMR5HS8M6FBGMBJJ9
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.4.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Thu, 02 May 2024 23:53:49 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 87dbeed47df151f4-DEN
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"112-XzVK2s+8XVoqs9cCTPJC7VyC3IQ"
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
+ - 6f38d8ca-904f-4940-9730-4d99e2d20496
65
+ X-Xss-Protection:
66
+ - '0'
67
+ Set-Cookie:
68
+ - __cf_bm=bIa76a4FQCxR5oYEFQNr.0UhmZVnvLLanztY9NFBwU4-1714694029-1.0.1.1-DzZkmhziT4tSpAsSZeVbyo63E5nFiiF8FTiZzuaERD.QiWNXfAP5zI9KlghVfgv0FzogjoFzubEGmY_S1Xu.zg;
69
+ path=/; expires=Fri, 03-May-24 00:23:49 GMT; domain=.workos.com; HttpOnly;
70
+ Secure; SameSite=None
71
+ - __cfruid=39f5b22af74b005f407c542836af9e55e6d29816-1714694029; path=/; domain=.workos.com;
72
+ HttpOnly; Secure; SameSite=None
73
+ Server:
74
+ - cloudflare
75
+ body:
76
+ encoding: ASCII-8BIT
77
+ string: '{"object":"magic_auth","id":"magic_auth_01HWXVEWWSMR5HS8M6FBGMBJJ9","user_id":"user_01HWXVEWSWSJ66VE29AD14KZ0C","email":"test@workos.com","code":"500013","expires_at":"2024-05-03T00:00:29.528Z","created_at":"2024-05-02T23:50:29.479Z","updated_at":"2024-05-02T23:50:29.479Z"}'
78
+ http_version:
79
+ recorded_at: Thu, 02 May 2024 23:53:49 GMT
80
+ recorded_with: VCR 5.0.0
@@ -77,7 +77,7 @@ http_interactions:
77
77
  ma=86400
78
78
  body:
79
79
  encoding: ASCII-8BIT
80
- string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test2@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
80
+ string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test2@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
81
81
  http_version:
82
82
  recorded_at: Mon, 09 Aug 2021 22:01:16 GMT
83
83
  recorded_with: VCR 5.0.0
@@ -77,7 +77,7 @@ http_interactions:
77
77
  ma=86400
78
78
  body:
79
79
  encoding: ASCII-8BIT
80
- string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test3@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
80
+ string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test3@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
81
81
  http_version:
82
82
  recorded_at: Mon, 09 Aug 2021 22:01:16 GMT
83
83
  recorded_with: VCR 5.0.0
@@ -77,7 +77,7 @@ http_interactions:
77
77
  ma=86400
78
78
  body:
79
79
  encoding: ASCII-8BIT
80
- string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test2@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
80
+ string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test2@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
81
81
  http_version:
82
82
  recorded_at: Mon, 09 Aug 2021 22:01:15 GMT
83
83
  recorded_with: VCR 5.0.0
@@ -77,7 +77,7 @@ http_interactions:
77
77
  ma=86400
78
78
  body:
79
79
  encoding: ASCII-8BIT
80
- string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_02H5JQDV7R7ATEYZDEG0W5PRYS","email":"john@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_02H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_03H5JQDV7R7ATEYZDEG0W5PRYS","email":"jane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_03H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_04H5JQDV7R7ATEYZDEG0W5PRYS","email":"emma@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_04H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_05H5JQDV7R7ATEYZDEG0W5PRYS","email":"alex@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_05H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before_id","after":null}}'
80
+ string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_02H5JQDV7R7ATEYZDEG0W5PRYS","email":"john@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_02H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_03H5JQDV7R7ATEYZDEG0W5PRYS","email":"jane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_03H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_04H5JQDV7R7ATEYZDEG0W5PRYS","email":"emma@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_04H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_05H5JQDV7R7ATEYZDEG0W5PRYS","email":"alex@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_05H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before_id","after":null}}'
81
81
  http_version:
82
82
  recorded_at: Mon, 09 Aug 2021 22:01:14 GMT
83
83
  recorded_with: VCR 5.0.0
@@ -77,7 +77,7 @@ http_interactions:
77
77
  ma=86400
78
78
  body:
79
79
  encoding: ASCII-8BIT
80
- string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
80
+ string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}'
81
81
  http_version:
82
82
  recorded_at: Mon, 09 Aug 2021 22:01:15 GMT
83
83
  recorded_with: VCR 5.0.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.workos.com/user_management/organization_memberships?limit=5&order=desc&statuses=inactive&user_id=user_01HXYSZBKQE2N3NHBKZHDP1X5X
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.3.0; arm64-darwin23; v4.5.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Wed, 15 May 2024 19:14:44 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Strict-Transport-Security:
34
+ - max-age=15552000; includeSubDomains
35
+ Vary:
36
+ - Origin, Accept-Encoding
37
+ Access-Control-Allow-Credentials:
38
+ - "true"
39
+ Content-Security-Policy:
40
+ - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self'
41
+ https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src
42
+ 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"
43
+ Expect-Ct:
44
+ - max-age=0
45
+ Referrer-Policy:
46
+ - no-referrer
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ X-Dns-Prefetch-Control:
50
+ - "off"
51
+ X-Download-Options:
52
+ - noopen
53
+ X-Frame-Options:
54
+ - SAMEORIGIN
55
+ X-Permitted-Cross-Domain-Policies:
56
+ - none
57
+ X-Xss-Protection:
58
+ - "0"
59
+ body:
60
+ encoding: ASCII-8BIT
61
+ string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01HXYT0G3H5QG9YTSHSHFZQE6D","organization_id":"org_01HRCVHACPY05V2FP0KEBQZYD3","user_id":"user_01HXYSZBKQE2N3NHBKZHDP1X5X","status":"active","role":{"slug":"member"},"created_at":"2024-05-15T19:00:05.359Z","updated_at":"2024-05-15T19:13:06.427Z"}],"list_metadata":{"before":null,"after":null}}'
62
+ http_version:
63
+ recorded_at: Wed, 15 May 2024 19:14:44 GMT
64
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://api.workos.com/user_management/organization_memberships/om_01HXYT0G3H5QG9YTSHSHFZQE6D/reactivate
6
+ body:
7
+ encoding: UTF-8
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.3.0; arm64-darwin23; v4.5.0
18
+ Authorization:
19
+ - Bearer <API_KEY>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Wed, 15 May 2024 19:13:06 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Strict-Transport-Security:
34
+ - max-age=15552000; includeSubDomains
35
+ Vary:
36
+ - Origin, Accept-Encoding
37
+ Access-Control-Allow-Credentials:
38
+ - "true"
39
+ Content-Security-Policy:
40
+ - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self'
41
+ https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src
42
+ 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"
43
+ Expect-Ct:
44
+ - max-age=0
45
+ Referrer-Policy:
46
+ - no-referrer
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ X-Dns-Prefetch-Control:
50
+ - "off"
51
+ X-Download-Options:
52
+ - noopen
53
+ X-Frame-Options:
54
+ - SAMEORIGIN
55
+ X-Permitted-Cross-Domain-Policies:
56
+ - none
57
+ X-Xss-Protection:
58
+ - "0"
59
+ body:
60
+ encoding: ASCII-8BIT
61
+ string: '{"object":"organization_membership","id":"om_01HXYT0G3H5QG9YTSHSHFZQE6D","organization_id":"org_01HRCVHACPY05V2FP0KEBQZYD3","user_id":"user_01HXYSZBKQE2N3NHBKZHDP1X5X","status":"active","role":{"slug":"member"},"created_at":"2024-05-15T19:00:05.359Z","updated_at":"2024-05-15T19:13:06.427Z"}'
62
+ http_version:
63
+ recorded_at: Wed, 15 May 2024 19:13:06 GMT
64
+ recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: UTF-8
79
- string: '{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
79
+ string: '{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
80
80
  http_version:
81
81
  recorded_at: Thu, 31 Aug 2023 16:41:46 GMT
82
82
  recorded_with: VCR 5.0.0
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: UTF-8
79
- string: '{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
79
+ string: '{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","accept_invitation_url":"https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
80
80
  http_version:
81
81
  recorded_at: Tue, 22 Aug 2023 15:17:54 GMT
82
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: 4.4.0
4
+ version: 4.6.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-01 00:00:00.000000000 Z
11
+ date: 2024-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -125,6 +125,7 @@ files:
125
125
  - lib/workos/hash_provider.rb
126
126
  - lib/workos/impersonator.rb
127
127
  - lib/workos/invitation.rb
128
+ - lib/workos/magic_auth.rb
128
129
  - lib/workos/mfa.rb
129
130
  - lib/workos/organization.rb
130
131
  - lib/workos/organization_membership.rb
@@ -268,10 +269,12 @@ files:
268
269
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml
269
270
  - spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/invalid.yml
270
271
  - spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/valid.yml
272
+ - spec/support/fixtures/vcr_cassettes/user_management/create_magic_auth/valid.yml
271
273
  - spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/invalid.yml
272
274
  - spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml
273
275
  - spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml
274
276
  - spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml
277
+ - spec/support/fixtures/vcr_cassettes/user_management/deactivate_organization_membership.yml
275
278
  - spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/invalid.yml
276
279
  - spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/valid.yml
277
280
  - spec/support/fixtures/vcr_cassettes/user_management/delete_user/invalid.yml
@@ -280,6 +283,8 @@ files:
280
283
  - spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/valid.yml
281
284
  - spec/support/fixtures/vcr_cassettes/user_management/get_invitation/invalid.yml
282
285
  - spec/support/fixtures/vcr_cassettes/user_management/get_invitation/valid.yml
286
+ - spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/invalid.yml
287
+ - spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/valid.yml
283
288
  - spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml
284
289
  - spec/support/fixtures/vcr_cassettes/user_management/get_user.yml
285
290
  - spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/invalid.yml
@@ -291,8 +296,10 @@ files:
291
296
  - spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_organization_id.yml
292
297
  - spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/no_options.yml
293
298
  - spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_options.yml
299
+ - spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_statuses_option.yml
294
300
  - spec/support/fixtures/vcr_cassettes/user_management/list_users/no_options.yml
295
301
  - spec/support/fixtures/vcr_cassettes/user_management/list_users/with_options.yml
302
+ - spec/support/fixtures/vcr_cassettes/user_management/reactivate_organization_membership.yml
296
303
  - spec/support/fixtures/vcr_cassettes/user_management/reset_password/invalid.yml
297
304
  - spec/support/fixtures/vcr_cassettes/user_management/reset_password/valid.yml
298
305
  - spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/invalid.yml
@@ -462,10 +469,12 @@ test_files:
462
469
  - spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml
463
470
  - spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/invalid.yml
464
471
  - spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/valid.yml
472
+ - spec/support/fixtures/vcr_cassettes/user_management/create_magic_auth/valid.yml
465
473
  - spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/invalid.yml
466
474
  - spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml
467
475
  - spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml
468
476
  - spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml
477
+ - spec/support/fixtures/vcr_cassettes/user_management/deactivate_organization_membership.yml
469
478
  - spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/invalid.yml
470
479
  - spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/valid.yml
471
480
  - spec/support/fixtures/vcr_cassettes/user_management/delete_user/invalid.yml
@@ -474,6 +483,8 @@ test_files:
474
483
  - spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/valid.yml
475
484
  - spec/support/fixtures/vcr_cassettes/user_management/get_invitation/invalid.yml
476
485
  - spec/support/fixtures/vcr_cassettes/user_management/get_invitation/valid.yml
486
+ - spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/invalid.yml
487
+ - spec/support/fixtures/vcr_cassettes/user_management/get_magic_auth/valid.yml
477
488
  - spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml
478
489
  - spec/support/fixtures/vcr_cassettes/user_management/get_user.yml
479
490
  - spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/invalid.yml
@@ -485,8 +496,10 @@ test_files:
485
496
  - spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_organization_id.yml
486
497
  - spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/no_options.yml
487
498
  - spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_options.yml
499
+ - spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_statuses_option.yml
488
500
  - spec/support/fixtures/vcr_cassettes/user_management/list_users/no_options.yml
489
501
  - spec/support/fixtures/vcr_cassettes/user_management/list_users/with_options.yml
502
+ - spec/support/fixtures/vcr_cassettes/user_management/reactivate_organization_membership.yml
490
503
  - spec/support/fixtures/vcr_cassettes/user_management/reset_password/invalid.yml
491
504
  - spec/support/fixtures/vcr_cassettes/user_management/reset_password/valid.yml
492
505
  - spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/invalid.yml