Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
390 changes: 388 additions & 2 deletions lib/auth0.rb

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions lib/auth0/organizations/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ def members
def groups
@groups ||= Auth0::Organizations::Groups::Client.new(client: @client)
end

# @return [Auth0::Roles::Client]
def roles
@roles ||= Auth0::Organizations::Roles::Client.new(client: @client)
end
end
end
end
21 changes: 21 additions & 0 deletions lib/auth0/organizations/roles/client.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

module Auth0
module Organizations
module Roles
class Client
# @param client [Auth0::Internal::Http::RawClient]
#
# @return [void]
def initialize(client:)
@client = client
end

# @return [Auth0::Members::Client]
def members
@members ||= Auth0::Organizations::Roles::Members::Client.new(client: @client)
end
end
end
end
end
72 changes: 72 additions & 0 deletions lib/auth0/organizations/roles/members/client.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# frozen_string_literal: true

module Auth0
module Organizations
module Roles
module Members
class Client
# @param client [Auth0::Internal::Http::RawClient]
#
# @return [void]
def initialize(client:)
@client = client
end

# List the organization members assigned a specific role within the context of an organization.
#
# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String] :id
# @option params [String] :role_id
# @option params [String, nil] :from
# @option params [Integer, nil] :take
# @option params [String, nil] :fields
# @option params [Boolean, nil] :include_fields
#
# @return [Auth0::Types::ListOrganizationRoleMembersResponseContent]
def list(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
query_params = {}
query_params["from"] = params[:from] if params.key?(:from)
query_params["take"] = params.fetch(:take, 50)
query_params["fields"] = params[:fields] if params.key?(:fields)
query_params["include_fields"] = params.fetch(:include_fields, true)

Auth0::Internal::CursorItemIterator.new(
cursor_field: :next_,
item_field: :members,
initial_cursor: query_params["from"]
) do |next_cursor|
query_params["from"] = next_cursor
request = Auth0::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/roles/#{URI.encode_uri_component(params[:role_id].to_s)}/members",
query: query_params,
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Auth0::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
parsed_response = Auth0::Types::ListOrganizationRoleMembersResponseContent.load(response.body)
[parsed_response, response]
else
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end
end
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

module Auth0
module Organizations
module Roles
module Members
module Types
class ListOrganizationRoleMembersRequestParameters < Internal::Types::Model
field :id, -> { String }, optional: false, nullable: false

field :role_id, -> { String }, optional: false, nullable: false

field :from, -> { String }, optional: true, nullable: false

field :take, -> { Integer }, optional: true, nullable: false

field :fields, -> { String }, optional: true, nullable: false

field :include_fields, -> { Internal::Types::Boolean }, optional: true, nullable: false
end
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class CreateOrganizationRequestContent < Internal::Types::Model
field :enabled_connections, -> { Internal::Types::Array[Auth0::Types::ConnectionForOrganization] }, optional: true, nullable: false

field :token_quota, -> { Auth0::Types::CreateTokenQuota }, optional: true, nullable: false

field :third_party_client_access, -> { Auth0::Types::OrganizationThirdPartyClientAccessEnum }, optional: true, nullable: false
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class UpdateOrganizationRequestContent < Internal::Types::Model
field :metadata, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false

field :token_quota, -> { Auth0::Types::UpdateTokenQuota }, optional: true, nullable: false

field :third_party_client_access, -> { Auth0::Types::OrganizationThirdPartyClientAccessEnum }, optional: true, nullable: false
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class ClientTokenVaultPrivilegedAccessWithCredentialID < Internal::Types::Model
field :credentials, -> { Internal::Types::Array[Auth0::Types::CredentialID] }, optional: false, nullable: false

field :ip_allowlist, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :grants, -> { Internal::Types::Array[Auth0::Types::TokenVaultPrivilegedAccessGrant] }, optional: true, nullable: false
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class ClientTokenVaultPrivilegedAccessWithPublicKey < Internal::Types::Model
field :credentials, -> { Internal::Types::Array[Auth0::Types::PublicKeyCredential] }, optional: false, nullable: false

field :ip_allowlist, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :grants, -> { Internal::Types::Array[Auth0::Types::TokenVaultPrivilegedAccessGrant] }, optional: true, nullable: false
end
end
end
4 changes: 4 additions & 0 deletions lib/auth0/types/connection_properties_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ class ConnectionPropertiesOptions < Internal::Types::Model
field :token_endpoint_jwtca_aud_format, -> { Auth0::Types::ConnectionTokenEndpointJwtcaAudFormatEnumOidc }, optional: true, nullable: false

field :id_token_session_expiry_supported, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :discovery_url, -> { String }, optional: true, nullable: false

field :oidc_metadata, -> { Auth0::Types::ConnectionsOidcMetadata }, optional: true, nullable: false
end
end
end
23 changes: 23 additions & 0 deletions lib/auth0/types/connections_discovery_url.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

module Auth0
module Types
module ConnectionsDiscoveryURL
# ConnectionsDiscoveryURL is an alias for Object

# @option str [String]
#
# @return [untyped]
def self.load(str)
::JSON.parse(str)
end

# @option value [untyped]
#
# @return [String]
def self.dump(value)
::JSON.generate(value)
end
end
end
end
82 changes: 82 additions & 0 deletions lib/auth0/types/connections_oidc_metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# frozen_string_literal: true

module Auth0
module Types
# Additional OIDC metadata to include in the discovery document. Only applicable when strategy=oidc, okta, or samlp.
class ConnectionsOidcMetadata < Internal::Types::Model
field :issuer, -> { String }, optional: true, nullable: false

field :authorization_endpoint, -> { String }, optional: true, nullable: false

field :token_endpoint, -> { String }, optional: true, nullable: false

field :userinfo_endpoint, -> { String }, optional: true, nullable: false

field :jwks_uri, -> { String }, optional: true, nullable: false

field :registration_endpoint, -> { String }, optional: true, nullable: false

field :scopes_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :response_modes_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :response_types_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :grant_types_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :acr_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :subject_types_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :id_token_signing_alg_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :id_token_encryption_alg_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :id_token_encryption_enc_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :userinfo_signing_alg_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :userinfo_encryption_alg_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :userinfo_encryption_enc_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :request_object_signing_alg_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :request_object_encryption_alg_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :request_object_encryption_enc_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :token_endpoint_auth_methods_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :token_endpoint_auth_signing_alg_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :display_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :claim_types_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :claims_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :service_documentation, -> { String }, optional: true, nullable: false

field :claims_locales_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :ui_locales_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :claims_parameter_supported, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :request_parameter_supported, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :request_uri_parameter_supported, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :require_request_uri_registration, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :op_policy_uri, -> { String }, optional: true, nullable: false

field :op_tos_uri, -> { String }, optional: true, nullable: false

field :end_session_endpoint, -> { String }, optional: true, nullable: false

field :dpop_signing_alg_values_supported, -> { Internal::Types::Array[String] }, optional: true, nullable: false
end
end
end
2 changes: 2 additions & 0 deletions lib/auth0/types/create_organization_response_content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class CreateOrganizationResponseContent < Internal::Types::Model

field :token_quota, -> { Auth0::Types::TokenQuota }, optional: true, nullable: false

field :third_party_client_access, -> { Auth0::Types::OrganizationThirdPartyClientAccessEnum }, optional: true, nullable: false

field :enabled_connections, -> { Internal::Types::Array[Auth0::Types::OrganizationEnabledConnection] }, optional: true, nullable: false
end
end
Expand Down
12 changes: 12 additions & 0 deletions lib/auth0/types/default_method_phone_number_identifier_enum.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Auth0
module Types
module DefaultMethodPhoneNumberIdentifierEnum
extend Auth0::Internal::Types::Enum

PASSWORD = "password"
PHONE_OTP = "phone_otp"
end
end
end
2 changes: 1 addition & 1 deletion lib/auth0/types/email_attribute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Auth0
module Types
# Configuration for the email attribute for users.
class EmailAttribute < Internal::Types::Model
field :identifier, -> { Auth0::Types::ConnectionAttributeIdentifier }, optional: true, nullable: false
field :identifier, -> { Auth0::Types::EmailAttributeIdentifier }, optional: true, nullable: false

field :unique, -> { Internal::Types::Boolean }, optional: true, nullable: false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Auth0
module Types
class ConnectionAttributeIdentifier < Internal::Types::Model
class EmailAttributeIdentifier < Internal::Types::Model
field :active, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :default_method, -> { Auth0::Types::DefaultMethodEmailIdentifierEnum }, optional: true, nullable: false
Expand Down
12 changes: 12 additions & 0 deletions lib/auth0/types/event_stream_cloud_event_connection_created.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Auth0
module Types
# SSE message for connection.created.
class EventStreamCloudEventConnectionCreated < Internal::Types::Model
field :offset, -> { String }, optional: false, nullable: false

field :event, -> { Auth0::Types::EventStreamCloudEventConnectionCreatedCloudEvent }, optional: false, nullable: false
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# frozen_string_literal: true

module Auth0
module Types
# Represents an event that occurs when a connection is created.
class EventStreamCloudEventConnectionCreatedCloudEvent < Internal::Types::Model
field :specversion, -> { Auth0::Types::EventStreamCloudEventSpecVersionEnum }, optional: false, nullable: false

field :type, -> { Auth0::Types::EventStreamCloudEventConnectionCreatedCloudEventTypeEnum }, optional: false, nullable: false

field :source, -> { String }, optional: false, nullable: false

field :id, -> { String }, optional: false, nullable: false

field :time, -> { String }, optional: false, nullable: false

field :data, -> { Auth0::Types::EventStreamCloudEventConnectionCreatedData }, optional: false, nullable: false

field :a0tenant, -> { String }, optional: false, nullable: false

field :a0stream, -> { String }, optional: false, nullable: false

field :a0purpose, -> { Auth0::Types::EventStreamCloudEventA0PurposeEnum }, optional: true, nullable: false
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module Auth0
module Types
module EventStreamCloudEventConnectionCreatedCloudEventTypeEnum
extend Auth0::Internal::Types::Enum

CONNECTION_CREATED = "connection.created"
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Auth0
module Types
# The event payload.
class EventStreamCloudEventConnectionCreatedData < Internal::Types::Model
field :object, -> { Auth0::Types::EventStreamCloudEventConnectionCreatedObject }, optional: false, nullable: false

field :context, -> { Auth0::Types::EventStreamCloudEventContext }, optional: true, nullable: false
end
end
end
Loading
Loading