auth0 6.0.0.beta.4 → 6.0.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/.fern/metadata.json +1 -1
- data/.fern/replay.lock +7 -1
- data/.version +1 -1
- data/CHANGELOG.md +57 -0
- data/README.md +4 -1
- data/custom.gemspec.rb +1 -1
- data/examples/ruby-api/Gemfile.lock +3 -3
- data/lib/auth0/agents/client.rb +201 -0
- data/lib/auth0/agents/types/create_agent_request_content.rb +17 -0
- data/lib/auth0/agents/types/list_agents_request_parameters.rb +13 -0
- data/lib/auth0/agents/types/patch_agent_request_parameters.rb +15 -0
- data/lib/auth0/client.rb +5 -0
- data/lib/auth0/client_grants/client.rb +2 -0
- data/lib/auth0/client_grants/organizations/client.rb +2 -0
- data/lib/auth0/client_grants/organizations/types/list_client_grant_organizations_request_parameters.rb +2 -0
- data/lib/auth0/client_grants/types/list_client_grants_request_parameters.rb +2 -0
- data/lib/auth0/connections/client.rb +2 -0
- data/lib/auth0/connections/directory_provisioning/client.rb +76 -0
- data/lib/auth0/connections/directory_provisioning/types/add_synchronized_groups_request_content.rb +15 -0
- data/lib/auth0/connections/directory_provisioning/types/delete_synchronized_groups_request_content.rb +15 -0
- data/lib/auth0/connections/directory_provisioning/types/list_synchronized_groups_request_parameters.rb +2 -0
- data/lib/auth0/connections/types/list_connections_query_parameters.rb +2 -0
- data/lib/auth0/event_streams/deliveries/client.rb +27 -17
- data/lib/auth0/flows/executions/client.rb +2 -0
- data/lib/auth0/flows/executions/types/list_flow_executions_request_parameters.rb +2 -0
- data/lib/auth0/groups/client.rb +2 -0
- data/lib/auth0/groups/types/list_groups_request_parameters.rb +2 -0
- data/lib/auth0/mixins/token_management.rb +15 -11
- data/lib/auth0/organizations/client.rb +9 -0
- data/lib/auth0/organizations/clients/client.rb +223 -0
- data/lib/auth0/organizations/clients/types/create_organization_clients_request_content.rb +15 -0
- data/lib/auth0/organizations/clients/types/delete_organization_clients_request_content.rb +15 -0
- data/lib/auth0/organizations/clients/types/list_organization_clients_request_parameters.rb +17 -0
- data/lib/auth0/organizations/clients/types/update_organization_client_request_content.rb +17 -0
- data/lib/auth0/organizations/members/client.rb +5 -1
- data/lib/auth0/organizations/members/roles/client.rb +3 -0
- data/lib/auth0/organizations/members/types/list_organization_members_request_parameters.rb +2 -0
- data/lib/auth0/organizations/roles/client.rb +5 -0
- data/lib/auth0/organizations/roles/groups/client.rb +68 -0
- data/lib/auth0/organizations/roles/groups/types/list_organization_role_groups_request_parameters.rb +21 -0
- data/lib/auth0/organizations/roles/members/client.rb +6 -0
- data/lib/auth0/organizations/types/create_organization_request_content.rb +2 -0
- data/lib/auth0/organizations/types/list_organizations_request_parameters.rb +4 -0
- data/lib/auth0/organizations/types/update_organization_request_content.rb +2 -0
- data/lib/auth0/roles/client.rb +4 -0
- data/lib/auth0/roles/types/create_role_request_content.rb +4 -0
- data/lib/auth0/roles/types/list_roles_request_parameters.rb +4 -0
- data/lib/auth0/roles/users/client.rb +5 -0
- data/lib/auth0/roles/users/types/list_role_users_request_parameters.rb +2 -0
- data/lib/auth0/types/acul_context_enum.rb +1 -0
- data/lib/auth0/types/agent_metadata.rb +23 -0
- data/lib/auth0/types/agent_response_content.rb +19 -0
- data/lib/auth0/types/conflict_schema.rb +14 -0
- data/lib/auth0/types/conflict_schema_error.rb +11 -0
- data/lib/auth0/types/connection_connected_accounts_purpose.rb +2 -0
- data/lib/auth0/types/connection_connected_accounts_purpose_xaa.rb +2 -0
- data/lib/auth0/types/create_organization_client_request_item.rb +11 -0
- data/lib/auth0/types/create_organization_clients_response_content.rb +23 -0
- data/lib/auth0/types/create_organization_response_content.rb +4 -0
- data/lib/auth0/types/create_role_response_content.rb +4 -0
- data/lib/auth0/types/event_stream_cloud_event.rb +1 -1
- data/lib/auth0/types/event_stream_cloud_event_data.rb +23 -0
- data/lib/auth0/types/event_stream_delivery_attempt.rb +2 -0
- data/lib/auth0/types/get_organization_by_name_response_content.rb +4 -0
- data/lib/auth0/types/get_organization_client_response_content.rb +13 -0
- data/lib/auth0/types/get_organization_response_content.rb +4 -0
- data/lib/auth0/types/get_role_response_content.rb +4 -0
- data/lib/auth0/types/guardian_factor.rb +2 -0
- data/lib/auth0/types/guardian_factor_settings.rb +12 -0
- data/lib/auth0/types/list_agents_response_content.rb +11 -0
- data/lib/auth0/types/list_event_stream_deliveries_response_content.rb +11 -0
- data/lib/auth0/types/list_organization_clients_response_content.rb +11 -0
- data/lib/auth0/types/list_organization_role_groups_response_content.rb +12 -0
- data/lib/auth0/types/not_found_schema.rb +14 -0
- data/lib/auth0/types/not_found_schema_error.rb +11 -0
- data/lib/auth0/types/oauth_scope.rb +8 -0
- data/lib/auth0/types/organization.rb +4 -0
- data/lib/auth0/types/organization_client.rb +13 -0
- data/lib/auth0/types/organization_client_association.rb +11 -0
- data/lib/auth0/types/organization_client_metadata.rb +20 -0
- data/lib/auth0/types/organization_client_metadata_organization_usage_enum.rb +13 -0
- data/lib/auth0/types/role.rb +4 -0
- data/lib/auth0/types/role_group.rb +26 -0
- data/lib/auth0/types/role_type_enum.rb +12 -0
- data/lib/auth0/types/self_service_profile_sso_ticket_google_workspace_config.rb +2 -0
- data/lib/auth0/types/synchronized_group_payload.rb +6 -0
- data/lib/auth0/types/synchronized_group_selection_id.rb +9 -0
- data/lib/auth0/types/update_organization_client_response_content.rb +13 -0
- data/lib/auth0/types/update_organization_response_content.rb +4 -0
- data/lib/auth0/types/update_role_response_content.rb +4 -0
- data/lib/auth0/types/user_effective_permission_role_source_response_content.rb +4 -0
- data/lib/auth0/users/groups/client.rb +2 -0
- data/lib/auth0/users/groups/types/get_user_groups_request_parameters.rb +2 -0
- data/lib/auth0/users/permissions/client.rb +3 -0
- data/lib/auth0/users/refresh_token/client.rb +2 -0
- data/lib/auth0/users/refresh_token/types/list_refresh_tokens_request_parameters.rb +2 -0
- data/lib/auth0/users/roles/client.rb +3 -0
- data/lib/auth0/users/sessions/client.rb +2 -0
- data/lib/auth0/users/sessions/types/list_user_sessions_request_parameters.rb +2 -0
- data/lib/auth0/version.rb +1 -1
- data/lib/auth0.rb +38 -2
- data/v6_MIGRATION_GUIDE.md +1 -1
- data/wiremock/wiremock-mappings.json +592 -55
- metadata +46 -4
|
@@ -26,7 +26,7 @@ module Auth0
|
|
|
26
26
|
# @option params [String, nil] :from
|
|
27
27
|
# @option params [Integer, nil] :take
|
|
28
28
|
#
|
|
29
|
-
# @return [
|
|
29
|
+
# @return [Auth0::Types::ListEventStreamDeliveriesResponseContent]
|
|
30
30
|
def list(request_options: {}, **params)
|
|
31
31
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
32
32
|
query_params = {}
|
|
@@ -37,23 +37,33 @@ module Auth0
|
|
|
37
37
|
query_params["from"] = params[:from] if params.key?(:from)
|
|
38
38
|
query_params["take"] = params.fetch(:take, 50)
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
Auth0::Internal::CursorItemIterator.new(
|
|
41
|
+
cursor_field: :next_,
|
|
42
|
+
item_field: :deliveries,
|
|
43
|
+
initial_cursor: query_params["from"]
|
|
44
|
+
) do |next_cursor|
|
|
45
|
+
query_params["from"] = next_cursor
|
|
46
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
47
|
+
base_url: request_options[:base_url],
|
|
48
|
+
method: "GET",
|
|
49
|
+
path: "event-streams/#{URI.encode_uri_component(params[:id].to_s)}/deliveries",
|
|
50
|
+
query: query_params,
|
|
51
|
+
request_options: request_options
|
|
52
|
+
)
|
|
53
|
+
begin
|
|
54
|
+
response = @client.send(request)
|
|
55
|
+
rescue Net::HTTPRequestTimeout
|
|
56
|
+
raise Auth0::Errors::TimeoutError
|
|
57
|
+
end
|
|
58
|
+
code = response.code.to_i
|
|
59
|
+
if code.between?(200, 299)
|
|
60
|
+
parsed_response = Auth0::Types::ListEventStreamDeliveriesResponseContent.load(response.body)
|
|
61
|
+
[parsed_response, response]
|
|
62
|
+
else
|
|
63
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
64
|
+
raise error_class.new(response.body, code: code)
|
|
65
|
+
end
|
|
51
66
|
end
|
|
52
|
-
code = response.code.to_i
|
|
53
|
-
return if code.between?(200, 299)
|
|
54
|
-
|
|
55
|
-
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
56
|
-
raise error_class.new(response.body, code: code)
|
|
57
67
|
end
|
|
58
68
|
|
|
59
69
|
# @param request_options [Hash]
|
|
@@ -19,6 +19,7 @@ module Auth0
|
|
|
19
19
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
20
20
|
# @option request_options [Integer] :timeout_in_seconds
|
|
21
21
|
# @option params [String] :flow_id
|
|
22
|
+
# @option params [Boolean, nil] :include_totals
|
|
22
23
|
# @option params [String, nil] :from
|
|
23
24
|
# @option params [Integer, nil] :take
|
|
24
25
|
#
|
|
@@ -26,6 +27,7 @@ module Auth0
|
|
|
26
27
|
def list(request_options: {}, **params)
|
|
27
28
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
28
29
|
query_params = {}
|
|
30
|
+
query_params["include_totals"] = params.fetch(:include_totals, true)
|
|
29
31
|
query_params["from"] = params[:from] if params.key?(:from)
|
|
30
32
|
query_params["take"] = params.fetch(:take, 50)
|
|
31
33
|
|
|
@@ -7,6 +7,8 @@ module Auth0
|
|
|
7
7
|
class ListFlowExecutionsRequestParameters < Internal::Types::Model
|
|
8
8
|
field :flow_id, -> { String }, optional: false, nullable: false
|
|
9
9
|
|
|
10
|
+
field :include_totals, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
11
|
+
|
|
10
12
|
field :from, -> { String }, optional: true, nullable: false
|
|
11
13
|
|
|
12
14
|
field :take, -> { Integer }, optional: true, nullable: false
|
data/lib/auth0/groups/client.rb
CHANGED
|
@@ -25,6 +25,7 @@ module Auth0
|
|
|
25
25
|
# @option params [String, nil] :search
|
|
26
26
|
# @option params [String, nil] :fields
|
|
27
27
|
# @option params [Boolean, nil] :include_fields
|
|
28
|
+
# @option params [Boolean, nil] :include_totals
|
|
28
29
|
# @option params [String, nil] :from
|
|
29
30
|
# @option params [Integer, nil] :take
|
|
30
31
|
#
|
|
@@ -38,6 +39,7 @@ module Auth0
|
|
|
38
39
|
query_params["search"] = params[:search] if params.key?(:search)
|
|
39
40
|
query_params["fields"] = params[:fields] if params.key?(:fields)
|
|
40
41
|
query_params["include_fields"] = params[:include_fields] if params.key?(:include_fields)
|
|
42
|
+
query_params["include_totals"] = params.fetch(:include_totals, true)
|
|
41
43
|
query_params["from"] = params[:from] if params.key?(:from)
|
|
42
44
|
query_params["take"] = params.fetch(:take, 50)
|
|
43
45
|
|
|
@@ -16,6 +16,8 @@ module Auth0
|
|
|
16
16
|
|
|
17
17
|
field :include_fields, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
18
18
|
|
|
19
|
+
field :include_totals, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
20
|
+
|
|
19
21
|
field :from, -> { String }, optional: true, nullable: false
|
|
20
22
|
|
|
21
23
|
field :take, -> { Integer }, optional: true, nullable: false
|
|
@@ -2,17 +2,10 @@ module Auth0
|
|
|
2
2
|
module Mixins
|
|
3
3
|
module TokenManagement
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# default expiry to an hour if a token was given but no expires_at
|
|
10
|
-
@token_expires_at = @token ? options[:token_expires_at] || Time.now.to_i + 3600 : nil
|
|
11
|
-
|
|
12
|
-
@audience = options[:api_identifier] || "https://#{@domain}/api/v2/"
|
|
13
|
-
get_token() if @token.nil?
|
|
14
|
-
end
|
|
15
|
-
|
|
5
|
+
# Get the Client's api token (or generate a new one if it has expired).
|
|
6
|
+
#
|
|
7
|
+
# @note This method may perform a network request to refresh an expired token. It is not thread-safe.
|
|
8
|
+
# @return [String] the api token
|
|
16
9
|
def get_token
|
|
17
10
|
has_expired = @token && @token_expires_at ? @token_expires_at < (Time.now.to_i + 10) : false
|
|
18
11
|
|
|
@@ -30,6 +23,17 @@ module Auth0
|
|
|
30
23
|
@token
|
|
31
24
|
end
|
|
32
25
|
end
|
|
26
|
+
|
|
27
|
+
private
|
|
28
|
+
|
|
29
|
+
def initialize_token(options)
|
|
30
|
+
@token = options[:access_token] || options[:token]
|
|
31
|
+
# default expiry to an hour if a token was given but no expires_at
|
|
32
|
+
@token_expires_at = @token ? options[:token_expires_at] || Time.now.to_i + 3600 : nil
|
|
33
|
+
|
|
34
|
+
@audience = options[:api_identifier] || "https://#{@domain}/api/v2/"
|
|
35
|
+
get_token() if @token.nil?
|
|
36
|
+
end
|
|
33
37
|
end
|
|
34
38
|
end
|
|
35
39
|
end
|
|
@@ -38,17 +38,21 @@ module Auth0
|
|
|
38
38
|
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
39
39
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
40
40
|
# @option request_options [Integer] :timeout_in_seconds
|
|
41
|
+
# @option params [Boolean, nil] :include_totals
|
|
41
42
|
# @option params [String, nil] :from
|
|
42
43
|
# @option params [Integer, nil] :take
|
|
43
44
|
# @option params [String, nil] :sort
|
|
45
|
+
# @option params [String, nil] :include_client_association_for
|
|
44
46
|
#
|
|
45
47
|
# @return [Auth0::Types::ListOrganizationsPaginatedResponseContent]
|
|
46
48
|
def list(request_options: {}, **params)
|
|
47
49
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
48
50
|
query_params = {}
|
|
51
|
+
query_params["include_totals"] = params.fetch(:include_totals, true)
|
|
49
52
|
query_params["from"] = params[:from] if params.key?(:from)
|
|
50
53
|
query_params["take"] = params.fetch(:take, 50)
|
|
51
54
|
query_params["sort"] = params[:sort] if params.key?(:sort)
|
|
55
|
+
query_params["include_client_association_for"] = params[:include_client_association_for] if params.key?(:include_client_association_for)
|
|
52
56
|
|
|
53
57
|
Auth0::Internal::CursorItemIterator.new(
|
|
54
58
|
cursor_field: :next_,
|
|
@@ -264,6 +268,11 @@ module Auth0
|
|
|
264
268
|
@client_grants ||= Auth0::Organizations::ClientGrants::Client.new(client: @client)
|
|
265
269
|
end
|
|
266
270
|
|
|
271
|
+
# @return [Auth0::Clients::Client]
|
|
272
|
+
def clients
|
|
273
|
+
@clients ||= Auth0::Organizations::Clients::Client.new(client: @client)
|
|
274
|
+
end
|
|
275
|
+
|
|
267
276
|
# @return [Auth0::Connections::Client]
|
|
268
277
|
def connections
|
|
269
278
|
@connections ||= Auth0::Organizations::Connections::Client.new(client: @client)
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Organizations
|
|
5
|
+
module Clients
|
|
6
|
+
class Client
|
|
7
|
+
# @param client [Auth0::Internal::Http::RawClient]
|
|
8
|
+
#
|
|
9
|
+
# @return [void]
|
|
10
|
+
def initialize(client:)
|
|
11
|
+
@client = client
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# List all clients associated with an organization, using checkpoint pagination.
|
|
15
|
+
# <ul>
|
|
16
|
+
# <li>
|
|
17
|
+
# <b>Note</b>: The first time you call this endpoint, omit the <code>from</code> parameter. If there are more
|
|
18
|
+
# results, a <code>next</code> value is included in the response. You can use this for subsequent API calls.
|
|
19
|
+
# When <code>next</code> is no longer included in the response, no further results are remaining.
|
|
20
|
+
# </li>
|
|
21
|
+
# </ul>
|
|
22
|
+
#
|
|
23
|
+
# @param request_options [Hash]
|
|
24
|
+
# @param params [Hash]
|
|
25
|
+
# @option request_options [String] :base_url
|
|
26
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
27
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
28
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
29
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
30
|
+
# @option params [String] :id
|
|
31
|
+
# @option params [String, nil] :from
|
|
32
|
+
# @option params [Integer, nil] :take
|
|
33
|
+
#
|
|
34
|
+
# @return [Auth0::Types::ListOrganizationClientsResponseContent]
|
|
35
|
+
def list(request_options: {}, **params)
|
|
36
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
37
|
+
query_params = {}
|
|
38
|
+
query_params["from"] = params[:from] if params.key?(:from)
|
|
39
|
+
query_params["take"] = params.fetch(:take, 50)
|
|
40
|
+
|
|
41
|
+
Auth0::Internal::CursorItemIterator.new(
|
|
42
|
+
cursor_field: :next_,
|
|
43
|
+
item_field: :clients,
|
|
44
|
+
initial_cursor: query_params["from"]
|
|
45
|
+
) do |next_cursor|
|
|
46
|
+
query_params["from"] = next_cursor
|
|
47
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
48
|
+
base_url: request_options[:base_url],
|
|
49
|
+
method: "GET",
|
|
50
|
+
path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/clients",
|
|
51
|
+
query: query_params,
|
|
52
|
+
request_options: request_options
|
|
53
|
+
)
|
|
54
|
+
begin
|
|
55
|
+
response = @client.send(request)
|
|
56
|
+
rescue Net::HTTPRequestTimeout
|
|
57
|
+
raise Auth0::Errors::TimeoutError
|
|
58
|
+
end
|
|
59
|
+
code = response.code.to_i
|
|
60
|
+
if code.between?(200, 299)
|
|
61
|
+
parsed_response = Auth0::Types::ListOrganizationClientsResponseContent.load(response.body)
|
|
62
|
+
[parsed_response, response]
|
|
63
|
+
else
|
|
64
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
65
|
+
raise error_class.new(response.body, code: code)
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Associate one or more clients with an organization.
|
|
71
|
+
#
|
|
72
|
+
# @param request_options [Hash]
|
|
73
|
+
# @param params [Auth0::Organizations::Clients::Types::CreateOrganizationClientsRequestContent]
|
|
74
|
+
# @option request_options [String] :base_url
|
|
75
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
76
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
77
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
78
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
79
|
+
# @option params [String] :id
|
|
80
|
+
#
|
|
81
|
+
# @return [Array[Auth0::Types::OrganizationClient]]
|
|
82
|
+
def create(request_options: {}, **params)
|
|
83
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
84
|
+
request_data = Auth0::Organizations::Clients::Types::CreateOrganizationClientsRequestContent.new(params).to_h
|
|
85
|
+
non_body_param_names = %w[id]
|
|
86
|
+
body = request_data.except(*non_body_param_names)
|
|
87
|
+
|
|
88
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
89
|
+
base_url: request_options[:base_url],
|
|
90
|
+
method: "POST",
|
|
91
|
+
path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/clients",
|
|
92
|
+
body: body,
|
|
93
|
+
request_options: request_options
|
|
94
|
+
)
|
|
95
|
+
begin
|
|
96
|
+
response = @client.send(request)
|
|
97
|
+
rescue Net::HTTPRequestTimeout
|
|
98
|
+
raise Auth0::Errors::TimeoutError
|
|
99
|
+
end
|
|
100
|
+
code = response.code.to_i
|
|
101
|
+
if code.between?(200, 299)
|
|
102
|
+
Auth0::Types::CreateOrganizationClientsResponseContent.load(response.body)
|
|
103
|
+
else
|
|
104
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
105
|
+
raise error_class.new(response.body, code: code)
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Remove one or more client associations from an organization.
|
|
110
|
+
#
|
|
111
|
+
# @param request_options [Hash]
|
|
112
|
+
# @param params [Auth0::Organizations::Clients::Types::DeleteOrganizationClientsRequestContent]
|
|
113
|
+
# @option request_options [String] :base_url
|
|
114
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
115
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
116
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
117
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
118
|
+
# @option params [String] :id
|
|
119
|
+
#
|
|
120
|
+
# @return [untyped]
|
|
121
|
+
def delete(request_options: {}, **params)
|
|
122
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
123
|
+
request_data = Auth0::Organizations::Clients::Types::DeleteOrganizationClientsRequestContent.new(params).to_h
|
|
124
|
+
non_body_param_names = %w[id]
|
|
125
|
+
body = request_data.except(*non_body_param_names)
|
|
126
|
+
|
|
127
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
128
|
+
base_url: request_options[:base_url],
|
|
129
|
+
method: "DELETE",
|
|
130
|
+
path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/clients",
|
|
131
|
+
body: body,
|
|
132
|
+
request_options: request_options
|
|
133
|
+
)
|
|
134
|
+
begin
|
|
135
|
+
response = @client.send(request)
|
|
136
|
+
rescue Net::HTTPRequestTimeout
|
|
137
|
+
raise Auth0::Errors::TimeoutError
|
|
138
|
+
end
|
|
139
|
+
code = response.code.to_i
|
|
140
|
+
return if code.between?(200, 299)
|
|
141
|
+
|
|
142
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
143
|
+
raise error_class.new(response.body, code: code)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Get a specific client association for an organization.
|
|
147
|
+
#
|
|
148
|
+
# @param request_options [Hash]
|
|
149
|
+
# @param params [Hash]
|
|
150
|
+
# @option request_options [String] :base_url
|
|
151
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
152
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
153
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
154
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
155
|
+
# @option params [String] :id
|
|
156
|
+
# @option params [String] :client_id
|
|
157
|
+
#
|
|
158
|
+
# @return [Auth0::Types::GetOrganizationClientResponseContent]
|
|
159
|
+
def get(request_options: {}, **params)
|
|
160
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
161
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
162
|
+
base_url: request_options[:base_url],
|
|
163
|
+
method: "GET",
|
|
164
|
+
path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/clients/#{URI.encode_uri_component(params[:client_id].to_s)}",
|
|
165
|
+
request_options: request_options
|
|
166
|
+
)
|
|
167
|
+
begin
|
|
168
|
+
response = @client.send(request)
|
|
169
|
+
rescue Net::HTTPRequestTimeout
|
|
170
|
+
raise Auth0::Errors::TimeoutError
|
|
171
|
+
end
|
|
172
|
+
code = response.code.to_i
|
|
173
|
+
if code.between?(200, 299)
|
|
174
|
+
Auth0::Types::GetOrganizationClientResponseContent.load(response.body)
|
|
175
|
+
else
|
|
176
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
177
|
+
raise error_class.new(response.body, code: code)
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Update an organization client association.
|
|
182
|
+
#
|
|
183
|
+
# @param request_options [Hash]
|
|
184
|
+
# @param params [Auth0::Organizations::Clients::Types::UpdateOrganizationClientRequestContent]
|
|
185
|
+
# @option request_options [String] :base_url
|
|
186
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
187
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
188
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
189
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
190
|
+
# @option params [String] :id
|
|
191
|
+
# @option params [String] :client_id
|
|
192
|
+
#
|
|
193
|
+
# @return [Auth0::Types::UpdateOrganizationClientResponseContent]
|
|
194
|
+
def update(request_options: {}, **params)
|
|
195
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
196
|
+
request_data = Auth0::Organizations::Clients::Types::UpdateOrganizationClientRequestContent.new(params).to_h
|
|
197
|
+
non_body_param_names = %w[id client_id]
|
|
198
|
+
body = request_data.except(*non_body_param_names)
|
|
199
|
+
|
|
200
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
201
|
+
base_url: request_options[:base_url],
|
|
202
|
+
method: "PATCH",
|
|
203
|
+
path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/clients/#{URI.encode_uri_component(params[:client_id].to_s)}",
|
|
204
|
+
body: body,
|
|
205
|
+
request_options: request_options
|
|
206
|
+
)
|
|
207
|
+
begin
|
|
208
|
+
response = @client.send(request)
|
|
209
|
+
rescue Net::HTTPRequestTimeout
|
|
210
|
+
raise Auth0::Errors::TimeoutError
|
|
211
|
+
end
|
|
212
|
+
code = response.code.to_i
|
|
213
|
+
if code.between?(200, 299)
|
|
214
|
+
Auth0::Types::UpdateOrganizationClientResponseContent.load(response.body)
|
|
215
|
+
else
|
|
216
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
217
|
+
raise error_class.new(response.body, code: code)
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Organizations
|
|
5
|
+
module Clients
|
|
6
|
+
module Types
|
|
7
|
+
class CreateOrganizationClientsRequestContent < Internal::Types::Model
|
|
8
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :clients, -> { Internal::Types::Array[Auth0::Types::CreateOrganizationClientRequestItem] }, optional: false, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Organizations
|
|
5
|
+
module Clients
|
|
6
|
+
module Types
|
|
7
|
+
class DeleteOrganizationClientsRequestContent < Internal::Types::Model
|
|
8
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :clients, -> { Internal::Types::Array[String] }, optional: false, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Organizations
|
|
5
|
+
module Clients
|
|
6
|
+
module Types
|
|
7
|
+
class ListOrganizationClientsRequestParameters < Internal::Types::Model
|
|
8
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :from, -> { String }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :take, -> { Integer }, optional: true, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Organizations
|
|
5
|
+
module Clients
|
|
6
|
+
module Types
|
|
7
|
+
class UpdateOrganizationClientRequestContent < Internal::Types::Model
|
|
8
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :client_id, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :use_for_member_access, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -18,7 +18,9 @@ module Auth0
|
|
|
18
18
|
# - Use the `fields` parameter to optionally define the specific member details retrieved. If `fields` is left
|
|
19
19
|
# blank, all fields (except roles) are returned.
|
|
20
20
|
# - Member roles are not sent by default. Use `fields=roles` to retrieve the roles assigned to each listed
|
|
21
|
-
# member. To use this parameter, you must include the `read:organization_member_roles` scope in the token.
|
|
21
|
+
# member. To use this parameter, you must include the `read:organization_member_roles` scope in the token. Only
|
|
22
|
+
# directly assigned roles are returned. To also include group-based role assignments, use `GET
|
|
23
|
+
# /api/v2/organizations/{id}/members/{user_id}/effective-roles`.
|
|
22
24
|
#
|
|
23
25
|
# This endpoint supports two types of pagination:
|
|
24
26
|
#
|
|
@@ -43,6 +45,7 @@ module Auth0
|
|
|
43
45
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
44
46
|
# @option request_options [Integer] :timeout_in_seconds
|
|
45
47
|
# @option params [String] :id
|
|
48
|
+
# @option params [Boolean, nil] :include_totals
|
|
46
49
|
# @option params [String, nil] :from
|
|
47
50
|
# @option params [Integer, nil] :take
|
|
48
51
|
# @option params [String, nil] :fields
|
|
@@ -52,6 +55,7 @@ module Auth0
|
|
|
52
55
|
def list(request_options: {}, **params)
|
|
53
56
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
54
57
|
query_params = {}
|
|
58
|
+
query_params["include_totals"] = params.fetch(:include_totals, true)
|
|
55
59
|
query_params["from"] = params[:from] if params.key?(:from)
|
|
56
60
|
query_params["take"] = params.fetch(:take, 50)
|
|
57
61
|
query_params["fields"] = params[:fields] if params.key?(:fields)
|
|
@@ -18,6 +18,9 @@ module Auth0
|
|
|
18
18
|
# only returns the roles associated with the specified Organization; any roles assigned to the user within
|
|
19
19
|
# other Organizations are not included.
|
|
20
20
|
#
|
|
21
|
+
# **Note**: Returns only direct role assignments for this member. To also include group-based role
|
|
22
|
+
# assignments, use `GET /api/v2/organizations/{id}/members/{user_id}/effective-roles`.
|
|
23
|
+
#
|
|
21
24
|
# @param request_options [Hash]
|
|
22
25
|
# @param params [Hash]
|
|
23
26
|
# @option request_options [String] :base_url
|
|
@@ -7,6 +7,8 @@ module Auth0
|
|
|
7
7
|
class ListOrganizationMembersRequestParameters < Internal::Types::Model
|
|
8
8
|
field :id, -> { String }, optional: false, nullable: false
|
|
9
9
|
|
|
10
|
+
field :include_totals, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
11
|
+
|
|
10
12
|
field :from, -> { String }, optional: true, nullable: false
|
|
11
13
|
|
|
12
14
|
field :take, -> { Integer }, optional: true, nullable: false
|
|
@@ -15,6 +15,11 @@ module Auth0
|
|
|
15
15
|
def members
|
|
16
16
|
@members ||= Auth0::Organizations::Roles::Members::Client.new(client: @client)
|
|
17
17
|
end
|
|
18
|
+
|
|
19
|
+
# @return [Auth0::Groups::Client]
|
|
20
|
+
def groups
|
|
21
|
+
@groups ||= Auth0::Organizations::Roles::Groups::Client.new(client: @client)
|
|
22
|
+
end
|
|
18
23
|
end
|
|
19
24
|
end
|
|
20
25
|
end
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Organizations
|
|
5
|
+
module Roles
|
|
6
|
+
module Groups
|
|
7
|
+
class Client
|
|
8
|
+
# @param client [Auth0::Internal::Http::RawClient]
|
|
9
|
+
#
|
|
10
|
+
# @return [void]
|
|
11
|
+
def initialize(client:)
|
|
12
|
+
@client = client
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Retrieve the list of groups assigned to a role in the context of an organization.
|
|
16
|
+
#
|
|
17
|
+
# @param request_options [Hash]
|
|
18
|
+
# @param params [Hash]
|
|
19
|
+
# @option request_options [String] :base_url
|
|
20
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
21
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
22
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
23
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
24
|
+
# @option params [String] :organization_id
|
|
25
|
+
# @option params [String] :role_id
|
|
26
|
+
# @option params [String, nil] :from
|
|
27
|
+
# @option params [Integer, nil] :take
|
|
28
|
+
#
|
|
29
|
+
# @return [Auth0::Types::ListOrganizationRoleGroupsResponseContent]
|
|
30
|
+
def list(request_options: {}, **params)
|
|
31
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
32
|
+
query_params = {}
|
|
33
|
+
query_params["from"] = params[:from] if params.key?(:from)
|
|
34
|
+
query_params["take"] = params.fetch(:take, 50)
|
|
35
|
+
|
|
36
|
+
Auth0::Internal::CursorItemIterator.new(
|
|
37
|
+
cursor_field: :next_,
|
|
38
|
+
item_field: :groups,
|
|
39
|
+
initial_cursor: query_params["from"]
|
|
40
|
+
) do |next_cursor|
|
|
41
|
+
query_params["from"] = next_cursor
|
|
42
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
43
|
+
base_url: request_options[:base_url],
|
|
44
|
+
method: "GET",
|
|
45
|
+
path: "organizations/#{URI.encode_uri_component(params[:organization_id].to_s)}/roles/#{URI.encode_uri_component(params[:role_id].to_s)}/groups",
|
|
46
|
+
query: query_params,
|
|
47
|
+
request_options: request_options
|
|
48
|
+
)
|
|
49
|
+
begin
|
|
50
|
+
response = @client.send(request)
|
|
51
|
+
rescue Net::HTTPRequestTimeout
|
|
52
|
+
raise Auth0::Errors::TimeoutError
|
|
53
|
+
end
|
|
54
|
+
code = response.code.to_i
|
|
55
|
+
if code.between?(200, 299)
|
|
56
|
+
parsed_response = Auth0::Types::ListOrganizationRoleGroupsResponseContent.load(response.body)
|
|
57
|
+
[parsed_response, response]
|
|
58
|
+
else
|
|
59
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
60
|
+
raise error_class.new(response.body, code: code)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
data/lib/auth0/organizations/roles/groups/types/list_organization_role_groups_request_parameters.rb
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Organizations
|
|
5
|
+
module Roles
|
|
6
|
+
module Groups
|
|
7
|
+
module Types
|
|
8
|
+
class ListOrganizationRoleGroupsRequestParameters < Internal::Types::Model
|
|
9
|
+
field :organization_id, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :role_id, -> { String }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :from, -> { String }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :take, -> { Integer }, optional: true, nullable: false
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -13,6 +13,12 @@ module Auth0
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
# List the organization members assigned a specific role within the context of an organization.
|
|
16
|
+
# <ul>
|
|
17
|
+
# <li>
|
|
18
|
+
# <b>Note</b>: Returns only members with direct role assignments. For groups assigned to this role within the
|
|
19
|
+
# organization, use <code>GET /api/v2/organizations/{organization_id}/roles/{role_id}/groups</code>.
|
|
20
|
+
# </li>
|
|
21
|
+
# </ul>
|
|
16
22
|
#
|
|
17
23
|
# @param request_options [Hash]
|
|
18
24
|
# @param params [Hash]
|
|
@@ -17,6 +17,8 @@ module Auth0
|
|
|
17
17
|
field :token_quota, -> { Auth0::Types::CreateTokenQuota }, optional: true, nullable: false
|
|
18
18
|
|
|
19
19
|
field :third_party_client_access, -> { Auth0::Types::OrganizationThirdPartyClientAccessEnum }, optional: true, nullable: false
|
|
20
|
+
|
|
21
|
+
field :is_app_entitlement_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
20
22
|
end
|
|
21
23
|
end
|
|
22
24
|
end
|