workos 5.24.0 → 5.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/lib/workos/feature_flag.rb +34 -0
- data/lib/workos/organization_membership.rb +3 -1
- data/lib/workos/organizations.rb +40 -0
- data/lib/workos/session.rb +2 -1
- data/lib/workos/types/widget_scope.rb +3 -1
- data/lib/workos/user_management.rb +25 -13
- data/lib/workos/version.rb +1 -1
- data/lib/workos.rb +1 -0
- data/spec/lib/workos/organizations_spec.rb +116 -0
- data/spec/lib/workos/session_spec.rb +6 -0
- data/spec/lib/workos/user_management_spec.rb +33 -0
- data/spec/support/fixtures/vcr_cassettes/organization/list_organization_feature_flags.yml +78 -0
- data/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid_multiple_roles.yml +76 -0
- data/spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid_multiple_roles.yml +76 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70fb176f7fd3b899bb8c88f2123536778e2a026d97582de2e1beb9525b2bec5b
|
4
|
+
data.tar.gz: 164650f3cdbe0181b9d249c69fc6bab6713f41bef3e419dbb8ce765211123068
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd3a1e2254870e8d34ace357916f6a8287fefdfb0c89e9e82ed679e02460caad0f457a2a60c56fa19afefc9d74a92427603efc12c4a181c13fe27bf4b4babc27
|
7
|
+
data.tar.gz: 89e8b4854838de9fc893c16380df4d0b75ef0fb68659b25cbca140310c4cc7dd00e371183c432d60d978548059a941a8410a2e143cefed6011b95be219f84d43
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module WorkOS
|
4
|
+
# The FeatureFlag class provides a lightweight wrapper around
|
5
|
+
# a WorkOS Feature Flag resource. This class is not meant to be instantiated
|
6
|
+
# in user space, and is instantiated internally but exposed.
|
7
|
+
class FeatureFlag
|
8
|
+
include HashProvider
|
9
|
+
|
10
|
+
attr_accessor :id, :name, :slug, :description, :created_at, :updated_at
|
11
|
+
|
12
|
+
def initialize(json)
|
13
|
+
hash = JSON.parse(json, symbolize_names: true)
|
14
|
+
|
15
|
+
@id = hash[:id]
|
16
|
+
@name = hash[:name]
|
17
|
+
@slug = hash[:slug]
|
18
|
+
@description = hash[:description]
|
19
|
+
@created_at = hash[:created_at]
|
20
|
+
@updated_at = hash[:updated_at]
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_json(*)
|
24
|
+
{
|
25
|
+
id: id,
|
26
|
+
name: name,
|
27
|
+
slug: slug,
|
28
|
+
description: description,
|
29
|
+
created_at: created_at,
|
30
|
+
updated_at: updated_at,
|
31
|
+
}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -7,7 +7,7 @@ module WorkOS
|
|
7
7
|
class OrganizationMembership
|
8
8
|
include HashProvider
|
9
9
|
|
10
|
-
attr_accessor :id, :user_id, :organization_id, :status, :role, :created_at, :updated_at
|
10
|
+
attr_accessor :id, :user_id, :organization_id, :status, :role, :roles, :created_at, :updated_at
|
11
11
|
|
12
12
|
def initialize(json)
|
13
13
|
hash = JSON.parse(json, symbolize_names: true)
|
@@ -17,6 +17,7 @@ module WorkOS
|
|
17
17
|
@organization_id = hash[:organization_id]
|
18
18
|
@status = hash[:status]
|
19
19
|
@role = hash[:role]
|
20
|
+
@roles = hash[:roles]
|
20
21
|
@created_at = hash[:created_at]
|
21
22
|
@updated_at = hash[:updated_at]
|
22
23
|
end
|
@@ -28,6 +29,7 @@ module WorkOS
|
|
28
29
|
organization_id: organization_id,
|
29
30
|
status: status,
|
30
31
|
role: role,
|
32
|
+
roles: roles,
|
31
33
|
created_at: created_at,
|
32
34
|
updated_at: updated_at,
|
33
35
|
}
|
data/lib/workos/organizations.rb
CHANGED
@@ -224,6 +224,46 @@ module WorkOS
|
|
224
224
|
)
|
225
225
|
end
|
226
226
|
|
227
|
+
# Retrieve a list of feature flags for the given organization.
|
228
|
+
#
|
229
|
+
# @param [String] organization_id The ID of the organization to fetch feature flags for.
|
230
|
+
# @param [Hash] options
|
231
|
+
# @option options [String] before A pagination argument used to request
|
232
|
+
# feature flags before the provided FeatureFlag ID.
|
233
|
+
# @option options [String] after A pagination argument used to request
|
234
|
+
# feature flags after the provided FeatureFlag ID.
|
235
|
+
# @option options [Integer] limit A pagination argument used to limit the number
|
236
|
+
# of listed FeatureFlags that are returned.
|
237
|
+
# @option options [String] order The order in which to paginate records
|
238
|
+
#
|
239
|
+
# @example
|
240
|
+
# WorkOS::Organizations.list_organization_feature_flags(organization_id: 'org_01EHZNVPK3SFK441A1RGBFSHRT')
|
241
|
+
# => #<WorkOS::Types::ListStruct data=[#<WorkOS::FeatureFlag id="flag_123" slug="new-feature"
|
242
|
+
# enabled=true ...>] ...>
|
243
|
+
#
|
244
|
+
# @return [WorkOS::Types::ListStruct] - Collection of FeatureFlag objects
|
245
|
+
def list_organization_feature_flags(organization_id:, options: {})
|
246
|
+
options[:order] ||= 'desc'
|
247
|
+
response = execute_request(
|
248
|
+
request: get_request(
|
249
|
+
path: "/organizations/#{organization_id}/feature-flags",
|
250
|
+
auth: true,
|
251
|
+
params: options,
|
252
|
+
),
|
253
|
+
)
|
254
|
+
|
255
|
+
parsed_response = JSON.parse(response.body)
|
256
|
+
|
257
|
+
feature_flags = parsed_response['data'].map do |feature_flag|
|
258
|
+
WorkOS::FeatureFlag.new(feature_flag.to_json)
|
259
|
+
end
|
260
|
+
|
261
|
+
WorkOS::Types::ListStruct.new(
|
262
|
+
data: feature_flags,
|
263
|
+
list_metadata: parsed_response['list_metadata']&.transform_keys(&:to_sym),
|
264
|
+
)
|
265
|
+
end
|
266
|
+
|
227
267
|
private
|
228
268
|
|
229
269
|
def check_and_raise_organization_error(response:)
|
data/lib/workos/session.rb
CHANGED
@@ -30,6 +30,7 @@ module WorkOS
|
|
30
30
|
|
31
31
|
# Authenticates the user based on the session data
|
32
32
|
# @return [Hash] A hash containing the authentication response and a reason if the authentication failed
|
33
|
+
# rubocop:disable Metrics/AbcSize
|
33
34
|
def authenticate
|
34
35
|
return { authenticated: false, reason: 'NO_SESSION_COOKIE_PROVIDED' } if @session_data.nil?
|
35
36
|
|
@@ -49,6 +50,7 @@ module WorkOS
|
|
49
50
|
session_id: decoded['sid'],
|
50
51
|
organization_id: decoded['org_id'],
|
51
52
|
role: decoded['role'],
|
53
|
+
roles: decoded['roles'],
|
52
54
|
permissions: decoded['permissions'],
|
53
55
|
entitlements: decoded['entitlements'],
|
54
56
|
feature_flags: decoded['feature_flags'],
|
@@ -64,7 +66,6 @@ module WorkOS
|
|
64
66
|
# @option options [String] :organization_id The organization ID to use for refreshing the session
|
65
67
|
# @return [Hash] A hash containing a new sealed session, the authentication response,
|
66
68
|
# and a reason if the refresh failed
|
67
|
-
# rubocop:disable Metrics/AbcSize
|
68
69
|
# rubocop:disable Metrics/PerceivedComplexity
|
69
70
|
def refresh(options = nil)
|
70
71
|
cookie_password = options.nil? || options[:cookie_password].nil? ? @cookie_password : options[:cookie_password]
|
@@ -6,8 +6,10 @@ module WorkOS
|
|
6
6
|
# scopes while generating a widget token.
|
7
7
|
module WidgetScope
|
8
8
|
USERS_TABLE_MANAGE = 'widgets:users-table:manage'
|
9
|
+
SSO_MANAGE = 'widgets:sso:manage'
|
10
|
+
DOMAIN_VERIFICATION_MANAGE = 'widgets:domain-verification:manage'
|
9
11
|
|
10
|
-
ALL = [USERS_TABLE_MANAGE].freeze
|
12
|
+
ALL = [USERS_TABLE_MANAGE, SSO_MANAGE, DOMAIN_VERIFICATION_MANAGE].freeze
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
@@ -926,16 +926,23 @@ module WorkOS
|
|
926
926
|
# @param [String] user_id The ID of the User.
|
927
927
|
# @param [String] organization_id The ID of the Organization to which the user belongs to.
|
928
928
|
# @param [String] role_slug The slug of the role to grant to this membership. (Optional)
|
929
|
+
# @param [Array<String>] role_slugs Array of role slugs to assign to this membership. (Optional)
|
929
930
|
#
|
930
931
|
# @return [WorkOS::OrganizationMembership]
|
931
|
-
def create_organization_membership(user_id:, organization_id:, role_slug: nil)
|
932
|
+
def create_organization_membership(user_id:, organization_id:, role_slug: nil, role_slugs: nil)
|
933
|
+
raise ArgumentError, 'Cannot specify both role_slug and role_slugs' if role_slug && role_slugs
|
934
|
+
|
935
|
+
body = {
|
936
|
+
user_id: user_id,
|
937
|
+
organization_id: organization_id,
|
938
|
+
}
|
939
|
+
|
940
|
+
body[:role_slugs] = role_slugs if role_slugs
|
941
|
+
body[:role_slug] = role_slug if role_slug
|
942
|
+
|
932
943
|
request = post_request(
|
933
944
|
path: '/user_management/organization_memberships',
|
934
|
-
body:
|
935
|
-
user_id: user_id,
|
936
|
-
organization_id: organization_id,
|
937
|
-
role_slug: role_slug,
|
938
|
-
}.compact,
|
945
|
+
body: body.compact,
|
939
946
|
auth: true,
|
940
947
|
)
|
941
948
|
|
@@ -946,17 +953,22 @@ module WorkOS
|
|
946
953
|
|
947
954
|
# Update an Organization Membership
|
948
955
|
#
|
949
|
-
# @param [String]
|
950
|
-
# @param [String] role_slug The slug of the role to grant to this membership.
|
956
|
+
# @param [String] id The ID of the Organization Membership.
|
957
|
+
# @param [String] role_slug The slug of the role to grant to this membership. (Optional)
|
958
|
+
# @param [Array<String>] role_slugs Array of role slugs to assign to this membership. (Optional)
|
951
959
|
#
|
952
960
|
# @return [WorkOS::OrganizationMembership]
|
953
|
-
def update_organization_membership(id:, role_slug:)
|
961
|
+
def update_organization_membership(id:, role_slug: nil, role_slugs: nil)
|
962
|
+
raise ArgumentError, 'Cannot specify both role_slug and role_slugs' if role_slug && role_slugs
|
963
|
+
|
964
|
+
body = { id: id }
|
965
|
+
|
966
|
+
body[:role_slugs] = role_slugs if role_slugs
|
967
|
+
body[:role_slug] = role_slug if role_slug
|
968
|
+
|
954
969
|
request = put_request(
|
955
970
|
path: "/user_management/organization_memberships/#{id}",
|
956
|
-
body:
|
957
|
-
id: id,
|
958
|
-
role_slug: role_slug,
|
959
|
-
},
|
971
|
+
body: body.compact,
|
960
972
|
auth: true,
|
961
973
|
)
|
962
974
|
|
data/lib/workos/version.rb
CHANGED
data/lib/workos.rb
CHANGED
@@ -59,6 +59,7 @@ module WorkOS
|
|
59
59
|
autoload :Event, 'workos/event'
|
60
60
|
autoload :Events, 'workos/events'
|
61
61
|
autoload :Factor, 'workos/factor'
|
62
|
+
autoload :FeatureFlag, 'workos/feature_flag'
|
62
63
|
autoload :Impersonator, 'workos/impersonator'
|
63
64
|
autoload :Invitation, 'workos/invitation'
|
64
65
|
autoload :MagicAuth, 'workos/magic_auth'
|
@@ -450,4 +450,120 @@ describe WorkOS::Organizations do
|
|
450
450
|
end
|
451
451
|
end
|
452
452
|
end
|
453
|
+
|
454
|
+
describe '.list_organization_feature_flags' do
|
455
|
+
context 'with no options' do
|
456
|
+
it 'returns feature flags for organization' do
|
457
|
+
expected_metadata = {
|
458
|
+
after: nil,
|
459
|
+
before: nil,
|
460
|
+
}
|
461
|
+
|
462
|
+
VCR.use_cassette 'organization/list_organization_feature_flags' do
|
463
|
+
feature_flags = described_class.list_organization_feature_flags(
|
464
|
+
organization_id: 'org_01HX7Q7R12H1JMAKN75SH2G529',
|
465
|
+
)
|
466
|
+
|
467
|
+
expect(feature_flags.data.size).to eq(2)
|
468
|
+
expect(feature_flags.list_metadata).to eq(expected_metadata)
|
469
|
+
end
|
470
|
+
end
|
471
|
+
end
|
472
|
+
|
473
|
+
context 'with the before option' do
|
474
|
+
it 'forms the proper request to the API' do
|
475
|
+
request_args = [
|
476
|
+
'/organizations/org_01HX7Q7R12H1JMAKN75SH2G529/feature-flags?before=before-id&'\
|
477
|
+
'order=desc',
|
478
|
+
'Content-Type' => 'application/json'
|
479
|
+
]
|
480
|
+
|
481
|
+
expected_request = Net::HTTP::Get.new(*request_args)
|
482
|
+
|
483
|
+
expect(Net::HTTP::Get).to receive(:new).with(*request_args).
|
484
|
+
and_return(expected_request)
|
485
|
+
|
486
|
+
VCR.use_cassette 'organization/list_organization_feature_flags', match_requests_on: [:path] do
|
487
|
+
feature_flags = described_class.list_organization_feature_flags(
|
488
|
+
organization_id: 'org_01HX7Q7R12H1JMAKN75SH2G529',
|
489
|
+
options: { before: 'before-id' },
|
490
|
+
)
|
491
|
+
|
492
|
+
expect(feature_flags.data.size).to eq(2)
|
493
|
+
end
|
494
|
+
end
|
495
|
+
end
|
496
|
+
|
497
|
+
context 'with the after option' do
|
498
|
+
it 'forms the proper request to the API' do
|
499
|
+
request_args = [
|
500
|
+
'/organizations/org_01HX7Q7R12H1JMAKN75SH2G529/feature-flags?after=after-id&'\
|
501
|
+
'order=desc',
|
502
|
+
'Content-Type' => 'application/json'
|
503
|
+
]
|
504
|
+
|
505
|
+
expected_request = Net::HTTP::Get.new(*request_args)
|
506
|
+
|
507
|
+
expect(Net::HTTP::Get).to receive(:new).with(*request_args).
|
508
|
+
and_return(expected_request)
|
509
|
+
|
510
|
+
VCR.use_cassette 'organization/list_organization_feature_flags', match_requests_on: [:path] do
|
511
|
+
feature_flags = described_class.list_organization_feature_flags(
|
512
|
+
organization_id: 'org_01HX7Q7R12H1JMAKN75SH2G529',
|
513
|
+
options: { after: 'after-id' },
|
514
|
+
)
|
515
|
+
|
516
|
+
expect(feature_flags.data.size).to eq(2)
|
517
|
+
end
|
518
|
+
end
|
519
|
+
end
|
520
|
+
|
521
|
+
context 'with the limit option' do
|
522
|
+
it 'forms the proper request to the API' do
|
523
|
+
request_args = [
|
524
|
+
'/organizations/org_01HX7Q7R12H1JMAKN75SH2G529/feature-flags?limit=10&'\
|
525
|
+
'order=desc',
|
526
|
+
'Content-Type' => 'application/json'
|
527
|
+
]
|
528
|
+
|
529
|
+
expected_request = Net::HTTP::Get.new(*request_args)
|
530
|
+
|
531
|
+
expect(Net::HTTP::Get).to receive(:new).with(*request_args).
|
532
|
+
and_return(expected_request)
|
533
|
+
|
534
|
+
VCR.use_cassette 'organization/list_organization_feature_flags', match_requests_on: [:path] do
|
535
|
+
feature_flags = described_class.list_organization_feature_flags(
|
536
|
+
organization_id: 'org_01HX7Q7R12H1JMAKN75SH2G529',
|
537
|
+
options: { limit: 10 },
|
538
|
+
)
|
539
|
+
|
540
|
+
expect(feature_flags.data.size).to eq(2)
|
541
|
+
end
|
542
|
+
end
|
543
|
+
end
|
544
|
+
|
545
|
+
context 'with multiple pagination options' do
|
546
|
+
it 'forms the proper request to the API' do
|
547
|
+
request_args = [
|
548
|
+
'/organizations/org_01HX7Q7R12H1JMAKN75SH2G529/feature-flags?after=after-id&'\
|
549
|
+
'limit=5&order=asc',
|
550
|
+
'Content-Type' => 'application/json'
|
551
|
+
]
|
552
|
+
|
553
|
+
expected_request = Net::HTTP::Get.new(*request_args)
|
554
|
+
|
555
|
+
expect(Net::HTTP::Get).to receive(:new).with(*request_args).
|
556
|
+
and_return(expected_request)
|
557
|
+
|
558
|
+
VCR.use_cassette 'organization/list_organization_feature_flags', match_requests_on: [:path] do
|
559
|
+
feature_flags = described_class.list_organization_feature_flags(
|
560
|
+
organization_id: 'org_01HX7Q7R12H1JMAKN75SH2G529',
|
561
|
+
options: { after: 'after-id', limit: 5, order: 'asc' },
|
562
|
+
)
|
563
|
+
|
564
|
+
expect(feature_flags.data.size).to eq(2)
|
565
|
+
end
|
566
|
+
end
|
567
|
+
end
|
568
|
+
end
|
453
569
|
end
|
@@ -108,6 +108,7 @@ describe WorkOS::Session do
|
|
108
108
|
sid: 'session_id',
|
109
109
|
org_id: 'org_id',
|
110
110
|
role: 'role',
|
111
|
+
roles: ['role'],
|
111
112
|
permissions: ['read'],
|
112
113
|
exp: Time.now.to_i + 3600,
|
113
114
|
}
|
@@ -173,6 +174,7 @@ describe WorkOS::Session do
|
|
173
174
|
session_id: 'session_id',
|
174
175
|
organization_id: 'org_id',
|
175
176
|
role: 'role',
|
177
|
+
roles: ['role'],
|
176
178
|
permissions: ['read'],
|
177
179
|
feature_flags: nil,
|
178
180
|
entitlements: nil,
|
@@ -188,6 +190,7 @@ describe WorkOS::Session do
|
|
188
190
|
sid: 'session_id',
|
189
191
|
org_id: 'org_id',
|
190
192
|
role: 'role',
|
193
|
+
roles: ['role'],
|
191
194
|
permissions: ['read'],
|
192
195
|
entitlements: ['billing'],
|
193
196
|
exp: Time.now.to_i + 3600,
|
@@ -208,6 +211,7 @@ describe WorkOS::Session do
|
|
208
211
|
session_id: 'session_id',
|
209
212
|
organization_id: 'org_id',
|
210
213
|
role: 'role',
|
214
|
+
roles: ['role'],
|
211
215
|
permissions: ['read'],
|
212
216
|
entitlements: ['billing'],
|
213
217
|
feature_flags: nil,
|
@@ -224,6 +228,7 @@ describe WorkOS::Session do
|
|
224
228
|
sid: 'session_id',
|
225
229
|
org_id: 'org_id',
|
226
230
|
role: 'role',
|
231
|
+
roles: ['role'],
|
227
232
|
permissions: ['read'],
|
228
233
|
feature_flags: ['new_feature_enabled'],
|
229
234
|
exp: Time.now.to_i + 3600,
|
@@ -244,6 +249,7 @@ describe WorkOS::Session do
|
|
244
249
|
session_id: 'session_id',
|
245
250
|
organization_id: 'org_id',
|
246
251
|
role: 'role',
|
252
|
+
roles: ['role'],
|
247
253
|
permissions: ['read'],
|
248
254
|
entitlements: nil,
|
249
255
|
feature_flags: ['new_feature_enabled'],
|
@@ -1302,6 +1302,23 @@ describe WorkOS::UserManagement do
|
|
1302
1302
|
end
|
1303
1303
|
end
|
1304
1304
|
end
|
1305
|
+
|
1306
|
+
context 'with role slugs' do
|
1307
|
+
it 'creates an organization membership with multiple roles' do
|
1308
|
+
VCR.use_cassette 'user_management/create_organization_membership/valid_multiple_roles' do
|
1309
|
+
organization_membership = described_class.create_organization_membership(
|
1310
|
+
user_id: 'user_01H5JQDV7R7ATEYZDEG0W5PRYS',
|
1311
|
+
organization_id: 'org_01H5JQDV7R7ATEYZDEG0W5PRYS',
|
1312
|
+
role_slugs: %w[admin member],
|
1313
|
+
)
|
1314
|
+
|
1315
|
+
expect(organization_membership.organization_id).to eq('organization_01H5JQDV7R7ATEYZDEG0W5PRYS')
|
1316
|
+
expect(organization_membership.user_id).to eq('user_01H5JQDV7R7ATEYZDEG0W5PRYS')
|
1317
|
+
expect(organization_membership.roles).to be_an(Array)
|
1318
|
+
expect(organization_membership.roles.length).to eq(2)
|
1319
|
+
end
|
1320
|
+
end
|
1321
|
+
end
|
1305
1322
|
end
|
1306
1323
|
|
1307
1324
|
describe '.update_organization_membership' do
|
@@ -1329,6 +1346,22 @@ describe WorkOS::UserManagement do
|
|
1329
1346
|
end
|
1330
1347
|
end
|
1331
1348
|
end
|
1349
|
+
|
1350
|
+
context 'with role slugs' do
|
1351
|
+
it 'updates an organization membership with multiple roles' do
|
1352
|
+
VCR.use_cassette('user_management/update_organization_membership/valid_multiple_roles') do
|
1353
|
+
organization_membership = WorkOS::UserManagement.update_organization_membership(
|
1354
|
+
id: 'om_01H5JQDV7R7ATEYZDEG0W5PRYS',
|
1355
|
+
role_slugs: %w[admin editor],
|
1356
|
+
)
|
1357
|
+
|
1358
|
+
expect(organization_membership.organization_id).to eq('organization_01H5JQDV7R7ATEYZDEG0W5PRYS')
|
1359
|
+
expect(organization_membership.user_id).to eq('user_01H5JQDV7R7ATEYZDEG0W5PRYS')
|
1360
|
+
expect(organization_membership.roles).to be_an(Array)
|
1361
|
+
expect(organization_membership.roles.length).to eq(2)
|
1362
|
+
end
|
1363
|
+
end
|
1364
|
+
end
|
1332
1365
|
end
|
1333
1366
|
|
1334
1367
|
describe '.delete_organization_membership' do
|
@@ -0,0 +1,78 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.workos.com/organizations/org_01HX7Q7R12H1JMAKN75SH2G529/feature-flags?order=desc
|
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.1.4; arm64-darwin24; v5.24.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Mon, 04 Aug 2025 18:37:04 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Cf-Ray:
|
34
|
+
- 96a029f4191e2f57-LAX
|
35
|
+
Cf-Cache-Status:
|
36
|
+
- DYNAMIC
|
37
|
+
Etag:
|
38
|
+
- W/"1f7-g5rU0vT2OhGT9sAPsywR3YS8ePw"
|
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
|
+
- 9cd52998-5106-40cf-9080-82c07528c672
|
65
|
+
X-Xss-Protection:
|
66
|
+
- '0'
|
67
|
+
Set-Cookie:
|
68
|
+
- _cfuvid=_9dbE_0fDVZ45WXvgEp8frEFOIlVDyARPbMk3AffOcs-1754332624329-0.0.1.1-604800000;
|
69
|
+
path=/; domain=.workos.com; HttpOnly; Secure; SameSite=None
|
70
|
+
Server:
|
71
|
+
- cloudflare
|
72
|
+
body:
|
73
|
+
encoding: ASCII-8BIT
|
74
|
+
string: '{"object":"list","data":[{"object":"feature_flag","id":"flag_01K1V04FV94RNDSN5GKSZVQMYN","slug":"new-sidebar-layout","name":"New
|
75
|
+
Sidebar Layout","description":"","created_at":"2025-08-04T16:55:15.557Z","updated_at":"2025-08-04T16:55:15.557Z"},{"object":"feature_flag","id":"flag_01K1V02KNS6WHYXKG0DWB87THK","slug":"dark-mode-toggle","name":"Dark
|
76
|
+
Mode Toggle","description":"","created_at":"2025-08-04T16:54:13.942Z","updated_at":"2025-08-04T16:54:13.942Z"}],"list_metadata":{"before":null,"after":null}}'
|
77
|
+
recorded_at: Mon, 04 Aug 2025 18:37:04 GMT
|
78
|
+
recorded_with: VCR 6.3.1
|
@@ -0,0 +1,76 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.workos.com/user_management/organization_memberships
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","role_slugs":["admin","member"]}'
|
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.1.4; arm64-darwin24; v5.25.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Mon, 06 Oct 2025 19:57:34 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Content-Length:
|
30
|
+
- '26'
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Server:
|
34
|
+
- cloudflare
|
35
|
+
Cf-Ray:
|
36
|
+
- 98a7ba7fea91ead7-ORD
|
37
|
+
Cf-Cache-Status:
|
38
|
+
- DYNAMIC
|
39
|
+
Etag:
|
40
|
+
- W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw"
|
41
|
+
Strict-Transport-Security:
|
42
|
+
- max-age=15552000; includeSubDomains
|
43
|
+
Vary:
|
44
|
+
- Origin, Accept-Encoding
|
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
|
+
- 6507807d-d3b9-4e8f-9ca8-f84c6f9c6eb4
|
67
|
+
X-Xss-Protection:
|
68
|
+
- '0'
|
69
|
+
Set-Cookie:
|
70
|
+
- _cfuvid=recfIuOTSO3jIxK5SUOdhHRRfTGoiOFOMgSbEpVIjpg-1759780654123-0.0.1.1-604800000;
|
71
|
+
path=/; domain=.workos.com; HttpOnly; Secure; SameSite=None
|
72
|
+
body:
|
73
|
+
encoding: UTF-8
|
74
|
+
string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"member"}, "roles":[{"slug":"member"}, {"slug":"admin"}], "created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
|
75
|
+
recorded_at: Mon, 06 Oct 2025 19:57:34 GMT
|
76
|
+
recorded_with: VCR 6.3.1
|
@@ -0,0 +1,76 @@
|
|
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_slugs":["admin","editor"]}'
|
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.1.4; arm64-darwin24; v5.25.0
|
18
|
+
Authorization:
|
19
|
+
- Bearer <API_KEY>
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Tue, 07 Oct 2025 14:22:26 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Content-Length:
|
30
|
+
- '26'
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Server:
|
34
|
+
- cloudflare
|
35
|
+
Cf-Ray:
|
36
|
+
- 98ae0cf66dd9344d-ORD
|
37
|
+
Cf-Cache-Status:
|
38
|
+
- DYNAMIC
|
39
|
+
Etag:
|
40
|
+
- W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw"
|
41
|
+
Strict-Transport-Security:
|
42
|
+
- max-age=15552000; includeSubDomains
|
43
|
+
Vary:
|
44
|
+
- Origin, Accept-Encoding
|
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
|
+
- 92b6245b-40a8-4bdd-95d1-e32f6e9d1d70
|
67
|
+
X-Xss-Protection:
|
68
|
+
- '0'
|
69
|
+
Set-Cookie:
|
70
|
+
- _cfuvid=hq7zKar8D7SHPwNzTjLw.29beujgLQlq6cOYaWvYhEM-1759846946364-0.0.1.1-604800000;
|
71
|
+
path=/; domain=.workos.com; HttpOnly; Secure; SameSite=None
|
72
|
+
body:
|
73
|
+
encoding: UTF-8
|
74
|
+
string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","role":{"slug":"admin"},"roles":[{"slug":"admin"},{"slug":"editor"}],"created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}'
|
75
|
+
recorded_at: Tue, 07 Oct 2025 14:22:26 GMT
|
76
|
+
recorded_with: VCR 6.3.1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- WorkOS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: encryptor
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- lib/workos/event.rb
|
154
154
|
- lib/workos/events.rb
|
155
155
|
- lib/workos/factor.rb
|
156
|
+
- lib/workos/feature_flag.rb
|
156
157
|
- lib/workos/hash_provider.rb
|
157
158
|
- lib/workos/impersonator.rb
|
158
159
|
- lib/workos/invitation.rb
|
@@ -274,6 +275,7 @@ files:
|
|
274
275
|
- spec/support/fixtures/vcr_cassettes/organization/get.yml
|
275
276
|
- spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
|
276
277
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
278
|
+
- spec/support/fixtures/vcr_cassettes/organization/list_organization_feature_flags.yml
|
277
279
|
- spec/support/fixtures/vcr_cassettes/organization/list_organization_roles.yml
|
278
280
|
- spec/support/fixtures/vcr_cassettes/organization/update.yml
|
279
281
|
- spec/support/fixtures/vcr_cassettes/organization/update_with_external_id.yml
|
@@ -324,6 +326,7 @@ files:
|
|
324
326
|
- spec/support/fixtures/vcr_cassettes/user_management/create_magic_auth/valid.yml
|
325
327
|
- spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/invalid.yml
|
326
328
|
- spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml
|
329
|
+
- spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid_multiple_roles.yml
|
327
330
|
- spec/support/fixtures/vcr_cassettes/user_management/create_password_reset/valid.yml
|
328
331
|
- spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml
|
329
332
|
- spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml
|
@@ -375,6 +378,7 @@ files:
|
|
375
378
|
- spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/valid.yml
|
376
379
|
- spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/invalid.yml
|
377
380
|
- spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid.yml
|
381
|
+
- spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid_multiple_roles.yml
|
378
382
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user/email.yml
|
379
383
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml
|
380
384
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml
|
@@ -504,6 +508,7 @@ test_files:
|
|
504
508
|
- spec/support/fixtures/vcr_cassettes/organization/get.yml
|
505
509
|
- spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml
|
506
510
|
- spec/support/fixtures/vcr_cassettes/organization/list.yml
|
511
|
+
- spec/support/fixtures/vcr_cassettes/organization/list_organization_feature_flags.yml
|
507
512
|
- spec/support/fixtures/vcr_cassettes/organization/list_organization_roles.yml
|
508
513
|
- spec/support/fixtures/vcr_cassettes/organization/update.yml
|
509
514
|
- spec/support/fixtures/vcr_cassettes/organization/update_with_external_id.yml
|
@@ -554,6 +559,7 @@ test_files:
|
|
554
559
|
- spec/support/fixtures/vcr_cassettes/user_management/create_magic_auth/valid.yml
|
555
560
|
- spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/invalid.yml
|
556
561
|
- spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml
|
562
|
+
- spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid_multiple_roles.yml
|
557
563
|
- spec/support/fixtures/vcr_cassettes/user_management/create_password_reset/valid.yml
|
558
564
|
- spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml
|
559
565
|
- spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml
|
@@ -605,6 +611,7 @@ test_files:
|
|
605
611
|
- spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/valid.yml
|
606
612
|
- spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/invalid.yml
|
607
613
|
- spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid.yml
|
614
|
+
- spec/support/fixtures/vcr_cassettes/user_management/update_organization_membership/valid_multiple_roles.yml
|
608
615
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user/email.yml
|
609
616
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml
|
610
617
|
- spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml
|