auth0 4.13.0 → 4.17.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c38a319b2eed5120bf74fa4c97ec09cc2f445995216a47e455fddf721b320af3
4
- data.tar.gz: 025013d61adde5fa27095f50978601851304f3ccd9db40a8826e8a3c0e0857da
3
+ metadata.gz: 48e61f0781f7f7414219fe6f2aa406fa5f11df18707e04ef242a062c4775f6f0
4
+ data.tar.gz: 5d0f5d8fd83e4f77624394c8fd968a2b167f3f2bdeef3f7b60012df3ec28e8e4
5
5
  SHA512:
6
- metadata.gz: 324b485bfdf6d0043aa0344a0f8dfe296edac94dc6ce8ef86a89cd8993a5e7ae3c558051475bd192b9ea8846597f427c7a2b2c8f39c885ac7eb516fd5032fa45
7
- data.tar.gz: 20eaf5dfe12c4006df1d0746a1ab60143d465a7c39e123a357d614a8717c403dd3ee83d8251012d683a43606a3f5af92a76dc65a1aaf9fb39005de613bac134f
6
+ metadata.gz: '055290cd6f89e5da0e8316bb805268d84d29108abff3c0afe133a286de5718cf9d1d394873a64a08b456b6fa8c24246347010eaf0e7d1ec6d1f7856165255b58'
7
+ data.tar.gz: ab47cf7f1728afcd517d8d59b01e06b8857c8a7f5b2e4028bb931d4939548ec565b0385894eb05320e0419955dc43b2203024e3ba090a8459cc1d5b7eca978a9
@@ -1,5 +1,61 @@
1
1
  # Change Log
2
2
 
3
+ ## [v4.17.1](https://github.com/auth0/ruby-auth0/tree/v4.17.1) (2020-10-21)
4
+
5
+ [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v4.17.0...v4.17.1)
6
+
7
+ **Fixed**
8
+
9
+ - Addressable dependency [\#247](https://github.com/auth0/ruby-auth0/pull/247) ([davidpatrick](https://github.com/davidpatrick))
10
+
11
+
12
+ ## [v4.17.0](https://github.com/auth0/ruby-auth0/tree/v4.17.0) (2020-10-19)
13
+
14
+ [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v4.16.0...v4.17.0)
15
+
16
+ **Added**
17
+
18
+ - Add pagination to user permissions [\#241](https://github.com/auth0/ruby-auth0/pull/241) ([davidpatrick](https://github.com/davidpatrick))
19
+
20
+ **Deprecated**
21
+
22
+ - Addressable URI Escape [\#240](https://github.com/auth0/ruby-auth0/pull/240) ([davidpatrick](https://github.com/apps/davidpatrick))
23
+
24
+
25
+ ## [v4.16.0](https://github.com/auth0/ruby-auth0/tree/v4.16.0) (2020-10-02)
26
+
27
+ [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v4.15.0...v4.16.0)
28
+
29
+ **Added**
30
+
31
+ - New Email Verification Fields [\#237](https://github.com/auth0/ruby-auth0/pull/237) ([davidpatrick](https://github.com/davidpatrick))
32
+
33
+ **Security**
34
+
35
+ - Bump actionview from 6.0.3.2 to 6.0.3.3 [\#236](https://github.com/auth0/ruby-auth0/pull/236) ([dependabot[bot]](https://github.com/apps/dependabot))
36
+
37
+ ## [v4.15.0](https://github.com/auth0/ruby-auth0/tree/v4.15.0) (2020-09-04)
38
+
39
+ **Added**
40
+
41
+ - Add log streaming endpoints [\#233](https://github.com/auth0/ruby-auth0/pull/233) ([davidpatrick](https://github.com/davidpatrick))
42
+
43
+ ## [v4.14.0](https://github.com/auth0/ruby-auth0/tree/v4.14.0) (2020-07-20)
44
+
45
+ [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v4.13.0...v4.14.0)
46
+
47
+ **Deprecated**
48
+
49
+ - Deprecate mgmt v1 calls [\#230](https://github.com/auth0/ruby-auth0/pull/230) ([davidpatrick](https://github.com/davidpatrick))
50
+
51
+ **Removed**
52
+
53
+ - Remove iat claim value check [\#229](https://github.com/auth0/ruby-auth0/pull/229) ([lbalmaceda](https://github.com/lbalmaceda))
54
+
55
+ **Fixed**
56
+
57
+ - Handle missing reset header [\#228](https://github.com/auth0/ruby-auth0/pull/228) ([Widcket](https://github.com/Widcket))
58
+
3
59
  ## [v4.13.0](https://github.com/auth0/ruby-auth0/tree/v4.13.0) (2020-06-18)
4
60
 
5
61
  [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v4.12.0...v4.13.0)
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- auth0 (4.13.0)
4
+ auth0 (4.17.1)
5
+ addressable (~> 2.7.0)
5
6
  jwt (~> 2.2.0)
6
7
  rest-client (~> 2.0.0)
7
8
  zache (~> 0.12.0)
@@ -9,20 +10,20 @@ PATH
9
10
  GEM
10
11
  remote: https://rubygems.org/
11
12
  specs:
12
- actionpack (6.0.3.2)
13
- actionview (= 6.0.3.2)
14
- activesupport (= 6.0.3.2)
13
+ actionpack (6.0.3.3)
14
+ actionview (= 6.0.3.3)
15
+ activesupport (= 6.0.3.3)
15
16
  rack (~> 2.0, >= 2.0.8)
16
17
  rack-test (>= 0.6.3)
17
18
  rails-dom-testing (~> 2.0)
18
19
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
19
- actionview (6.0.3.2)
20
- activesupport (= 6.0.3.2)
20
+ actionview (6.0.3.3)
21
+ activesupport (= 6.0.3.3)
21
22
  builder (~> 3.1)
22
23
  erubi (~> 1.4)
23
24
  rails-dom-testing (~> 2.0)
24
25
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
25
- activesupport (6.0.3.2)
26
+ activesupport (6.0.3.3)
26
27
  concurrent-ruby (~> 1.0, >= 1.0.2)
27
28
  i18n (>= 0.7, < 2)
28
29
  minitest (~> 5.1)
@@ -32,29 +33,27 @@ GEM
32
33
  public_suffix (>= 2.0.2, < 5.0)
33
34
  ast (2.4.1)
34
35
  builder (3.2.4)
35
- codecov (0.1.17)
36
+ codecov (0.2.11)
36
37
  json
37
38
  simplecov
38
- url
39
39
  coderay (1.1.3)
40
- concurrent-ruby (1.1.6)
40
+ concurrent-ruby (1.1.7)
41
41
  coveralls (0.7.1)
42
42
  multi_json (~> 1.3)
43
43
  rest-client
44
44
  simplecov (>= 0.7)
45
45
  term-ansicolor
46
46
  thor
47
- crack (0.4.3)
48
- safe_yaml (~> 1.0.0)
47
+ crack (0.4.4)
49
48
  crass (1.0.6)
50
- diff-lcs (1.3)
49
+ diff-lcs (1.4.4)
51
50
  docile (1.3.2)
52
51
  domain_name (0.5.20190701)
53
52
  unf (>= 0.0.5, < 1.0.0)
54
- dotenv (2.7.5)
55
- dotenv-rails (2.7.5)
56
- dotenv (= 2.7.5)
57
- railties (>= 3.2, < 6.1)
53
+ dotenv (2.7.6)
54
+ dotenv-rails (2.7.6)
55
+ dotenv (= 2.7.6)
56
+ railties (>= 3.2)
58
57
  erubi (1.9.0)
59
58
  faker (1.9.6)
60
59
  i18n (>= 0.7)
@@ -81,41 +80,41 @@ GEM
81
80
  hashdiff (1.0.1)
82
81
  http-cookie (1.0.3)
83
82
  domain_name (~> 0.5)
84
- i18n (1.8.3)
83
+ i18n (1.8.5)
85
84
  concurrent-ruby (~> 1.0)
86
- json (2.3.0)
87
- jwt (2.2.1)
85
+ json (2.3.1)
86
+ jwt (2.2.2)
88
87
  listen (3.2.1)
89
88
  rb-fsevent (~> 0.10, >= 0.10.3)
90
89
  rb-inotify (~> 0.9, >= 0.9.10)
91
- loofah (2.6.0)
90
+ loofah (2.7.0)
92
91
  crass (~> 1.0.2)
93
92
  nokogiri (>= 1.5.9)
94
- lumberjack (1.2.5)
93
+ lumberjack (1.2.8)
95
94
  method_source (0.8.2)
96
95
  mime-types (3.3.1)
97
96
  mime-types-data (~> 3.2015)
98
97
  mime-types-data (3.2020.0512)
99
98
  mini_portile2 (2.4.0)
100
- minitest (5.14.1)
101
- multi_json (1.14.1)
99
+ minitest (5.14.2)
100
+ multi_json (1.15.0)
102
101
  nenv (0.3.0)
103
102
  netrc (0.11.0)
104
- nokogiri (1.10.9)
103
+ nokogiri (1.10.10)
105
104
  mini_portile2 (~> 2.4.0)
106
105
  notiffany (0.1.3)
107
106
  nenv (~> 0.1)
108
107
  shellany (~> 0.0)
109
108
  parallel (1.19.2)
110
- parser (2.7.1.3)
111
- ast (~> 2.4.0)
109
+ parser (2.7.1.5)
110
+ ast (~> 2.4.1)
112
111
  pry (0.10.4)
113
112
  coderay (~> 1.1.0)
114
113
  method_source (~> 0.8.1)
115
114
  slop (~> 3.4)
116
115
  pry-nav (0.2.4)
117
116
  pry (>= 0.9.10, < 0.11.0)
118
- public_suffix (4.0.5)
117
+ public_suffix (4.0.6)
119
118
  rack (2.1.4)
120
119
  rack-test (0.8.3)
121
120
  rack (>= 1.0, < 3)
@@ -124,9 +123,9 @@ GEM
124
123
  nokogiri (>= 1.6)
125
124
  rails-html-sanitizer (1.3.0)
126
125
  loofah (~> 2.3)
127
- railties (6.0.3.2)
128
- actionpack (= 6.0.3.2)
129
- activesupport (= 6.0.3.2)
126
+ railties (6.0.3.3)
127
+ actionpack (= 6.0.3.3)
128
+ activesupport (= 6.0.3.3)
130
129
  method_source
131
130
  rake (>= 0.8.7)
132
131
  thor (>= 0.20.3, < 2.0)
@@ -135,7 +134,7 @@ GEM
135
134
  rb-fsevent (0.10.4)
136
135
  rb-inotify (0.10.1)
137
136
  ffi (~> 1.0)
138
- regexp_parser (1.7.1)
137
+ regexp_parser (1.8.1)
139
138
  rest-client (2.0.2)
140
139
  http-cookie (>= 1.0.2, < 2.0)
141
140
  mime-types (>= 1.16, < 4.0)
@@ -145,7 +144,7 @@ GEM
145
144
  rspec-core (~> 3.9.0)
146
145
  rspec-expectations (~> 3.9.0)
147
146
  rspec-mocks (~> 3.9.0)
148
- rspec-core (3.9.2)
147
+ rspec-core (3.9.3)
149
148
  rspec-support (~> 3.9.3)
150
149
  rspec-expectations (3.9.2)
151
150
  diff-lcs (>= 1.2.0, < 2.0)
@@ -154,28 +153,27 @@ GEM
154
153
  diff-lcs (>= 1.2.0, < 2.0)
155
154
  rspec-support (~> 3.9.0)
156
155
  rspec-support (3.9.3)
157
- rubocop (0.85.1)
156
+ rubocop (0.92.0)
158
157
  parallel (~> 1.10)
159
- parser (>= 2.7.0.1)
158
+ parser (>= 2.7.1.5)
160
159
  rainbow (>= 2.2.2, < 4.0)
161
160
  regexp_parser (>= 1.7)
162
161
  rexml
163
- rubocop-ast (>= 0.0.3)
162
+ rubocop-ast (>= 0.5.0)
164
163
  ruby-progressbar (~> 1.7)
165
164
  unicode-display_width (>= 1.4.0, < 2.0)
166
- rubocop-ast (0.0.3)
167
- parser (>= 2.7.0.1)
168
- rubocop-rails (2.6.0)
165
+ rubocop-ast (0.7.1)
166
+ parser (>= 2.7.1.5)
167
+ rubocop-rails (2.8.1)
169
168
  activesupport (>= 4.2.0)
170
169
  rack (>= 1.1)
171
- rubocop (>= 0.82.0)
170
+ rubocop (>= 0.87.0)
172
171
  ruby-progressbar (1.10.1)
173
- safe_yaml (1.0.5)
174
172
  shellany (0.0.1)
175
- simplecov (0.18.5)
173
+ simplecov (0.19.0)
176
174
  docile (~> 1.1)
177
175
  simplecov-html (~> 0.11)
178
- simplecov-html (0.12.2)
176
+ simplecov-html (0.12.3)
179
177
  slop (3.6.0)
180
178
  sync (0.5.0)
181
179
  term-ansicolor (1.7.1)
@@ -191,15 +189,14 @@ GEM
191
189
  unf_ext
192
190
  unf_ext (0.0.7.7)
193
191
  unicode-display_width (1.7.0)
194
- url (0.3.2)
195
192
  vcr (6.0.0)
196
- webmock (3.8.3)
193
+ webmock (3.9.1)
197
194
  addressable (>= 2.3.6)
198
195
  crack (>= 0.3.2)
199
196
  hashdiff (>= 0.4.0, < 2.0.0)
200
197
  yard (0.9.25)
201
198
  zache (0.12.0)
202
- zeitwerk (2.3.0)
199
+ zeitwerk (2.4.0)
203
200
 
204
201
  PLATFORMS
205
202
  ruby
data/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
  [![codecov](https://codecov.io/gh/auth0/ruby-auth0/branch/master/graph/badge.svg)](https://codecov.io/gh/auth0/ruby-auth0)
6
6
  [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/auth0/ruby-auth0/master/frames)
7
7
  [![MIT licensed](https://img.shields.io/dub/l/vibe-d.svg?style=flat)](https://github.com/auth0/ruby-auth0/blob/master/LICENSE)
8
+ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauth0%2Fruby-auth0.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauth0%2Fruby-auth0?ref=badge_shield)
8
9
 
9
10
  Ruby API client for the [Auth0](https://auth0.com) platform.
10
11
 
@@ -234,3 +235,6 @@ If you find a bug or have a feature request, please report them in this reposito
234
235
  ## License
235
236
 
236
237
  This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.
238
+
239
+
240
+ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fauth0%2Fruby-auth0.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fauth0%2Fruby-auth0?ref=badge_large)
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.add_runtime_dependency 'rest-client', '~> 2.0.0'
20
20
  s.add_runtime_dependency 'jwt', '~> 2.2.0'
21
21
  s.add_runtime_dependency 'zache', '~> 0.12.0'
22
+ s.add_runtime_dependency 'addressable', '~> 2.7.0'
22
23
 
23
24
  s.add_development_dependency 'rake', '~> 13.0'
24
25
  s.add_development_dependency 'fuubar', '~> 2.0'
@@ -4,7 +4,10 @@ module Auth0
4
4
  # {https://auth0.com/docs/api#applications}
5
5
  module Clients
6
6
  # {https://auth0.com/docs/api#!#get--api-clients}
7
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
8
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
7
9
  def clients
10
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
8
11
  path = '/api/clients'
9
12
  get(path)
10
13
  end
@@ -12,7 +15,10 @@ module Auth0
12
15
  alias get_clients clients
13
16
 
14
17
  # {https://auth0.com/docs/api#!#post--api-clients}
18
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
19
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
15
20
  def create_client(name, callbacks = '')
21
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
16
22
  path = '/api/clients'
17
23
  request_params = {
18
24
  name: name,
@@ -21,10 +27,11 @@ module Auth0
21
27
  post(path, request_params)
22
28
  end
23
29
 
24
- # @deprecated use {#patch_client}
25
30
  # {https://auth0.com/docs/api#!#put--api-clients--client-id-}
31
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
32
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
26
33
  def update_client(name, callbacks = '', client_id = @client_id)
27
- warn 'This endpoint has been deprecated in favor of PATCH.'
34
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
28
35
  path = "/api/clients/#{client_id}"
29
36
  request_params = {
30
37
  name: name,
@@ -34,7 +41,10 @@ module Auth0
34
41
  end
35
42
 
36
43
  # {https://auth0.com/docs/api#!#patch--api-clients--client-id-}
44
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
45
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
37
46
  def patch_client(name, callbacks = '', client_id = @client_id)
47
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
38
48
  path = "/api/clients/#{client_id}"
39
49
  request_params = {
40
50
  name: name,
@@ -4,26 +4,38 @@ module Auth0
4
4
  # {https://auth0.com/docs/api#connections}
5
5
  module Connections
6
6
  # {https://auth0.com/docs/api#!#get--api-connections}
7
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
8
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
7
9
  def connections
10
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
8
11
  get('/api/connections')
9
12
  end
10
13
  alias get_connections connections
11
14
 
12
15
  # {https://auth0.com/docs/api#!#get--api-connections--connection-name-}
16
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
17
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
13
18
  def connection(connection_name)
19
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
14
20
  path = "/api/connections/#{connection_name}"
15
21
  get(path)
16
22
  end
17
23
  alias get_connection connection
18
24
 
19
25
  # {https://auth0.com/docs/api#!#delete--api-connections--connection-name-}
26
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
27
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
20
28
  def delete_connection(connection_name)
29
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
21
30
  path = "/api/connections/#{connection_name}"
22
31
  delete(path)
23
32
  end
24
33
 
25
34
  # {https://auth0.com/docs/api#!#post--api-connections}
35
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
36
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
26
37
  def create_connection(connection_name, strategy, tenant_domain, domain_aliases = nil)
38
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
27
39
  path = '/api/connections'
28
40
  request_params = {
29
41
  name: connection_name,
@@ -37,7 +49,10 @@ module Auth0
37
49
  end
38
50
 
39
51
  # {https://auth0.com/docs/api#!#put--api-connections--connection-name-}
52
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
53
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
40
54
  def update_connection(connection_name, tenant_domain, status = true)
55
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
41
56
  path = "/api/connections/#{connection_name}"
42
57
  request_params = {
43
58
  status: status,
@@ -4,7 +4,10 @@ module Auth0
4
4
  # {https://auth0.com/docs/api#logs}
5
5
  module Logs
6
6
  # https://auth0.com/docs/api/v1#!#logs
7
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Logs
8
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
7
9
  def logs(options = {})
10
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
8
11
  acceptable_params = %i(take from search_criteria page per_page sort fields exclude_fields)
9
12
  options.reject! do |key, value|
10
13
  next unless key.nil? || value.nil? || !acceptable_params.include?(key.to_sym)
@@ -18,13 +21,19 @@ module Auth0
18
21
  alias search_logs logs
19
22
 
20
23
  # {https://auth0.com/docs/api#!#get--api-logs--_id-}
24
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Logs
25
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
21
26
  def log(id)
27
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
22
28
  path = "/api/logs/#{id}"
23
29
  get(path)
24
30
  end
25
31
 
26
32
  # {https://auth0.com/docs/api#!#get--api-users--user_id--logs-page--number--per_page--items-}
33
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Logs
34
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
27
35
  def user_logs(user_id, page = 0, per_page = 50)
36
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
28
37
  path = "/api/users/#{user_id}/logs?page=#{page}&per_page=#{per_page}"
29
38
  get(path)
30
39
  end
@@ -4,7 +4,10 @@ module Auth0
4
4
  # https://auth0.com/docs/api#rules
5
5
  module Rules
6
6
  # https://auth0.com/docs/api#!#get--api-rules
7
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
8
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
7
9
  def rules
10
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
8
11
  path = '/api/rules'
9
12
  get(path)
10
13
  end
@@ -12,7 +15,10 @@ module Auth0
12
15
  alias get_rules rules
13
16
 
14
17
  # https://auth0.com/docs/api#!#post--api-rules
18
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
19
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
15
20
  def create_rule(name, script, order = nil, status = true)
21
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
16
22
  path = '/api/rules'
17
23
  request_params = {
18
24
  name: name,
@@ -24,7 +30,10 @@ module Auth0
24
30
  end
25
31
 
26
32
  # https://auth0.com/docs/api#!#put--api-rules--rule-name-
33
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
34
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
27
35
  def update_rule(name, script, order = nil, status = true)
36
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
28
37
  path = "/api/rules/#{name}"
29
38
  request_params = {
30
39
  status: status,
@@ -35,7 +44,10 @@ module Auth0
35
44
  end
36
45
 
37
46
  # https://auth0.com/docs/api#!#delete--api-rules--rule-name-
47
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
48
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
38
49
  def delete_rule(name)
50
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
39
51
  path = "/api/rules/#{name}"
40
52
  delete(path)
41
53
  end
@@ -7,7 +7,10 @@ module Auth0
7
7
  # {https://auth0.com/docs/api#!#get--api-users}
8
8
  #
9
9
  # {https://auth0.com/docs/api#!#get--api-users-search--criteria-}
10
+ # @deprecated - 4.14.0, please use Auth0::Api::V2::Users
11
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
10
12
  def users(search = nil)
13
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
11
14
  path = '/api/users'
12
15
  path += "?search=#{search}" unless search.to_s.empty?
13
16
  get(path)
@@ -17,7 +20,10 @@ module Auth0
17
20
  alias get_users users
18
21
 
19
22
  # {https://auth0.com/docs/api#!#get--api-users--user_id-}
23
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
24
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
20
25
  def user(user_id)
26
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
21
27
  path = "/api/users/#{user_id}"
22
28
  get(path)
23
29
  end
@@ -25,14 +31,20 @@ module Auth0
25
31
  alias get_user user
26
32
 
27
33
  # {https://auth0.com/docs/api#!#get--api-users--user_id--devices}
34
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
35
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
28
36
  def user_devices(user_id)
37
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
29
38
  path = "/api/users/#{user_id}/devices"
30
39
  get(path)
31
40
  end
32
41
 
33
42
  # {https://auth0.com/docs/api#!#get--api-connections--connection--users}
34
43
  # {https://auth0.com/docs/api#!#get--api-connections--connection--users-search--criteria-}
44
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
45
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
35
46
  def connection_users(connection_name, search = nil)
47
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
36
48
  path = "/api/connections/#{connection_name}/users"
37
49
  path += "?search=#{search}" unless search.to_s.empty?
38
50
  get(path)
@@ -41,25 +53,37 @@ module Auth0
41
53
  alias search_connection_users connection_users
42
54
 
43
55
  # {https://auth0.com/docs/api#!#get--api-enterpriseconnections-users-search--criteria-}
56
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
57
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
44
58
  def enterpriseconnections_users(search_criteria = nil, per_page = 500)
59
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
45
60
  path = "/api/enterpriseconnections/users?search=#{search_criteria}&per_page=#{per_page.to_i}"
46
61
  get(path)
47
62
  end
48
63
 
49
64
  # {https://auth0.com/docs/api#!#get--api-socialconnections-users-search--criteria-}
65
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
66
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
50
67
  def socialconnections_users(search_criteria = nil, per_page = 500)
68
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
51
69
  path = "/api/socialconnections/users?search=#{search_criteria}&per_page=#{per_page.to_i}"
52
70
  get(path)
53
71
  end
54
72
 
55
73
  # {https://auth0.com/docs/api#!#get--api-clients--client-id--users}
74
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
75
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
56
76
  def client_users(client_id = @client_id)
77
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
57
78
  path = "/api/clients/#{client_id}/users"
58
79
  get(path)
59
80
  end
60
81
 
61
82
  # {https://auth0.com/docs/api#!#post--api-users}
83
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
84
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
62
85
  def create_user(email, password, connection_name, request_params = {})
86
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
63
87
  options = { email: email, password: password, connection: connection_name }
64
88
  request_params.merge!(options)
65
89
  path = '/api/users'
@@ -67,55 +91,79 @@ module Auth0
67
91
  end
68
92
 
69
93
  # {https://auth0.com/docs/api#!#post--api-users--user_id--send_verification_email}
94
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
95
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
70
96
  def send_verification_email(user_id)
97
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
71
98
  path = "/api/users/#{user_id}/send_verification_email"
72
99
  post(path)
73
100
  end
74
101
 
75
102
  # {https://auth0.com/docs/api#!#post--api-users--user_id--change_password_ticket}
103
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
104
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
76
105
  def change_password_ticket(user_id, new_password, result_url = nil)
106
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
77
107
  request_params = { 'newPassword' => new_password, 'resultUrl' => result_url }
78
108
  path = "/api/users/#{user_id}/change_password_ticket"
79
109
  post(path, request_params)
80
110
  end
81
111
 
82
112
  # {https://auth0.com/docs/api#!#post--api-users--user_id--verification_ticket}
113
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
114
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
83
115
  def verification_ticket(user_id, result_url = nil)
116
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
84
117
  request_params = { 'resultUrl' => result_url }
85
118
  path = "/api/users/#{user_id}/verification_ticket"
86
119
  post(path, request_params)
87
120
  end
88
121
 
89
122
  # {https://auth0.com/docs/api#!#post--api-users--user_id--publickey}
123
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
124
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
90
125
  def create_public_key(user_id, device, public_key)
126
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
91
127
  path = "/api/users/#{user_id}/public_key"
92
128
  request_params = { device: device, public_key: public_key }
93
129
  post(path, request_params)
94
130
  end
95
131
 
96
132
  # {https://auth0.com/docs/api#!#put--api-users--user_id--email}
133
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
134
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
97
135
  def update_user_email(user_id, email, verify = true)
136
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
98
137
  path = "/api/users/#{user_id}/email"
99
138
  request_params = { email: email, verify: verify }
100
139
  put(path, request_params)
101
140
  end
102
141
 
103
142
  # {https://auth0.com/docs/api#!#put--api-users--user_id--metadata}
143
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
144
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
104
145
  # This will overwrite user's metadata, be really carefull, preffer using patch instead
105
146
  def update_user_metadata(user_id, metadata = {})
147
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
106
148
  path = "/api/users/#{user_id}/metadata"
107
149
  put(path, metadata)
108
150
  end
109
151
 
110
152
  # {https://auth0.com/docs/api#!#put--api-users--user_id--password}
153
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
154
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
111
155
  def update_user_password(user_id, password, verify = true)
156
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
112
157
  path = "/api/users/#{user_id}/password"
113
158
  request_params = { password: password, verify: verify }
114
159
  put(path, request_params)
115
160
  end
116
161
 
117
162
  # {https://auth0.com/docs/api#!#put--api-users--email--password}
163
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
164
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
118
165
  def update_user_password_using_email(email, password, connection_name, verify = true)
166
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
119
167
  request_params = {
120
168
  email: email,
121
169
  password: password,
@@ -127,34 +175,49 @@ module Auth0
127
175
  end
128
176
 
129
177
  # {https://auth0.com/docs/api#!#patch--api-users--user_id--metadata}
178
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
179
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
130
180
  def patch_user_metadata(user_id, metadata = {})
181
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
131
182
  path = "/api/users/#{user_id}/metadata"
132
183
  patch(path, metadata)
133
184
  end
134
185
 
135
186
  # {https://auth0.com/docs/api#!#delete--api-users}
187
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
188
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
136
189
  #
137
190
  # This will remove all your users
138
191
  def delete_users
192
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
139
193
  path = '/api/users/'
140
194
  delete(path)
141
195
  end
142
196
 
143
197
  # {https://auth0.com/docs/api#!#delete--api-users--user_id-}
198
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
199
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
144
200
  def delete_user(user_id)
201
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
145
202
  raise Auth0::MissingUserId, 'if you want to remove all users use delete_users method' if user_id.to_s.empty?
146
203
  path = "/api/users/#{user_id}"
147
204
  delete(path)
148
205
  end
149
206
 
150
207
  # {https://auth0.com/docs/api#!#delete--api-users--user_id--refresh_tokens--refresh_token-}
208
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
209
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
151
210
  def revoke_user_refresh_token(user_id, refresh_token)
211
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
152
212
  path = "/api/users/#{user_id}/refresh_tokens/#{refresh_token}"
153
213
  delete(path)
154
214
  end
155
215
 
156
216
  # {https://auth0.com/docs/api#!#delete--api-users--user_id--publickey-device--device-}
217
+ # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
218
+ # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
157
219
  def revoke_user_device_public_key(user_id, device)
220
+ warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
158
221
  path = "/api/users/#{user_id}/publickey?device=#{device}"
159
222
  delete(path)
160
223
  end
@@ -16,6 +16,7 @@ require 'auth0/api/v2/user_blocks'
16
16
  require 'auth0/api/v2/tenants'
17
17
  require 'auth0/api/v2/tickets'
18
18
  require 'auth0/api/v2/logs'
19
+ require 'auth0/api/v2/log_streams'
19
20
  require 'auth0/api/v2/resource_servers'
20
21
  require 'auth0/api/v2/guardian'
21
22
 
@@ -41,6 +42,7 @@ module Auth0
41
42
  include Auth0::Api::V2::Tenants
42
43
  include Auth0::Api::V2::Tickets
43
44
  include Auth0::Api::V2::Logs
45
+ include Auth0::Api::V2::LogStreams
44
46
  include Auth0::Api::V2::ResourceServers
45
47
  include Auth0::Api::V2::Guardian
46
48
  end
@@ -78,14 +78,24 @@ module Auth0
78
78
  # @see https://auth0.com/docs/api/management/v2#!/Jobs/post_verification_email
79
79
  # @param user_id [string] The user_id of the user to whom the email will be sent.
80
80
  # @param client_id [string] Client ID to send an Application-specific email.
81
+ # @param identity [hash] Used to verify secondary, federated, and passwordless-email identities.
82
+ # * :user_id [string] user_id of the identity.
83
+ # * :provider [string] provider of the identity.
81
84
  #
82
85
  # @return [json] Returns the job status and properties.
83
- def send_verification_email(user_id, client_id = nil)
86
+ def send_verification_email(user_id, client_id = nil, identity: nil)
84
87
  raise Auth0::InvalidParameter, 'Must specify a user id' if user_id.to_s.empty?
85
88
 
86
89
  request_params = { user_id: user_id }
87
90
  request_params[:client_id] = client_id unless client_id.nil?
88
91
 
92
+ if identity
93
+ unless identity.is_a? Hash
94
+ raise Auth0::InvalidParameter, 'Identity must be a hash send an email verification'
95
+ end
96
+ request_params[:identity] = identity
97
+ end
98
+
89
99
  path = "#{jobs_path}/verification-email"
90
100
  post(path, request_params)
91
101
  end
@@ -0,0 +1,78 @@
1
+ module Auth0
2
+ module Api
3
+ module V2
4
+ # Methods to use the log streams endpoints
5
+ module LogStreams
6
+ attr_reader :log_streams_path
7
+
8
+ # Retrieves a list of all log streams.
9
+ # @see https://auth0.com/docs/api/management/v2#!/Log_Streams/get_log_streams
10
+ # @return [json] Returns the log streams.
11
+ def log_streams()
12
+ get(log_streams_path)
13
+ end
14
+ alias get_log_streams log_streams
15
+
16
+ # Retrieves a log stream by its ID.
17
+ # @see https://auth0.com/docs/api/management/v2#!/Log_Streams/get_log_streams_by_id
18
+ # @param id [string] The id of the log stream to retrieve.
19
+ #
20
+ # @return [json] Returns the log stream.
21
+ def log_stream(id)
22
+ raise Auth0::InvalidParameter, 'Must supply a valid log stream id' if id.to_s.empty?
23
+ path = "#{log_streams_path}/#{id}"
24
+ get(path)
25
+ end
26
+ alias get_log_stream log_stream
27
+
28
+ # Creates a new log stream according to the JSON object received in body.
29
+ # @see https://auth0.com/docs/api/management/v2#!/Log_Streams/post_log_streams
30
+ # @param name [string] The name of the log stream.
31
+ # @param type [string] The type of log stream
32
+ # @param options [hash] The Hash options used to define the log streams's properties.
33
+ #
34
+ # @return [json] Returns the log stream.
35
+ def create_log_stream(name, type, options)
36
+ raise Auth0::InvalidParameter, 'Name must contain at least one character' if name.to_s.empty?
37
+ raise Auth0::InvalidParameter, 'Must specify a valid type' if type.to_s.empty?
38
+ raise Auth0::InvalidParameter, 'Must supply a valid hash for options' unless options.is_a? Hash
39
+
40
+ request_params = {}
41
+ request_params[:name] = name
42
+ request_params[:type] = type
43
+ request_params[:sink] = options
44
+ post(log_streams_path, request_params)
45
+ end
46
+
47
+ # Deletes a log stream by its ID.
48
+ # @see https://auth0.com/docs/api/management/v2#!/Log_Streams/delete_log_streams_by_id
49
+ # @param id [string] The id of the log stream to delete.
50
+ def delete_log_stream(id)
51
+ raise Auth0::InvalidParameter, 'Must supply a valid log stream id' if id.to_s.empty?
52
+ path = "#{log_streams_path}/#{id}"
53
+ delete(path)
54
+ end
55
+
56
+ # Updates a log stream.
57
+ # @see https://auth0.com/docs/api/management/v2#!/Log_Streams/patch_log_streams_by_id
58
+ # @param id [string] The id or audience of the log stream to update.
59
+ # @param status [string] The Hash options used to define the log streams's properties.
60
+ def patch_log_stream(id, status)
61
+ raise Auth0::InvalidParameter, 'Must specify a log stream id' if id.to_s.empty?
62
+ raise Auth0::InvalidParameter, 'Must specify a valid status' if status.to_s.empty?
63
+
64
+ request_params = {}
65
+ request_params[:status] = status
66
+ path = "#{log_streams_path}/#{id}"
67
+ patch(path, request_params)
68
+ end
69
+
70
+ private
71
+ # Log Streams API path
72
+ def log_streams_path
73
+ @log_streams_path ||= '/api/v2/log-streams'
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -12,9 +12,12 @@ module Auth0
12
12
  # @param ttl_sec [integer] The ticket's lifetime in seconds starting from the moment of creation.
13
13
  # After expiration, the ticket cannot be used to verify the user's email. If not specified or if
14
14
  # you send 0, the Auth0 default lifetime of five days will be applied
15
+ # @param identity [hash] Used to verify secondary, federated, and passwordless-email identities.
16
+ # * :user_id [string] user_id of the identity.
17
+ # * :provider [string] provider of the identity.
15
18
  #
16
19
  # @return [json] Returns the created ticket url.
17
- def post_email_verification(user_id, result_url: nil, ttl_sec: nil)
20
+ def post_email_verification(user_id, result_url: nil, ttl_sec: nil, identity: nil)
18
21
  if user_id.to_s.empty?
19
22
  raise Auth0::InvalidParameter, 'Must supply a valid user id to post an email verification'
20
23
  end
@@ -24,6 +27,14 @@ module Auth0
24
27
  result_url: result_url,
25
28
  ttl_sec: ttl_sec.is_a?(Integer) ? ttl_sec : nil
26
29
  }
30
+
31
+ if identity
32
+ unless identity.is_a? Hash
33
+ raise Auth0::InvalidParameter, 'Identity must be a hash to post an email verification'
34
+ end
35
+ request_params[:identity] = identity
36
+ end
37
+
27
38
  post(path, request_params)
28
39
  end
29
40
 
@@ -248,11 +248,22 @@ module Auth0
248
248
  # @see https://auth0.com/docs/api/management/v2#!/Users/get_permissions
249
249
  #
250
250
  # @param user_id [string] The user_id of the permissions to get.
251
+ # @param options [hash] A hash of options for getting permissions
252
+ # * :per_page [integer] The amount of permissions per page. (optional)
253
+ # * :page [integer] The page number. Zero based. (optional)
254
+ # * :include_totals [boolean] True if a query summary must be included in the result. (optional)
251
255
  #
252
256
  # @return [json] Returns permissions for the given user_id.
253
- def get_user_permissions(user_id)
257
+ def get_user_permissions(user_id, options = {})
254
258
  raise Auth0::MissingUserId, 'Must supply a valid user_id' if user_id.to_s.empty?
255
- get "#{users_path}/#{user_id}/permissions"
259
+
260
+ request_params = {
261
+ per_page: options.fetch(:per_page, nil),
262
+ page: options.fetch(:page, nil),
263
+ include_totals: options.fetch(:include_totals, nil)
264
+ }
265
+
266
+ get "#{users_path}/#{user_id}/permissions", request_params
256
267
  end
257
268
 
258
269
  # Remove one or more permissions from a specific user.
@@ -1,3 +1,5 @@
1
+ require "addressable/uri"
2
+
1
3
  module Auth0
2
4
  module Mixins
3
5
  # here's the proxy for Rest calls based on rest-client, we're building all request on that gem
@@ -8,7 +10,7 @@ module Auth0
8
10
  # proxying requests from instance methods to HTTP class methods
9
11
  %i(get post post_file put patch delete delete_with_body).each do |method|
10
12
  define_method(method) do |path, body = {}, extra_headers = {}|
11
- safe_path = URI.escape(path)
13
+ safe_path = Addressable::URI.escape(path)
12
14
  body = body.delete_if { |_, v| v.nil? }
13
15
  result = if method == :get
14
16
  # Mutate the headers property to add parameters.
@@ -171,14 +171,6 @@ module Auth0
171
171
  unless claims.key?('iat') && claims['iat'].is_a?(Integer)
172
172
  raise Auth0::InvalidIdToken, 'Issued At (iat) claim must be a number present in the ID token'
173
173
  end
174
-
175
- now = @context[:clock] || Time.now.to_i
176
- iat_time = claims['iat'] - leeway
177
-
178
- unless now > iat_time
179
- raise Auth0::InvalidIdToken, "Issued At (iat) claim mismatch in the ID token; current time \"#{now}\""\
180
- " is before issued at time \"#{iat_time}\""
181
- end
182
174
  end
183
175
 
184
176
  def validate_nonce(claims, expected)
@@ -1,4 +1,4 @@
1
1
  # current version of gem
2
2
  module Auth0
3
- VERSION = '4.13.0'.freeze
3
+ VERSION = '4.17.1'.freeze
4
4
  end
@@ -100,6 +100,18 @@ describe Auth0::Api::V2::Jobs do
100
100
  client.send_verification_email(user['user_id'], Random.new(32).to_s)
101
101
  end.to raise_error Auth0::BadRequest
102
102
  end
103
+
104
+ it 'should raise an error if the user id is empty' do
105
+ expect do
106
+ client.send_verification_email( '' )
107
+ end.to raise_error Auth0::InvalidParameter, 'Must specify a user id'
108
+ end
109
+
110
+ it 'should raise an error if the identity supplied is not a Hash' do
111
+ expect do
112
+ client.send_verification_email( 'user_id', identity: 'not a hash')
113
+ end.to raise_error Auth0::InvalidParameter, 'Identity must be a hash send an email verification'
114
+ end
103
115
  end
104
116
 
105
117
  after(:all) do
@@ -35,7 +35,13 @@ describe Auth0::Api::V2::Tickets do
35
35
  it 'should raise an error if the user id is empty' do
36
36
  expect do
37
37
  client.post_email_verification( '' )
38
- end.to raise_error Auth0::InvalidParameter
38
+ end.to raise_error Auth0::InvalidParameter, 'Must supply a valid user id to post an email verification'
39
+ end
40
+
41
+ it 'should raise an error if the identity supplied is not a Hash' do
42
+ expect do
43
+ client.post_email_verification( '', identity: 'not a hash')
44
+ end.to raise_error Auth0::InvalidParameter, 'Must supply a valid user id to post an email verification'
39
45
  end
40
46
  end
41
47
 
@@ -102,6 +102,23 @@ describe Auth0::Api::V2::Jobs do
102
102
  end.not_to raise_error
103
103
  end
104
104
 
105
+ it 'expect client to accept hash identity' do
106
+ expect(@instance).to receive(:post).with('/api/v2/jobs/verification-email', user_id: 'user_id',
107
+ identity: {
108
+ provider: "auth0",
109
+ user_id: "user_id"
110
+ })
111
+ expect {
112
+ @instance.send_verification_email('user_id', identity: { provider: "auth0", user_id: "user_id"})
113
+ }.not_to raise_error
114
+ end
115
+
116
+ it 'expect client to return nil when calling with a non-hash identity' do
117
+ expect { @instance.send_verification_email('user_id', identity: "nonhash") }.to raise_error(
118
+ 'Identity must be a hash send an email verification'
119
+ )
120
+ end
121
+
105
122
  it 'should raise an error if the user_id is empty' do
106
123
  expect do
107
124
  @instance.send_verification_email('')
@@ -0,0 +1,84 @@
1
+ require 'spec_helper'
2
+ describe Auth0::Api::V2::LogStreams do
3
+ before :all do
4
+ dummy_instance = DummyClass.new
5
+ dummy_instance.extend(Auth0::Api::V2::LogStreams)
6
+ dummy_instance.extend(Auth0::Mixins::Initializer)
7
+ @instance = dummy_instance
8
+ end
9
+
10
+ context '.log_streams' do
11
+ it { expect(@instance).to respond_to(:log_streams) }
12
+ it { expect(@instance).to respond_to(:get_log_streams) }
13
+ it 'is expected to call get /api/v2/log-streams' do
14
+ expect(@instance).to receive(:get).with(
15
+ '/api/v2/log-streams'
16
+ )
17
+ expect { @instance.log_streams }.not_to raise_error
18
+ end
19
+ end
20
+
21
+ context '.log_stream' do
22
+ it { expect(@instance).to respond_to(:log_stream) }
23
+ it 'is expected to call get /api/v2/log-streams/test' do
24
+ expect(@instance).to receive(:get).with('/api/v2/log-streams/test')
25
+ expect { @instance.log_stream('test') }.not_to raise_error
26
+ end
27
+ it 'expect to raise an error when calling with empty log stream id' do
28
+ expect { @instance.log_stream(nil) }.to raise_error 'Must supply a valid log stream id'
29
+ end
30
+ end
31
+
32
+ context '.create_log_stream' do
33
+ it { expect(@instance).to respond_to(:create_log_stream) }
34
+ it 'is expected to call post /api/v2/log-streams' do
35
+ expect(@instance).to receive(:post).with(
36
+ '/api/v2/log-streams',
37
+ name: 'test',
38
+ type: 'https',
39
+ sink: {
40
+ httpEndpoint: "https://mycompany.com",
41
+ httpContentType: "string",
42
+ httpContentFormat: "JSONLINES",
43
+ httpAuthorization: "string"
44
+ }
45
+ )
46
+
47
+ @instance.create_log_stream('test', 'https',
48
+ httpEndpoint: "https://mycompany.com",
49
+ httpContentType: "string",
50
+ httpContentFormat: "JSONLINES",
51
+ httpAuthorization: "string")
52
+ end
53
+ it 'expect to raise an error when calling with empty name' do
54
+ expect { @instance.create_log_stream('', '', '') }.to raise_error 'Name must contain at least one character'
55
+ end
56
+ it 'expect to raise an error when calling with empty type' do
57
+ expect { @instance.create_log_stream('name', '', '') }.to raise_error 'Must specify a valid type'
58
+ end
59
+ it 'expect to raise an error when calling without options' do
60
+ expect { @instance.create_log_stream('name', 'https', nil) }.to raise_error 'Must supply a valid hash for options'
61
+ end
62
+ end
63
+
64
+ context '.delete_log_stream' do
65
+ it { expect(@instance).to respond_to(:delete_log_stream) }
66
+ it 'is expected to call delete /api/v2/log-streams/test' do
67
+ expect(@instance).to receive(:delete).with('/api/v2/log-streams/test')
68
+ expect { @instance.delete_log_stream('test') }.not_to raise_error
69
+ end
70
+ it 'expect to raise an error when calling with empty log stream id' do
71
+ expect { @instance.delete_log_stream(nil) }.to raise_error 'Must supply a valid log stream id'
72
+ end
73
+ end
74
+
75
+ context '.patch_log_stream' do
76
+ it { expect(@instance).to respond_to(:patch_log_stream) }
77
+ it 'is expected to send patch to /api/v2/log_streams/test' do
78
+ expect(@instance).to receive(:patch).with('/api/v2/log-streams/test', status: 'paused')
79
+ expect { @instance.patch_log_stream('test', 'paused') }.not_to raise_error
80
+ end
81
+ it { expect { @instance.patch_log_stream('', nil) }.to raise_error 'Must specify a log stream id' }
82
+ it { expect { @instance.patch_log_stream('test', nil) }.to raise_error 'Must specify a valid status' }
83
+ end
84
+ end
@@ -21,6 +21,23 @@ describe Auth0::Api::V2::Tickets do
21
21
  result_url: nil, ttl_sec: nil)
22
22
  expect { @instance.post_email_verification('user_id', ttl_sec: "noninteger") }.not_to raise_error
23
23
  end
24
+ it 'expect client to accept hash identity' do
25
+ expect(@instance).to receive(:post).with('/api/v2/tickets/email-verification', user_id: 'user_id',
26
+ result_url: nil,
27
+ ttl_sec: nil,
28
+ identity: {
29
+ provider: "auth0",
30
+ user_id: "user_id"
31
+ })
32
+ expect {
33
+ @instance.post_email_verification('user_id', identity: { provider: "auth0", user_id: "user_id"})
34
+ }.not_to raise_error
35
+ end
36
+ it 'expect client to return nil when calling with a non-hash identity' do
37
+ expect { @instance.post_email_verification('user_id', identity: "nonhash") }.to raise_error(
38
+ 'Identity must be a hash to post an email verification'
39
+ )
40
+ end
24
41
  it 'expect client to rasie error when calling with empty body' do
25
42
  expect { @instance.post_email_verification(nil) }.to raise_error(
26
43
  'Must supply a valid user id to post an email verification'
@@ -390,11 +390,28 @@ describe Auth0::Api::V2::Users do
390
390
  end
391
391
 
392
392
  it 'is expected to get permissions' do
393
- expect(@instance).to receive(:get).with('/api/v2/users/USER_ID/permissions')
393
+ expect(@instance).to receive(:get).with(
394
+ '/api/v2/users/USER_ID/permissions',
395
+ per_page: nil,
396
+ page: nil,
397
+ include_totals: nil,
398
+ )
394
399
  expect do
395
400
  @instance.get_user_permissions('USER_ID')
396
401
  end.not_to raise_error
397
402
  end
403
+
404
+ it 'is expected to get permissions with custom parameters' do
405
+ expect(@instance).to receive(:get).with(
406
+ '/api/v2/users/USER_ID/permissions',
407
+ per_page: 10,
408
+ page: 3,
409
+ include_totals: true
410
+ )
411
+ expect do
412
+ @instance.get_user_permissions('USER_ID', per_page: 10, page: 3, include_totals: true)
413
+ end.not_to raise_error
414
+ end
398
415
  end
399
416
 
400
417
  context '.remove_permissions' do
@@ -141,7 +141,7 @@ describe Auth0::Mixins::HTTPProxy do
141
141
  expect { @instance.send(http_method, '/test') }.to raise_error(Auth0::ServerError)
142
142
  end
143
143
 
144
- it 'should escape path with URI.escape' do
144
+ it 'should escape path with Addressable::URI.escape' do
145
145
  expect(RestClient::Request).to receive(:execute).with(method: http_method,
146
146
  url: '/te%20st',
147
147
  timeout: nil,
@@ -275,7 +275,7 @@ describe Auth0::Mixins::HTTPProxy do
275
275
  expect { @instance.send(http_method, '/test') }.to raise_error(Auth0::ServerError)
276
276
  end
277
277
 
278
- it 'should escape path with URI.escape' do
278
+ it 'should escape path with Addressable::URI.escape' do
279
279
  expect(RestClient::Request).to receive(:execute).with(method: http_method,
280
280
  url: '/te%20st',
281
281
  timeout: nil,
@@ -229,14 +229,6 @@ describe Auth0::Mixins::Validation::IdTokenValidator do
229
229
  expect { @instance.validate(token) }.to raise_exception('Issued At (iat) claim must be a number present in the ID token')
230
230
  end
231
231
 
232
- it 'is expected to raise an error with a invalid iat' do
233
- token = 'eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC05OTkiXSwiZXhwIjoxNTg3NzY1MzYxLCJpYXQiOjE1ODc3NjUzNjEsIm5vbmNlIjoiYTFiMmMzZDRlNSIsImF6cCI6InRva2Vucy10ZXN0LTEyMyIsImF1dGhfdGltZSI6MTU4NzY3ODk2MX0.1AeRLTaExbKnmsfNduUl3HArsau4RcNrnmYOJnkPWi0'
234
- clock = CLOCK - LEEWAY - 1
235
- instance = Auth0::Mixins::Validation::IdTokenValidator.new(CONTEXT.merge({ clock: clock }))
236
-
237
- expect { instance.validate(token) }.to raise_exception("Issued At (iat) claim mismatch in the ID token; current time \"#{clock}\" is before issued at time \"1587765301\"")
238
- end
239
-
240
232
  it 'is expected not to raise an error with a missing but not required nonce' do
241
233
  token = 'eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rva2Vucy10ZXN0LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHwxMjM0NTY3ODkiLCJhdWQiOlsidG9rZW5zLXRlc3QtMTIzIiwiZXh0ZXJuYWwtdGVzdC05OTkiXSwiZXhwIjoxNTg3NzY1MzYxLCJpYXQiOjE1ODc1OTI1NjEsImF6cCI6InRva2Vucy10ZXN0LTEyMyIsImF1dGhfdGltZSI6MTU4NzY3ODk2MX0.-o5grnyODbBdRgzcrn7Sf9Hb6eOC0x_U2i3YjVgHN0U'
242
234
 
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth0
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.13.0
4
+ version: 4.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Auth0
8
8
  - Jose Romaniello
9
9
  - Ivan Petroe
10
10
  - Patrik Ragnarsson
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-06-19 00:00:00.000000000 Z
14
+ date: 2020-10-21 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rest-client
@@ -55,6 +55,20 @@ dependencies:
55
55
  - - "~>"
56
56
  - !ruby/object:Gem::Version
57
57
  version: 0.12.0
58
+ - !ruby/object:Gem::Dependency
59
+ name: addressable
60
+ requirement: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - "~>"
63
+ - !ruby/object:Gem::Version
64
+ version: 2.7.0
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: 2.7.0
58
72
  - !ruby/object:Gem::Dependency
59
73
  name: rake
60
74
  requirement: !ruby/object:Gem::Requirement
@@ -368,6 +382,7 @@ files:
368
382
  - lib/auth0/api/v2/emails.rb
369
383
  - lib/auth0/api/v2/guardian.rb
370
384
  - lib/auth0/api/v2/jobs.rb
385
+ - lib/auth0/api/v2/log_streams.rb
371
386
  - lib/auth0/api/v2/logs.rb
372
387
  - lib/auth0/api/v2/prompts.rb
373
388
  - lib/auth0/api/v2/resource_servers.rb
@@ -589,6 +604,7 @@ files:
589
604
  - spec/lib/auth0/api/v2/emails_spec.rb
590
605
  - spec/lib/auth0/api/v2/guardian_spec.rb
591
606
  - spec/lib/auth0/api/v2/jobs_spec.rb
607
+ - spec/lib/auth0/api/v2/log_streams_spec.rb
592
608
  - spec/lib/auth0/api/v2/logs_spec.rb
593
609
  - spec/lib/auth0/api/v2/prompts_spec.rb
594
610
  - spec/lib/auth0/api/v2/resource_servers_spec.rb
@@ -615,7 +631,7 @@ homepage: https://github.com/auth0/ruby-auth0
615
631
  licenses:
616
632
  - MIT
617
633
  metadata: {}
618
- post_install_message:
634
+ post_install_message:
619
635
  rdoc_options: []
620
636
  require_paths:
621
637
  - lib
@@ -631,7 +647,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
631
647
  version: '0'
632
648
  requirements: []
633
649
  rubygems_version: 3.1.2
634
- signing_key:
650
+ signing_key:
635
651
  specification_version: 4
636
652
  summary: Auth0 API Client
637
653
  test_files:
@@ -832,6 +848,7 @@ test_files:
832
848
  - spec/lib/auth0/api/v2/emails_spec.rb
833
849
  - spec/lib/auth0/api/v2/guardian_spec.rb
834
850
  - spec/lib/auth0/api/v2/jobs_spec.rb
851
+ - spec/lib/auth0/api/v2/log_streams_spec.rb
835
852
  - spec/lib/auth0/api/v2/logs_spec.rb
836
853
  - spec/lib/auth0/api/v2/prompts_spec.rb
837
854
  - spec/lib/auth0/api/v2/resource_servers_spec.rb