workos 5.2.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d353d6eb40443ec91c1b121bef107dc2ff2cf075bf9bf0bda21785992954e193
4
- data.tar.gz: 5b24c924e1b10ec2f1b09e2ee267d6e12654912c1dc93dbaa1e407b6d56cae3b
3
+ metadata.gz: 4e386ae2dd110ea57c1a5c8d15c09c68263dedbee77c6ffa015b84a952d88920
4
+ data.tar.gz: e5001300c2da182fd3a230e66c7ced29ef937c8f0774cbd51d1f4e8bc9b8ee45
5
5
  SHA512:
6
- metadata.gz: 8b9c7b2640f55ba71fc4907e2cb2a04d48564cb0a1bf5320cfdcaf822ff6aaf1e2a2fa09610036f9852ee06a86e4fed953e4f1bb4203ee728153a2c20cbc6aa9
7
- data.tar.gz: 658e867cdfd96575e748f03c05a25d62773393e47b7c980a20af8a63e4d318bd456e4d371f23bce663436ff0d0c2fe7cc0125b83a807c5c87370dd915805ed18
6
+ metadata.gz: d7882eb8eaef394157785a2592bcb616fa2bd4a7b9015b0b8b37c203ea70ccf43b72c5eb10bbde9155938154d9fc3a2ab5f1e630330efd2eeb53f2672bea65fe
7
+ data.tar.gz: 0fb86220b0b5fe4dbbcdaa24b35586348d961a40c1628b5eebf44926e7c0a0350ea538b3dcc9610e073c654c65ab5f7d9ada0edb4196bc93b8d9994a3739c7f2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (5.2.0)
4
+ workos (5.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/workos/sso.rb CHANGED
@@ -28,8 +28,8 @@ module WorkOS
28
28
  # connection, or organization is required.
29
29
  # The domain is deprecated.
30
30
  # @param [String] provider A provider name for an Identity Provider
31
- # configured on your WorkOS dashboard. Only 'GoogleOAuth' and
32
- # 'MicrosoftOAuth' are supported.
31
+ # configured on your WorkOS dashboard. Only 'AppleOAuth', 'GitHubOAuth',
32
+ # 'GoogleOAuth', and 'MicrosoftOAuth' are supported.
33
33
  # @param [String] connection The ID for a Connection configured on
34
34
  # WorkOS.
35
35
  # @param [String] organization The ID for an Organization configured
@@ -5,6 +5,7 @@ module WorkOS
5
5
  # The Provider constants are declarations of a
6
6
  # fixed set of values for SSO Providers.
7
7
  module Provider
8
+ Apple = 'AppleOAuth'
8
9
  GitHub = 'GitHubOAuth'
9
10
  Google = 'GoogleOAuth'
10
11
  Microsoft = 'MicrosoftOAuth'
@@ -13,6 +13,7 @@ module WorkOS
13
13
  # The ProviderEnum is a declaration of a
14
14
  # fixed set of values for User Management Providers.
15
15
  class Provider
16
+ Apple = 'AppleOAuth'
16
17
  GitHub = 'GitHubOAuth'
17
18
  Google = 'GoogleOAuth'
18
19
  Microsoft = 'MicrosoftOAuth'
@@ -44,7 +45,8 @@ module WorkOS
44
45
  # configured redirect URI on your WorkOS dashboard.
45
46
  # @param [String] client_id This value can be obtained from the API Keys page in the WorkOS dashboard.
46
47
  # @param [String] provider A provider name is used to initiate SSO using an
47
- # OAuth-compatible provider. Only 'authkit ,'GoogleOAuth' and 'MicrosoftOAuth' are supported.
48
+ # OAuth-compatible provider. Only 'authkit', 'AppleOAuth', 'GitHubOAuth', 'GoogleOAuth',
49
+ # and 'MicrosoftOAuth' are supported.
48
50
  # @param [String] connection_id The ID for a Connection configured on
49
51
  # WorkOS.
50
52
  # @param [String] organization_id The organization_id selector is used to
@@ -866,11 +868,11 @@ module WorkOS
866
868
  # @param [String] role_slug The slug of the role to grant to this membership.
867
869
  #
868
870
  # @return [WorkOS::OrganizationMembership]
869
- def update_organization_membership(organization_membership_id:, role_slug:)
871
+ def update_organization_membership(id:, role_slug:)
870
872
  request = put_request(
871
873
  path: "/user_management/organization_memberships/#{id}",
872
874
  body: {
873
- organization_membership_id: organization_membership_id,
875
+ id: id,
874
876
  role_slug: role_slug,
875
877
  },
876
878
  auth: true,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorkOS
4
- VERSION = '5.2.0'
4
+ VERSION = '5.3.0'
5
5
  end
@@ -1074,6 +1074,33 @@ describe WorkOS::UserManagement do
1074
1074
  end
1075
1075
  end
1076
1076
 
1077
+ describe '.update_organization_membership' do
1078
+ context 'with a valid id' do
1079
+ it 'returns true' do
1080
+ VCR.use_cassette('user_management/update_organization_membership/valid') do
1081
+ organization_membership = WorkOS::UserManagement.update_organization_membership(
1082
+ id: 'om_01H5JQDV7R7ATEYZDEG0W5PRYS',
1083
+ role_slug: 'admin',
1084
+ )
1085
+
1086
+ expect(organization_membership.organization_id).to eq('organization_01H5JQDV7R7ATEYZDEG0W5PRYS')
1087
+ expect(organization_membership.user_id).to eq('user_01H5JQDV7R7ATEYZDEG0W5PRYS')
1088
+ expect(organization_membership.role).to eq({ slug: 'admin' })
1089
+ end
1090
+ end
1091
+ end
1092
+
1093
+ context 'with an invalid id' do
1094
+ it 'raises an error' do
1095
+ VCR.use_cassette('user_management/update_organization_membership/invalid') do
1096
+ expect do
1097
+ WorkOS::UserManagement.update_organization_membership(id: 'invalid', role_slug: 'admin')
1098
+ end.to raise_error(WorkOS::NotFoundError, /Organization Membership not found/)
1099
+ end
1100
+ end
1101
+ end
1102
+ end
1103
+
1077
1104
  describe '.delete_organization_membership' do
1078
1105
  context 'with a valid id' do
1079
1106
  it 'returns true' do
@@ -0,0 +1,82 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://api.workos.com/user_management/organization_memberships/invalid
6
+ body:
7
+ encoding: US-ASCII
8
+ string: '{"id":"invalid","role_slug":"admin"}'
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: 404
23
+ message: Not Found
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
+ Cf-Ray:
34
+ - 7fc6fbe4ef26ec80-SEA
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"58-5GtYccQgavNavjEU+gaKkOl1gq4"
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
+ - f3bf3ce2-ed1c-4fdf-9bba-065c2ab4e5e3
67
+ X-Xss-Protection:
68
+ - '0'
69
+ Set-Cookie:
70
+ - __cf_bm=VyJvcfBZAdCVUhGKRtHsl9enJXaR64T8urur5ClUQWY-1692999527-0-AahBwhyZ59RlA2LkZ5bsanqtnkJWCPSngTzr7vokapEBcsZzjppDl90U6KcM3t3w2iZ0p7uHvZZ5zI0G74Wlmg4=;
71
+ path=/; expires=Fri, 25-Aug-23 22:08:47 GMT; domain=.workos.com; HttpOnly;
72
+ Secure; SameSite=None
73
+ - __cfruid=1a7b02324f49135ba91ab0fc79714ad620549ae5-1692999527; path=/; domain=.workos.com;
74
+ HttpOnly; Secure; SameSite=None
75
+ Server:
76
+ - cloudflare
77
+ body:
78
+ encoding: ASCII-8BIT
79
+ string: '{"message":"Organization Membership not found: ''invalid''.","code":"entity_not_found","entity_id":"invalid"}'
80
+ http_version:
81
+ recorded_at: Wed, 15 May 2024 19:13:06 GMT
82
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,83 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://api.workos.com/user_management/organization_memberships/om_01H5JQDV7R7ATEYZDEG0W5PRYS
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","role_slug":"admin"}'
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-darwin22; v2.16.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
+ Content-Length:
30
+ - '335'
31
+ Connection:
32
+ - keep-alive
33
+ Cf-Ray:
34
+ - 7f828e50ac5dc41d-EWR
35
+ Cf-Cache-Status:
36
+ - DYNAMIC
37
+ Etag:
38
+ - W/"14f-2n2KgFcHBXf1Yz7SYqzpAxR3E/E"
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
+ - 8d277b87-b703-40d2-95ac-5f40bf96fcbf
67
+ X-Xss-Protection:
68
+ - '0'
69
+ Set-Cookie:
70
+ - __cf_bm=Pd2y8tPXDzQthhv7HAd93AsNAjT9V0tbWdH6PzS_iyA-1692282007-0-AUsV9W08vMNk02vMMYwMWj3KVIAJtXMGZdhGaWVL9yL3e4S5D1cGL2925nELffPsxoejtsVqyeqdvIixzD7UnL8=;
71
+ path=/; expires=Thu, 17-Aug-23 14:50:07 GMT; domain=.workos.com; HttpOnly;
72
+ Secure; SameSite=None
73
+ - __cfruid=432b4f1724bbd993a76e1e2e8c4d5e2381680fb1-1692282007; path=/; domain=.workos.com;
74
+ HttpOnly; Secure; SameSite=None
75
+ Server:
76
+ - cloudflare
77
+ body:
78
+ encoding: UTF-8
79
+ string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"admin"},"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
80
+ http_version:
81
+ recorded_at: Wed, 15 May 2024 19:13:06 GMT
82
+ recorded_with: VCR 5.0.0
83
+
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.2.0
4
+ version: 5.3.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-06-24 00:00:00.000000000 Z
11
+ date: 2024-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -323,6 +323,8 @@ files:
323
323
  - spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/valid.yml
324
324
  - spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/invalid.yml
325
325
  - spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/valid.yml
326
+ - spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/invalid.yml
327
+ - spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid.yml
326
328
  - spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml
327
329
  - spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml
328
330
  - spec/support/fixtures/vcr_cassettes/user_management/update_user_password/invalid.yml
@@ -531,6 +533,8 @@ test_files:
531
533
  - spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/valid.yml
532
534
  - spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/invalid.yml
533
535
  - spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/valid.yml
536
+ - spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/invalid.yml
537
+ - spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid.yml
534
538
  - spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml
535
539
  - spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml
536
540
  - spec/support/fixtures/vcr_cassettes/user_management/update_user_password/invalid.yml