auth0 5.6.1 → 5.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +16 -2
  3. data/.github/dependabot.yml +10 -0
  4. data/.github/workflows/semgrep.yml +28 -0
  5. data/.gitignore +0 -1
  6. data/CHANGELOG.md +43 -1
  7. data/Gemfile +1 -0
  8. data/Gemfile.lock +241 -0
  9. data/README.md +1 -1
  10. data/auth0.gemspec +1 -1
  11. data/lib/auth0/api/authentication_endpoints.rb +1 -1
  12. data/lib/auth0/api/v2/attack_protection.rb +79 -0
  13. data/lib/auth0/api/v2/device_credentials.rb +8 -3
  14. data/lib/auth0/api/v2/organizations.rb +2 -2
  15. data/lib/auth0/api/v2.rb +2 -0
  16. data/lib/auth0/mixins/validation.rb +4 -4
  17. data/lib/auth0/version.rb +1 -1
  18. data/spec/lib/auth0/api/v2/actions_spec.rb +13 -13
  19. data/spec/lib/auth0/api/v2/attack_protection_spec.rb +132 -0
  20. data/spec/lib/auth0/api/v2/blacklists_spec.rb +2 -2
  21. data/spec/lib/auth0/api/v2/branding_spec.rb +4 -3
  22. data/spec/lib/auth0/api/v2/client_grants_spec.rb +8 -8
  23. data/spec/lib/auth0/api/v2/clients_spec.rb +12 -12
  24. data/spec/lib/auth0/api/v2/connections_spec.rb +10 -10
  25. data/spec/lib/auth0/api/v2/device_credentials_spec.rb +39 -10
  26. data/spec/lib/auth0/api/v2/emails_spec.rb +2 -2
  27. data/spec/lib/auth0/api/v2/grants_spec.rb +10 -10
  28. data/spec/lib/auth0/api/v2/jobs_spec.rb +18 -17
  29. data/spec/lib/auth0/api/v2/log_streams_spec.rb +3 -3
  30. data/spec/lib/auth0/api/v2/logs_spec.rb +2 -2
  31. data/spec/lib/auth0/api/v2/organizations_spec.rb +14 -14
  32. data/spec/lib/auth0/api/v2/resource_servers_spec.rb +5 -5
  33. data/spec/lib/auth0/api/v2/roles_spec.rb +22 -22
  34. data/spec/lib/auth0/api/v2/rules_spec.rb +7 -7
  35. data/spec/lib/auth0/api/v2/stats_spec.rb +1 -1
  36. data/spec/lib/auth0/api/v2/tenants_spec.rb +1 -1
  37. data/spec/lib/auth0/api/v2/tickets_spec.rb +14 -14
  38. data/spec/lib/auth0/api/v2/user_blocks_spec.rb +2 -2
  39. data/spec/lib/auth0/api/v2/users_by_email_spec.rb +2 -2
  40. data/spec/lib/auth0/api/v2/users_spec.rb +23 -23
  41. data/spec/lib/auth0/mixins/validation_spec.rb +16 -2
  42. metadata +11 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d57247dc3db711110d8be1372f9679bdf5124e271ed9648c0a8f657c38daa76
4
- data.tar.gz: 81946438f3e11d42d628ed9da89a446ee72f3b10ee638cf058804b9bce35948b
3
+ metadata.gz: e54c493b04d5d9dcae2e7f60a12a209f772b032bbc2b301d02653fb47562df76
4
+ data.tar.gz: f1c6e009ac351743fea12e8d75c95eb0998fadf0b8bdabf27def1d8f930a5a57
5
5
  SHA512:
6
- metadata.gz: 057f873c48f31661967dcb8c9ec62ec275f0f5feef9777e1c88bb6e0fa16263522e4049e1c23d91f528c5f30d5c0404266ea21276e6bcdf3b716d70bbdf71f9d
7
- data.tar.gz: ab73c8c4d3691f11d1f426c175f3de2f163ca241db2461300e66c90028ad5c01c8dd4e7b46a50e9e12f28649f667597a5cac386bbad0a396dd469617a639f1d5
6
+ metadata.gz: 0aa658cbecc69ea43c1016287ebff0e3c5fe048f1ddde87580548a4ae475198e1a8637479007e4e5340d101d2b69a949dd6bccdf5065b10c3cad1f76459d575c
7
+ data.tar.gz: a27dc61f747d7e777b45bbb707724eb58e7a73317403dab70b6eb590d8661cb14a05a7a1761d510fd8b6d41596845689c07abb98d71ba8be853b648c10bfb5f3
data/.circleci/config.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  version: 2.1
2
+ orbs:
3
+ ship: auth0/ship@0.4.0
2
4
 
3
5
  matrix_ruby_versions: &matrix_ruby_versions
4
6
  matrix:
@@ -14,7 +16,7 @@ executors:
14
16
  type: string
15
17
  default: *default_ruby_version
16
18
  docker:
17
- - image: circleci/ruby:<< parameters.ruby_version >>
19
+ - image: cimg/ruby:<< parameters.ruby_version >>
18
20
 
19
21
  jobs:
20
22
  run-tests:
@@ -27,6 +29,8 @@ jobs:
27
29
  ruby_version: << parameters.ruby_version >>
28
30
  steps:
29
31
  - checkout
32
+ - run: gem install bundler:1.17.2
33
+ - run: rm Gemfile.lock
30
34
  - restore_cache:
31
35
  key: gems-v2-{{ checksum "Gemfile.lock" }}
32
36
  - run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
@@ -41,4 +45,14 @@ workflows:
41
45
  tests:
42
46
  jobs:
43
47
  - run-tests:
44
- <<: *matrix_ruby_versions
48
+ <<: *matrix_ruby_versions
49
+ - ship/ruby-publish:
50
+ context:
51
+ - publish-rubygems
52
+ - publish-gh
53
+ filters:
54
+ branches:
55
+ only:
56
+ - master
57
+ requires:
58
+ - run-tests
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+
4
+ - package-ecosystem: "bundler"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "daily"
8
+ ignore:
9
+ - dependency-name: "*"
10
+ update-types: ["version-update:semver-major"]
@@ -0,0 +1,28 @@
1
+ name: Semgrep
2
+
3
+ on:
4
+ pull_request: {}
5
+
6
+ push:
7
+ branches:
8
+ - master
9
+ - main
10
+
11
+ schedule:
12
+ - cron: '0 * * * *'
13
+
14
+ jobs:
15
+ semgrep:
16
+ name: Scan
17
+ runs-on: ubuntu-latest
18
+ container:
19
+ image: returntocorp/semgrep
20
+ if: (github.repository_owner == 'auth0')
21
+
22
+ steps:
23
+ - uses: actions/checkout@v3
24
+
25
+ - if: github.event.pull_request.draft == false && github.actor != 'dependabot[bot]'
26
+ run: semgrep ci
27
+ env:
28
+ SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
data/.gitignore CHANGED
@@ -11,7 +11,6 @@ coverage
11
11
  *.swo
12
12
  spec/auth0.yml
13
13
  .env
14
- /Gemfile.lock
15
14
  /.yardoc/checksums
16
15
  /.yardoc/complete
17
16
  /.yardoc/object_types
data/CHANGELOG.md CHANGED
@@ -1,4 +1,46 @@
1
- # Changelog
1
+ # Change Log
2
+
3
+ ## [v5.8.1](https://github.com/auth0/ruby-auth0/tree/v5.8.1) (2022-06-30)
4
+
5
+ [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v5.8.0...v5.8.1)
6
+
7
+ **Fixed**
8
+
9
+ - FIX: delete_organizations_members does not send `members` in body [\#345](https://github.com/auth0/ruby-auth0/pull/345) ([T-800](https://github.com/T-800))
10
+
11
+ **Security**
12
+
13
+ - Security: Update dependencies lockfile [\#348](https://github.com/auth0/ruby-auth0/pull/348) ([evansims](https://github.com/evansims))
14
+
15
+ ## [v5.8.0](https://github.com/auth0/ruby-auth0/tree/v5.8.0) (2022-03-25)
16
+
17
+ [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v5.7.0...v5.8.0)
18
+
19
+ **Added**
20
+
21
+ - Add parameters for pager to device_credentials method [\#318](https://github.com/auth0/ruby-auth0/pull/318) ([shibayu36](https://github.com/shibayu36))
22
+
23
+ **Fixed**
24
+
25
+ - Cache RS256 JWKS by url to allow for multiple Auth0 tenants per runtime [\#325](https://github.com/auth0/ruby-auth0/pull/325) ([rmm5t](https://github.com/rmm5t))
26
+ - Allow to pass nil to client_id arg of device_credentials [\#321](https://github.com/auth0/ruby-auth0/pull/321) ([shibayu36](https://github.com/shibayu36))
27
+
28
+ **Security**
29
+
30
+ - Bump nokogiri from 1.13.1 to 1.13.3 [\#320](https://github.com/auth0/ruby-auth0/pull/320) ([dependabot[bot]](https://github.com/apps/dependabot))
31
+
32
+ ## [v5.7.0](https://github.com/auth0/ruby-auth0/tree/v5.7.0) (2022-02-17)
33
+
34
+ [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v5.6.1...v5.7.0)
35
+
36
+ **Added**
37
+
38
+ - [SDK-3118] Add attack protection endpoints [\#316](https://github.com/auth0/ruby-auth0/pull/316) ([stevehobbsdev](https://github.com/stevehobbsdev))
39
+
40
+ **Fixed**
41
+
42
+ - [SDK-3106] Fix up tests for Ruby 3 and rspec-mocks update [\#313](https://github.com/auth0/ruby-auth0/pull/313) ([stevehobbsdev](https://github.com/stevehobbsdev))
43
+ - Fix #310: delete_organizations_member_roles should use delete_with_body instead of delete [\#311](https://github.com/auth0/ruby-auth0/pull/311) ([SanterreJo](https://github.com/SanterreJo))
2
44
 
3
45
  ## [v5.6.1](https://github.com/auth0/ruby-auth0/tree/v5.6.1) (2021-09-14)
4
46
 
data/Gemfile CHANGED
@@ -8,6 +8,7 @@ group :development do
8
8
  gem 'coveralls', require: false
9
9
  gem 'rubocop', require: false
10
10
  gem 'rubocop-rails', require: false
11
+ gem 'irb', require: false
11
12
  end
12
13
 
13
14
  group :test do
data/Gemfile.lock ADDED
@@ -0,0 +1,241 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ auth0 (5.8.1)
5
+ addressable (~> 2.8)
6
+ jwt (~> 2.3.0)
7
+ rest-client (~> 2.1)
8
+ retryable (~> 3.0)
9
+ zache (~> 0.12)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ actionpack (7.0.3)
15
+ actionview (= 7.0.3)
16
+ activesupport (= 7.0.3)
17
+ rack (~> 2.0, >= 2.2.0)
18
+ rack-test (>= 0.6.3)
19
+ rails-dom-testing (~> 2.0)
20
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
21
+ actionview (7.0.3)
22
+ activesupport (= 7.0.3)
23
+ builder (~> 3.1)
24
+ erubi (~> 1.4)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
27
+ activesupport (7.0.3)
28
+ concurrent-ruby (~> 1.0, >= 1.0.2)
29
+ i18n (>= 1.6, < 2)
30
+ minitest (>= 5.1)
31
+ tzinfo (~> 2.0)
32
+ addressable (2.8.0)
33
+ public_suffix (>= 2.0.2, < 5.0)
34
+ ast (2.4.2)
35
+ builder (3.2.4)
36
+ codecov (0.6.0)
37
+ simplecov (>= 0.15, < 0.22)
38
+ coderay (1.1.3)
39
+ concurrent-ruby (1.1.10)
40
+ coveralls (0.7.1)
41
+ multi_json (~> 1.3)
42
+ rest-client
43
+ simplecov (>= 0.7)
44
+ term-ansicolor
45
+ thor
46
+ crack (0.4.5)
47
+ rexml
48
+ crass (1.0.6)
49
+ diff-lcs (1.5.0)
50
+ docile (1.4.0)
51
+ domain_name (0.5.20190701)
52
+ unf (>= 0.0.5, < 1.0.0)
53
+ dotenv (2.7.6)
54
+ dotenv-rails (2.7.6)
55
+ dotenv (= 2.7.6)
56
+ railties (>= 3.2)
57
+ erubi (1.10.0)
58
+ faker (2.21.0)
59
+ i18n (>= 1.8.11, < 2)
60
+ ffi (1.15.5)
61
+ formatador (1.1.0)
62
+ fuubar (2.5.1)
63
+ rspec-core (~> 3.0)
64
+ ruby-progressbar (~> 1.4)
65
+ gem-release (0.7.4)
66
+ guard (2.17.0)
67
+ formatador (>= 0.2.4)
68
+ listen (>= 2.7, < 4.0)
69
+ lumberjack (>= 1.0.12, < 2.0)
70
+ nenv (~> 0.1)
71
+ notiffany (~> 0.0)
72
+ pry (>= 0.9.12)
73
+ shellany (~> 0.0)
74
+ thor (>= 0.18.1)
75
+ guard-compat (1.2.1)
76
+ guard-rspec (4.7.3)
77
+ guard (~> 2.1)
78
+ guard-compat (~> 1.1)
79
+ rspec (>= 2.99.0, < 4.0)
80
+ hashdiff (1.0.1)
81
+ http-accept (1.7.0)
82
+ http-cookie (1.0.5)
83
+ domain_name (~> 0.5)
84
+ i18n (1.10.0)
85
+ concurrent-ruby (~> 1.0)
86
+ io-console (0.5.11)
87
+ irb (1.4.1)
88
+ reline (>= 0.3.0)
89
+ json (2.6.2)
90
+ jwt (2.3.0)
91
+ listen (3.7.1)
92
+ rb-fsevent (~> 0.10, >= 0.10.3)
93
+ rb-inotify (~> 0.9, >= 0.9.10)
94
+ loofah (2.18.0)
95
+ crass (~> 1.0.2)
96
+ nokogiri (>= 1.5.9)
97
+ lumberjack (1.2.8)
98
+ method_source (0.9.2)
99
+ mime-types (3.4.1)
100
+ mime-types-data (~> 3.2015)
101
+ mime-types-data (3.2022.0105)
102
+ mini_portile2 (2.8.0)
103
+ minitest (5.16.1)
104
+ multi_json (1.15.0)
105
+ nenv (0.3.0)
106
+ netrc (0.11.0)
107
+ nokogiri (1.13.6)
108
+ mini_portile2 (~> 2.8.0)
109
+ racc (~> 1.4)
110
+ notiffany (0.1.3)
111
+ nenv (~> 0.1)
112
+ shellany (~> 0.0)
113
+ parallel (1.22.1)
114
+ parser (3.1.2.0)
115
+ ast (~> 2.4.1)
116
+ pry (0.12.2)
117
+ coderay (~> 1.1.0)
118
+ method_source (~> 0.9.0)
119
+ pry-nav (0.3.0)
120
+ pry (>= 0.9.10, < 0.13.0)
121
+ public_suffix (4.0.7)
122
+ racc (1.6.0)
123
+ rack (2.2.3.1)
124
+ rack-test (0.8.3)
125
+ rack (>= 1.0, < 3)
126
+ rails-dom-testing (2.0.3)
127
+ activesupport (>= 4.2.0)
128
+ nokogiri (>= 1.6)
129
+ rails-html-sanitizer (1.4.3)
130
+ loofah (~> 2.3)
131
+ railties (7.0.3)
132
+ actionpack (= 7.0.3)
133
+ activesupport (= 7.0.3)
134
+ method_source
135
+ rake (>= 12.2)
136
+ thor (~> 1.0)
137
+ zeitwerk (~> 2.5)
138
+ rainbow (3.1.1)
139
+ rake (13.0.6)
140
+ rb-fsevent (0.11.1)
141
+ rb-inotify (0.10.1)
142
+ ffi (~> 1.0)
143
+ regexp_parser (2.5.0)
144
+ reline (0.3.1)
145
+ io-console (~> 0.5)
146
+ rest-client (2.1.0)
147
+ http-accept (>= 1.7.0, < 2.0)
148
+ http-cookie (>= 1.0.2, < 2.0)
149
+ mime-types (>= 1.16, < 4.0)
150
+ netrc (~> 0.8)
151
+ retryable (3.0.5)
152
+ rexml (3.2.5)
153
+ rspec (3.11.0)
154
+ rspec-core (~> 3.11.0)
155
+ rspec-expectations (~> 3.11.0)
156
+ rspec-mocks (~> 3.11.0)
157
+ rspec-core (3.11.0)
158
+ rspec-support (~> 3.11.0)
159
+ rspec-expectations (3.11.0)
160
+ diff-lcs (>= 1.2.0, < 2.0)
161
+ rspec-support (~> 3.11.0)
162
+ rspec-mocks (3.11.1)
163
+ diff-lcs (>= 1.2.0, < 2.0)
164
+ rspec-support (~> 3.11.0)
165
+ rspec-support (3.11.0)
166
+ rubocop (1.31.1)
167
+ json (~> 2.3)
168
+ parallel (~> 1.10)
169
+ parser (>= 3.1.0.0)
170
+ rainbow (>= 2.2.2, < 4.0)
171
+ regexp_parser (>= 1.8, < 3.0)
172
+ rexml (>= 3.2.5, < 4.0)
173
+ rubocop-ast (>= 1.18.0, < 2.0)
174
+ ruby-progressbar (~> 1.7)
175
+ unicode-display_width (>= 1.4.0, < 3.0)
176
+ rubocop-ast (1.18.0)
177
+ parser (>= 3.1.1.0)
178
+ rubocop-rails (2.15.1)
179
+ activesupport (>= 4.2.0)
180
+ rack (>= 1.1)
181
+ rubocop (>= 1.7.0, < 2.0)
182
+ ruby-progressbar (1.11.0)
183
+ shellany (0.0.1)
184
+ simplecov (0.21.2)
185
+ docile (~> 1.1)
186
+ simplecov-html (~> 0.11)
187
+ simplecov_json_formatter (~> 0.1)
188
+ simplecov-html (0.12.3)
189
+ simplecov_json_formatter (0.1.4)
190
+ sync (0.5.0)
191
+ term-ansicolor (1.7.1)
192
+ tins (~> 1.0)
193
+ terminal-notifier-guard (1.7.0)
194
+ thor (1.2.1)
195
+ timecop (0.9.5)
196
+ tins (1.31.1)
197
+ sync
198
+ tzinfo (2.0.4)
199
+ concurrent-ruby (~> 1.0)
200
+ unf (0.1.4)
201
+ unf_ext
202
+ unf_ext (0.0.8.2)
203
+ unicode-display_width (2.2.0)
204
+ vcr (6.1.0)
205
+ webmock (3.14.0)
206
+ addressable (>= 2.8.0)
207
+ crack (>= 0.3.2)
208
+ hashdiff (>= 0.4.0, < 2.0.0)
209
+ zache (0.12.0)
210
+ zeitwerk (2.6.0)
211
+
212
+ PLATFORMS
213
+ ruby
214
+
215
+ DEPENDENCIES
216
+ auth0!
217
+ bundler
218
+ codecov
219
+ coveralls
220
+ dotenv-rails (~> 2.0)
221
+ faker (~> 2.0)
222
+ fuubar (~> 2.0)
223
+ gem-release (~> 0.7)
224
+ guard-rspec (~> 4.5)
225
+ irb
226
+ pry (~> 0.10)
227
+ pry-nav (~> 0.2)
228
+ rack (~> 2.1)
229
+ rack-test (~> 0.6)
230
+ rake (~> 13.0)
231
+ rspec (~> 3.5)
232
+ rubocop
233
+ rubocop-rails
234
+ simplecov
235
+ terminal-notifier-guard
236
+ timecop
237
+ vcr
238
+ webmock
239
+
240
+ BUNDLED WITH
241
+ 1.17.2
data/README.md CHANGED
@@ -45,7 +45,7 @@ end
45
45
  ... and a Controller to handle that route:
46
46
 
47
47
  ```ruby
48
- # app/controllers/all_users_controllers.rb
48
+ # app/controllers/all_users_controller.rb
49
49
  require 'auth0'
50
50
 
51
51
  class AllUsersController < ApplicationController
data/auth0.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.require_paths = ['lib']
18
18
 
19
19
  s.add_runtime_dependency 'rest-client', '~> 2.1'
20
- s.add_runtime_dependency 'jwt', '~> 2.2'
20
+ s.add_runtime_dependency 'jwt', '~> 2.3.0'
21
21
  s.add_runtime_dependency 'zache', '~> 0.12'
22
22
  s.add_runtime_dependency 'addressable', '~> 2.8'
23
23
  s.add_runtime_dependency 'retryable', '~> 3.0'
@@ -152,7 +152,7 @@ module Auth0
152
152
  # @param password [string] User's new password. This is only available
153
153
  # on legacy tenants with change password v1 flow enabled
154
154
  # @param connection_name [string] Database connection name
155
- # @deprecated Use {#password_reset} instead.
155
+ # @deprecated Use {#reset_password} instead.
156
156
  def change_password(email, password, connection_name = UP_AUTH)
157
157
  raise Auth0::InvalidParameter, 'Must supply a valid email' if email.to_s.empty?
158
158
 
@@ -0,0 +1,79 @@
1
+ module Auth0
2
+ module Api
3
+ module V2
4
+ # Methods to use the attack-protection endpoints
5
+ module AttackProtection
6
+ attr_reader :attack_protection_path
7
+
8
+ # Get breached password detection settings
9
+ # @see https://auth0.com/docs/api/management/v2#!/Attack_Protection/get_breached_password_detection
10
+ # @return [json] The configuration for breached password detection
11
+ def breached_password_detection
12
+ get(breached_password_settings_path)
13
+ end
14
+ alias get_breached_password_detection_settings breached_password_detection
15
+
16
+ # Update breached password detection settings
17
+ # @see https://auth0.com/docs/api/management/v2#!/Attack_Protection/patch_breached_password_detection
18
+ # @param body [hash] See https://auth0.com/docs/api/management/v2#!/Attack_Protection/patch_breached_password_detection for available options
19
+ # @return [json] The configuration for breached password detection
20
+ def patch_breached_password_detection(body)
21
+ patch(breached_password_settings_path, body)
22
+ end
23
+
24
+ # Get brute force protection settings.
25
+ # @see https://auth0.com/docs/api/management/v2#!/Attack_Protection/get_brute_force_protection
26
+ # @return [json] The configuration for brute force protection
27
+ def brute_force_protection
28
+ get(brute_force_protection_settings_path)
29
+ end
30
+ alias get_brute_force_protection_settings brute_force_protection
31
+
32
+ # Update brute force protection settings.
33
+ # @see https://auth0.com/docs/api/management/v2#!/Attack_Protection/patch_brute_force_protection
34
+ # @param body [hash] See https://auth0.com/docs/api/management/v2#!/Attack_Protection/patch_brute_force_protection for available options
35
+ # @return [json] The configuration for brute force protection
36
+ def patch_brute_force_protection(body)
37
+ patch(brute_force_protection_settings_path, body)
38
+ end
39
+ alias update_brute_force_protection_settings patch_brute_force_protection
40
+
41
+ # Get suspicious IP throttling settings
42
+ # @see https://auth0.com/docs/api/management/v2#!/Attack_Protection/get_suspicious_ip_throttling
43
+ # @return The configuration for suspicious IP throttling
44
+ def suspicious_ip_throttling
45
+ get(suspicious_ip_throttling_settings_path)
46
+ end
47
+ alias get_suspicious_ip_throttling_settings suspicious_ip_throttling
48
+
49
+ # Update suspicious IP throttling settings
50
+ # @see https://auth0.com/docs/api/management/v2#!/Attack_Protection/patch_suspicious_ip_throttling
51
+ # @param body [hash] See https://auth0.com/docs/api/management/v2#!/Attack_Protection/patch_suspicious_ip_throttling for available options
52
+ # @return The configuration for suspicious IP throttling
53
+ def patch_suspicious_ip_throttling(body)
54
+ patch(suspicious_ip_throttling_settings_path, body)
55
+ end
56
+ alias update_suspicious_ip_throttling_settings patch_suspicious_ip_throttling
57
+
58
+ private
59
+
60
+ def attack_protection_path
61
+ @attack_protection_path ||= '/api/v2/attack-protection'
62
+ end
63
+ alias update_breached_password_detection_settings patch_breached_password_detection
64
+
65
+ def breached_password_settings_path
66
+ "#{attack_protection_path}/breached-password-detection"
67
+ end
68
+
69
+ def brute_force_protection_settings_path
70
+ "#{attack_protection_path}/brute-force-protection"
71
+ end
72
+
73
+ def suspicious_ip_throttling_settings_path
74
+ "#{attack_protection_path}/suspicious-ip-throttling"
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -13,18 +13,23 @@ module Auth0
13
13
  # * :include_fields [boolean] True if the fields specified are to be included in the result, false otherwise.
14
14
  # * :user_id [string] The user_id of the devices to retrieve.
15
15
  # * :type [string] Type of credentials to retrieve. Must be 'public_key', 'refresh_token' or 'rotating_refresh_token'
16
+ # * :page [integer] The page number. Zero based
17
+ # * :per_page [integer] The amount of entries per page
18
+ # * :include_totals [boolean] Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).
16
19
  #
17
20
  # @return [json] Returns the list of existing devices for the specified client_id.
18
21
  # rubocop:disable Metrics/AbcSize
19
- def device_credentials(client_id, options = {})
22
+ def device_credentials(client_id = nil, options = {})
20
23
  request_params = {
21
24
  fields: options.fetch(:fields, nil),
22
25
  include_fields: options.fetch(:include_fields, nil),
23
26
  user_id: options.fetch(:user_id, nil),
24
27
  client_id: client_id,
25
- type: options.fetch(:type, nil)
28
+ type: options.fetch(:type, nil),
29
+ page: options.fetch(:page, nil),
30
+ per_page: options.fetch(:per_page, nil),
31
+ include_totals: options.fetch(:include_totals, nil)
26
32
  }
27
- raise Auth0::InvalidParameter, 'Must supply a valid client_id' if client_id.to_s.empty?
28
33
  if !request_params[:type].nil? && !%w(public_key refresh_token rotating_refresh_token).include?(request_params[:type])
29
34
  raise Auth0::InvalidParameter, 'Type must be one of \'public_key\', \'refresh_token\', \'rotating_refresh_token\''
30
35
  end
@@ -267,7 +267,7 @@ module Auth0
267
267
  body = {}
268
268
  body[:members] = members
269
269
 
270
- delete(path, body)
270
+ delete_with_body(path, body)
271
271
  end
272
272
  alias remove_organizations_members delete_organizations_members
273
273
 
@@ -320,7 +320,7 @@ module Auth0
320
320
  body = {}
321
321
  body[:roles] = roles
322
322
 
323
- delete(path, body)
323
+ delete_with_body(path, body)
324
324
  end
325
325
  alias remove_organizations_member_roles delete_organizations_member_roles
326
326
 
data/lib/auth0/api/v2.rb CHANGED
@@ -23,6 +23,7 @@ require 'auth0/api/v2/logs'
23
23
  require 'auth0/api/v2/log_streams'
24
24
  require 'auth0/api/v2/resource_servers'
25
25
  require 'auth0/api/v2/guardian'
26
+ require 'auth0/api/v2/attack_protection'
26
27
 
27
28
  module Auth0
28
29
  module Api
@@ -53,6 +54,7 @@ module Auth0
53
54
  include Auth0::Api::V2::ResourceServers
54
55
  include Auth0::Api::V2::Tenants
55
56
  include Auth0::Api::V2::Tickets
57
+ include Auth0::Api::V2::AttackProtection
56
58
  end
57
59
  end
58
60
  end
@@ -286,7 +286,7 @@ module Auth0
286
286
 
287
287
  # Clear the JWK set cache.
288
288
  def remove_jwks
289
- @@cache.remove(:jwks)
289
+ @@cache.remove_by { true }
290
290
  end
291
291
  end
292
292
 
@@ -311,13 +311,13 @@ module Auth0
311
311
  result = fetch_jwks if force
312
312
 
313
313
  if result
314
- @@cache.put(:jwks, result, lifetime: @lifetime)
314
+ @@cache.put(@jwks_url, result, lifetime: @lifetime)
315
315
  return result
316
316
  end
317
317
 
318
- previous_value = @@cache.last(:jwks)
318
+ previous_value = @@cache.last(@jwks_url)
319
319
 
320
- @@cache.get(:jwks, lifetime: @lifetime, dirty: true) do
320
+ @@cache.get(@jwks_url, lifetime: @lifetime, dirty: true) do
321
321
  new_value = fetch_jwks
322
322
 
323
323
  raise Auth0::InvalidIdToken, 'Could not fetch the JWK set' unless new_value || previous_value
data/lib/auth0/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # current version of gem
2
2
  module Auth0
3
- VERSION = '5.6.1'.freeze
3
+ VERSION = '5.8.1'.freeze
4
4
  end