Skip to content

Commit eef338c

Browse files
fern-api[bot]developerkunalkishore7snehil
authored
feat: add Client Profiles, Captcha Policies, and client and client grant search, and remove update_status from experiments and feature flags (#812)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Kunal Dawar <kunal.dawar@okta.com> Co-authored-by: Snehil Kishore <snehil.kishore@okta.com>
1 parent 20dd4fc commit eef338c

216 files changed

Lines changed: 2986 additions & 460 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.fern/metadata.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"cliVersion": "5.92.1",
2+
"cliVersion": "5.144.3",
33
"generatorName": "fernapi/fern-ruby-sdk",
44
"generatorVersion": "1.24.1",
55
"generatorConfig": {
@@ -10,9 +10,9 @@
1010
"offsetSemantics": "page-index",
1111
"useDefaultRequestParameterValues": true
1212
},
13-
"originGitCommit": "d0c167e92ed941d977b98e76601bd970b0e5ecea",
13+
"originGitCommit": "275ad23d02d33d550693bc23ebae86dfa8ee7101",
1414
"originGitCommitIsDirty": false,
1515
"invokedBy": "ci",
1616
"ciProvider": "github",
17-
"sdkVersion": "6.3.1"
17+
"sdkVersion": "6.4.1"
1818
}

‎.fern/replay.lock‎

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/auth0.rb‎

Lines changed: 84 additions & 5 deletions
Large diffs are not rendered by default.

‎lib/auth0/attack_protection/brute_force_protection/types/update_brute_force_settings_request_content.rb‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class UpdateBruteForceSettingsRequestContent < Internal::Types::Model
1414
field :mode, -> { Auth0::Types::BruteForceProtectionModeEnum }, optional: true, nullable: false
1515

1616
field :max_attempts, -> { Integer }, optional: true, nullable: false
17+
18+
field :form_submission_mode, -> { Auth0::Types::BruteForceProtectionFormSubmissionModeEnum }, optional: true, nullable: false
1719
end
1820
end
1921
end
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# frozen_string_literal: true
2+
3+
module Auth0
4+
module AttackProtection
5+
module CaptchaPolicies
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+
# Retrieve all CAPTCHA attack protection policies for the tenant, sorted by priority ascending.
15+
#
16+
# @param request_options [Hash]
17+
# @param _params [Hash]
18+
# @option request_options [String] :base_url
19+
# @option request_options [Hash{String => Object}] :additional_headers
20+
# @option request_options [Hash{String => Object}] :additional_query_parameters
21+
# @option request_options [Hash{String => Object}] :additional_body_parameters
22+
# @option request_options [Integer] :timeout_in_seconds
23+
#
24+
# @example
25+
# client.attack_protection.captcha_policies.list
26+
#
27+
# @return [Array[Auth0::Types::AttackProtectionCaptchaPolicy]]
28+
def list(request_options: {}, **_params)
29+
request = Auth0::Internal::JSON::Request.new(
30+
base_url: request_options[:base_url],
31+
method: "GET",
32+
path: "attack-protection/captcha/policies",
33+
request_options: request_options
34+
)
35+
begin
36+
response = @client.send(request)
37+
rescue Net::HTTPRequestTimeout
38+
raise Auth0::Errors::TimeoutError
39+
end
40+
code = response.code.to_i
41+
if code.between?(200, 299)
42+
(response.body.to_s.empty? ? nil : Auth0::Types::ListAttackProtectionCaptchaPoliciesResponseContent.load(response.body))
43+
else
44+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
45+
raise error_class.new(response.body, code: code)
46+
end
47+
end
48+
49+
# Create a new CAPTCHA attack protection policy for the tenant. The maximum number of policies per tenant is
50+
# determined by the tenant's subscription.
51+
#
52+
# @param request_options [Hash]
53+
# @param params [Auth0::AttackProtection::CaptchaPolicies::Types::CreateAttackProtectionCaptchaPolicyRequestContent]
54+
# @option request_options [String] :base_url
55+
# @option request_options [Hash{String => Object}] :additional_headers
56+
# @option request_options [Hash{String => Object}] :additional_query_parameters
57+
# @option request_options [Hash{String => Object}] :additional_body_parameters
58+
# @option request_options [Integer] :timeout_in_seconds
59+
#
60+
# @example
61+
# client.attack_protection.captcha_policies.create(
62+
# name: "name",
63+
# priority: 1,
64+
# match: {},
65+
# action: {}
66+
# )
67+
#
68+
# @return [Auth0::Types::AttackProtectionCaptchaPolicy]
69+
def create(request_options: {}, **params)
70+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
71+
request = Auth0::Internal::JSON::Request.new(
72+
base_url: request_options[:base_url],
73+
method: "POST",
74+
path: "attack-protection/captcha/policies",
75+
body: Auth0::AttackProtection::CaptchaPolicies::Types::CreateAttackProtectionCaptchaPolicyRequestContent.new(params).to_h,
76+
request_options: request_options
77+
)
78+
begin
79+
response = @client.send(request)
80+
rescue Net::HTTPRequestTimeout
81+
raise Auth0::Errors::TimeoutError
82+
end
83+
code = response.code.to_i
84+
if code.between?(200, 299)
85+
(response.body.to_s.empty? ? nil : Auth0::Types::AttackProtectionCaptchaPolicy.load(response.body))
86+
else
87+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
88+
raise error_class.new(response.body, code: code)
89+
end
90+
end
91+
92+
# Retrieve a single CAPTCHA attack protection policy for the tenant by ID.
93+
#
94+
# @param request_options [Hash]
95+
# @param params [Hash]
96+
# @option request_options [String] :base_url
97+
# @option request_options [Hash{String => Object}] :additional_headers
98+
# @option request_options [Hash{String => Object}] :additional_query_parameters
99+
# @option request_options [Hash{String => Object}] :additional_body_parameters
100+
# @option request_options [Integer] :timeout_in_seconds
101+
# @option params [String] :id
102+
#
103+
# @example
104+
# client.attack_protection.captcha_policies.get(id: "id")
105+
#
106+
# @return [Auth0::Types::AttackProtectionCaptchaPolicy]
107+
def get(request_options: {}, **params)
108+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
109+
request = Auth0::Internal::JSON::Request.new(
110+
base_url: request_options[:base_url],
111+
method: "GET",
112+
path: "attack-protection/captcha/policies/#{URI.encode_uri_component(params[:id].to_s)}",
113+
request_options: request_options
114+
)
115+
begin
116+
response = @client.send(request)
117+
rescue Net::HTTPRequestTimeout
118+
raise Auth0::Errors::TimeoutError
119+
end
120+
code = response.code.to_i
121+
if code.between?(200, 299)
122+
(response.body.to_s.empty? ? nil : Auth0::Types::AttackProtectionCaptchaPolicy.load(response.body))
123+
else
124+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
125+
raise error_class.new(response.body, code: code)
126+
end
127+
end
128+
129+
# Delete a CAPTCHA attack protection policy for the tenant.
130+
#
131+
# @param request_options [Hash]
132+
# @param params [Hash]
133+
# @option request_options [String] :base_url
134+
# @option request_options [Hash{String => Object}] :additional_headers
135+
# @option request_options [Hash{String => Object}] :additional_query_parameters
136+
# @option request_options [Hash{String => Object}] :additional_body_parameters
137+
# @option request_options [Integer] :timeout_in_seconds
138+
# @option params [String] :id
139+
#
140+
# @example
141+
# client.attack_protection.captcha_policies.delete(id: "id")
142+
#
143+
# @return [untyped]
144+
def delete(request_options: {}, **params)
145+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
146+
request = Auth0::Internal::JSON::Request.new(
147+
base_url: request_options[:base_url],
148+
method: "DELETE",
149+
path: "attack-protection/captcha/policies/#{URI.encode_uri_component(params[:id].to_s)}",
150+
request_options: request_options
151+
)
152+
begin
153+
response = @client.send(request)
154+
rescue Net::HTTPRequestTimeout
155+
raise Auth0::Errors::TimeoutError
156+
end
157+
code = response.code.to_i
158+
return if code.between?(200, 299)
159+
160+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
161+
raise error_class.new(response.body, code: code)
162+
end
163+
164+
# Partially update a CAPTCHA attack protection policy. Only the provided fields are modified. A provided match
165+
# or action replaces the stored value in full rather than merging with it; within action, a provider secret or
166+
# API key that is omitted from a provided provider block keeps its stored value.
167+
#
168+
# @param request_options [Hash]
169+
# @param params [Auth0::AttackProtection::CaptchaPolicies::Types::UpdateAttackProtectionCaptchaPolicyRequestContent]
170+
# @option request_options [String] :base_url
171+
# @option request_options [Hash{String => Object}] :additional_headers
172+
# @option request_options [Hash{String => Object}] :additional_query_parameters
173+
# @option request_options [Hash{String => Object}] :additional_body_parameters
174+
# @option request_options [Integer] :timeout_in_seconds
175+
# @option params [String] :id
176+
#
177+
# @example
178+
# client.attack_protection.captcha_policies.update(id: "id")
179+
#
180+
# @return [Auth0::Types::AttackProtectionCaptchaPolicy]
181+
def update(request_options: {}, **params)
182+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
183+
request_data = Auth0::AttackProtection::CaptchaPolicies::Types::UpdateAttackProtectionCaptchaPolicyRequestContent.new(params).to_h
184+
non_body_param_names = %w[id]
185+
body = request_data.except(*non_body_param_names)
186+
187+
request = Auth0::Internal::JSON::Request.new(
188+
base_url: request_options[:base_url],
189+
method: "PATCH",
190+
path: "attack-protection/captcha/policies/#{URI.encode_uri_component(params[:id].to_s)}",
191+
body: body,
192+
request_options: request_options
193+
)
194+
begin
195+
response = @client.send(request)
196+
rescue Net::HTTPRequestTimeout
197+
raise Auth0::Errors::TimeoutError
198+
end
199+
code = response.code.to_i
200+
if code.between?(200, 299)
201+
(response.body.to_s.empty? ? nil : Auth0::Types::AttackProtectionCaptchaPolicy.load(response.body))
202+
else
203+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
204+
raise error_class.new(response.body, code: code)
205+
end
206+
end
207+
end
208+
end
209+
end
210+
end
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# frozen_string_literal: true
2+
3+
module Auth0
4+
module AttackProtection
5+
module CaptchaPolicies
6+
module Types
7+
class CreateAttackProtectionCaptchaPolicyRequestContent < Internal::Types::Model
8+
field :name, -> { String }, optional: false, nullable: false
9+
10+
field :description, -> { String }, optional: true, nullable: false
11+
12+
field :priority, -> { Integer }, optional: false, nullable: false
13+
14+
field :match, -> { Auth0::Types::AttackProtectionCaptchaPolicyMatch }, optional: false, nullable: false
15+
16+
field :action, -> { Auth0::Types::AttackProtectionCaptchaPolicyActionInput }, optional: false, nullable: false
17+
end
18+
end
19+
end
20+
end
21+
end
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# frozen_string_literal: true
2+
3+
module Auth0
4+
module AttackProtection
5+
module CaptchaPolicies
6+
module Types
7+
class UpdateAttackProtectionCaptchaPolicyRequestContent < Internal::Types::Model
8+
field :id, -> { String }, optional: false, nullable: false
9+
10+
field :name, -> { String }, optional: true, nullable: false
11+
12+
field :description, -> { String }, optional: true, nullable: false
13+
14+
field :priority, -> { Integer }, optional: true, nullable: false
15+
16+
field :match, -> { Auth0::Types::AttackProtectionCaptchaPolicyMatch }, optional: true, nullable: false
17+
18+
field :action, -> { Auth0::Types::AttackProtectionCaptchaPolicyActionInput }, optional: true, nullable: false
19+
end
20+
end
21+
end
22+
end
23+
end

‎lib/auth0/attack_protection/client.rb‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ def captcha
3030
@captcha ||= Auth0::AttackProtection::Captcha::Client.new(client: @client)
3131
end
3232

33+
# @return [Auth0::CaptchaPolicies::Client]
34+
def captcha_policies
35+
@captcha_policies ||= Auth0::AttackProtection::CaptchaPolicies::Client.new(client: @client)
36+
end
37+
3338
# @return [Auth0::PhoneProviderProtection::Client]
3439
def phone_provider_protection
3540
@phone_provider_protection ||= Auth0::AttackProtection::PhoneProviderProtection::Client.new(client: @client)

‎lib/auth0/client.rb‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ def client_grants
4343
@client_grants ||= Auth0::ClientGrants::Client.new(client: @raw_client)
4444
end
4545

46+
# @return [Auth0::ClientProfiles::Client]
47+
def client_profiles
48+
@client_profiles ||= Auth0::ClientProfiles::Client.new(client: @raw_client)
49+
end
50+
4651
# @return [Auth0::Clients::Client]
4752
def clients
4853
@clients ||= Auth0::Clients::Client.new(client: @raw_client)

0 commit comments

Comments
 (0)