auth0 5.3.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d21b8018643c7c1fbe1749efc7bd375c6fca4bc67b8a7f6c1036bf17594c886
4
- data.tar.gz: 7b89fc89c380469c0db6c86ddd4f00e6c1502a68c5f13c4bfcbbc35d58c6a23f
3
+ metadata.gz: fc12c7c72ce796f0bc1a7599037731d8561438b610c45c7401e164f5c0ffa78e
4
+ data.tar.gz: a821ee4bccbaa05ecef61d586c36d6088318eaf28f254ee78f387740b4949725
5
5
  SHA512:
6
- metadata.gz: 93fc45bd2a0c457d2f387291eb77cfabcad12c68bfa95d012b9ceeff3b62e25dfd31e8bd7ea67047c89a131f99ef375beb87dedaaabbaae391d6c210860b25cd
7
- data.tar.gz: 694021376e92ab80198642919be1c2b94d27eb74a75862c4fdc15509251339faa6dd7eda013f7ab06df202ee4beeceab7465dfa0ae53b454e30c05e6338dbe09
6
+ metadata.gz: 758ede4765b01d316a9dab22abc0d4ecc315d1e743e8700d5451f61f70e4f8d57c5a3561dfe96f0732546139ff39696e12e16d5ff20daf5e168f726ca1c1d571
7
+ data.tar.gz: f29e16f61158cbc0651a0b76429032c61c5cde9006ce267d008d9f7ac5ce91136a575e64f419be937df7add6e0f36e7e88e5ea3afa2ea3a654d8c2d7123ef1b2
data/.gitignore CHANGED
@@ -12,3 +12,8 @@ coverage
12
12
  spec/auth0.yml
13
13
  .env
14
14
  /Gemfile.lock
15
+ /.yardoc/checksums
16
+ /.yardoc/complete
17
+ /.yardoc/object_types
18
+ /.yardoc/objects/root.dat
19
+ /.yardoc/proxy_types
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## [v5.4.0](https://github.com/auth0/ruby-auth0/tree/v5.4.0) (2021-07-23)
4
+
5
+ [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v5.3.0..v5.4.0)
6
+
7
+ **Fixed**
8
+
9
+ - Fixing yard issues with documentation [\#288](https://github.com/auth0/ruby-auth0/pull/288) ([davidpatrick](https://github.com/davidpatrick))
10
+
11
+ **Changed**
12
+
13
+ - Change strategy when normalizing path [\#287](https://github.com/auth0/ruby-auth0/pull/287) ([davidpatrick](https://github.com/davidpatrick))
14
+
3
15
  ## [v5.3.0](https://github.com/auth0/ruby-auth0/tree/v5.3.0) (2021-07-23)
4
16
 
5
17
  [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v5.2.0..v5.3.0)
@@ -35,7 +35,6 @@ module Auth0
35
35
 
36
36
  # Delete template for New Universal Login Experience
37
37
  # @see https://auth0.com/docs/api/management/v2/#!/Branding/delete_universal_login
38
- # @param rule_id [string] The id of the rule to delete.
39
38
  def delete_branding_templates_for_universal_login
40
39
  delete(templates_path)
41
40
  end
@@ -9,8 +9,15 @@ module Auth0
9
9
 
10
10
  # proxying requests from instance methods to HTTP class methods
11
11
  %i(get post post_file put patch delete delete_with_body).each do |method|
12
- define_method(method) do |path, body = {}, extra_headers = {}|
13
- safe_path = Addressable::URI.escape(path)
12
+ define_method(method) do |uri, body = {}, extra_headers = {}|
13
+
14
+ if base_uri
15
+ # if a base_uri is set then the uri can be encoded as a path
16
+ safe_path = Addressable::URI.new(path: uri).normalized_path
17
+ else
18
+ safe_path = Addressable::URI.escape(uri)
19
+ end
20
+
14
21
  body = body.delete_if { |_, v| v.nil? }
15
22
  result = if method == :get
16
23
  # Mutate the headers property to add parameters.
data/lib/auth0/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # current version of gem
2
2
  module Auth0
3
- VERSION = '5.3.0'.freeze
3
+ VERSION = '5.4.0'.freeze
4
4
  end
@@ -5,6 +5,8 @@ describe Auth0::Mixins::HTTPProxy do
5
5
  before :each do
6
6
  dummy_instance = DummyClassForProxy.new
7
7
  dummy_instance.extend(Auth0::Mixins::HTTPProxy)
8
+ dummy_instance.base_uri = "https://auth0.com"
9
+
8
10
  @instance = dummy_instance
9
11
  @exception = DummyClassForRestClient.new
10
12
  end
@@ -14,7 +16,7 @@ describe Auth0::Mixins::HTTPProxy do
14
16
  it { expect(@instance).to respond_to(http_method.to_sym) }
15
17
  it "should call send http #{http_method} method to path defined through HTTP" do
16
18
  expect(RestClient::Request).to receive(:execute).with(method: http_method,
17
- url: '/test',
19
+ url: 'https://auth0.com/test',
18
20
  timeout: nil,
19
21
  headers: { params: {} },
20
22
  payload: nil)
@@ -24,7 +26,7 @@ describe Auth0::Mixins::HTTPProxy do
24
26
 
25
27
  it 'should not raise exception if data returned not in json format (should be fixed in v2)' do
26
28
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
27
- url: '/test',
29
+ url: 'https://auth0.com/test',
28
30
  timeout: nil,
29
31
  headers: { params: {} },
30
32
  payload: nil)
@@ -36,7 +38,7 @@ describe Auth0::Mixins::HTTPProxy do
36
38
  it "should raise Auth0::Unauthorized on send http #{http_method}
37
39
  method to path defined through HTTP when 401 status received" do
38
40
  expect(RestClient::Request).to receive(:execute).with(method: http_method,
39
- url: '/test',
41
+ url: 'https://auth0.com/test',
40
42
  timeout: nil,
41
43
  headers: { params: {} },
42
44
  payload: nil)
@@ -47,7 +49,7 @@ describe Auth0::Mixins::HTTPProxy do
47
49
  it "should raise Auth0::NotFound on send http #{http_method} method
48
50
  to path defined through HTTP when 404 status received" do
49
51
  expect(RestClient::Request).to receive(:execute).with(method: http_method,
50
- url: '/test',
52
+ url: 'https://auth0.com/test',
51
53
  timeout: nil,
52
54
  headers: { params: {} },
53
55
  payload: nil)
@@ -58,7 +60,7 @@ describe Auth0::Mixins::HTTPProxy do
58
60
  it "should raise Auth0::Unsupported on send http #{http_method} method
59
61
  to path defined through HTTP when 418 or other unknown status received" do
60
62
  expect(RestClient::Request).to receive(:execute).with(method: http_method,
61
- url: '/test',
63
+ url: 'https://auth0.com/test',
62
64
  timeout: nil,
63
65
  headers: { params: {} },
64
66
  payload: nil)
@@ -69,7 +71,7 @@ describe Auth0::Mixins::HTTPProxy do
69
71
  it "should raise Auth0::RequestTimeout on send http #{http_method} method
70
72
  to path defined through HTTP when RestClient::RequestTimeout received" do
71
73
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
72
- url: '/test',
74
+ url: 'https://auth0.com/test',
73
75
  timeout: nil,
74
76
  headers: { params: {} },
75
77
  payload: nil)
@@ -81,7 +83,7 @@ describe Auth0::Mixins::HTTPProxy do
81
83
  to path defined through HTTP when 400 status received" do
82
84
  @exception.response = StubResponse.new({}, false, 400)
83
85
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
84
- url: '/test',
86
+ url: 'https://auth0.com/test',
85
87
  timeout: nil,
86
88
  headers: { params: {} },
87
89
  payload: nil)
@@ -93,7 +95,7 @@ describe Auth0::Mixins::HTTPProxy do
93
95
  to path defined through HTTP when 403" do
94
96
  @exception.response = StubResponse.new({}, false, 403)
95
97
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
96
- url: '/test',
98
+ url: 'https://auth0.com/test',
97
99
  timeout: nil,
98
100
  headers: { params: {} },
99
101
  payload: nil)
@@ -110,7 +112,7 @@ describe Auth0::Mixins::HTTPProxy do
110
112
  }
111
113
  @exception.response = StubResponse.new({}, false, 429, headers)
112
114
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
113
- url: '/test',
115
+ url: 'https://auth0.com/test',
114
116
  timeout: nil,
115
117
  headers: { params: {} },
116
118
  payload: nil)
@@ -133,7 +135,7 @@ describe Auth0::Mixins::HTTPProxy do
133
135
  to path defined through HTTP when 500 received" do
134
136
  @exception.response = StubResponse.new({}, false, 500)
135
137
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
136
- url: '/test',
138
+ url: 'https://auth0.com/test',
137
139
  timeout: nil,
138
140
  headers: { params: {} },
139
141
  payload: nil)
@@ -141,14 +143,14 @@ describe Auth0::Mixins::HTTPProxy do
141
143
  expect { @instance.send(http_method, '/test') }.to raise_error(Auth0::ServerError)
142
144
  end
143
145
 
144
- it 'should escape path with Addressable::URI.escape' do
146
+ it 'should normalize path with Addressable::URI' do
145
147
  expect(RestClient::Request).to receive(:execute).with(method: http_method,
146
- url: '/te%20st',
148
+ url: 'https://auth0.com/te%20st%23test',
147
149
  timeout: nil,
148
150
  headers: { params: {} },
149
151
  payload: nil)
150
152
  .and_return(StubResponse.new({}, true, 200))
151
- expect { @instance.send(http_method, '/te st') }.not_to raise_error
153
+ expect { @instance.send(http_method, '/te st#test') }.not_to raise_error
152
154
  end
153
155
  end
154
156
  end
@@ -158,7 +160,7 @@ describe Auth0::Mixins::HTTPProxy do
158
160
  it { expect(@instance).to respond_to(http_method.to_sym) }
159
161
  it "should call send http #{http_method} method to path defined through HTTP" do
160
162
  expect(RestClient::Request).to receive(:execute).with(method: http_method,
161
- url: '/test',
163
+ url: 'https://auth0.com/test',
162
164
  timeout: nil,
163
165
  headers: nil,
164
166
  payload: '{}')
@@ -168,7 +170,7 @@ describe Auth0::Mixins::HTTPProxy do
168
170
 
169
171
  it 'should not raise exception if data returned not in json format (should be fixed in v2)' do
170
172
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
171
- url: '/test',
173
+ url: 'https://auth0.com/test',
172
174
  timeout: nil,
173
175
  headers: nil,
174
176
  payload: '{}')
@@ -181,7 +183,7 @@ describe Auth0::Mixins::HTTPProxy do
181
183
  to path defined through HTTP when 401 status received" do
182
184
  @exception.response = StubResponse.new({}, false, 401)
183
185
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
184
- url: '/test',
186
+ url: 'https://auth0.com/test',
185
187
  timeout: nil,
186
188
  headers: nil,
187
189
  payload: '{}')
@@ -198,7 +200,7 @@ describe Auth0::Mixins::HTTPProxy do
198
200
  }
199
201
  @exception.response = StubResponse.new({}, false, 429,headers)
200
202
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
201
- url: '/test',
203
+ url: 'https://auth0.com/test',
202
204
  timeout: nil,
203
205
  headers: nil,
204
206
  payload: '{}')
@@ -221,7 +223,7 @@ describe Auth0::Mixins::HTTPProxy do
221
223
  to path defined through HTTP when 404 status received" do
222
224
  @exception.response = StubResponse.new({}, false, 404)
223
225
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
224
- url: '/test',
226
+ url: 'https://auth0.com/test',
225
227
  timeout: nil,
226
228
  headers: nil,
227
229
  payload: '{}')
@@ -233,7 +235,7 @@ describe Auth0::Mixins::HTTPProxy do
233
235
  to path defined through HTTP when 418 or other unknown status received" do
234
236
  @exception.response = StubResponse.new({}, false, 418)
235
237
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
236
- url: '/test',
238
+ url: 'https://auth0.com/test',
237
239
  timeout: nil,
238
240
  headers: nil,
239
241
  payload: '{}')
@@ -244,7 +246,7 @@ describe Auth0::Mixins::HTTPProxy do
244
246
  it "should raise Auth0::RequestTimeout on send http #{http_method} method
245
247
  to path defined through HTTP when RestClient::RequestTimeout received" do
246
248
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
247
- url: '/test',
249
+ url: 'https://auth0.com/test',
248
250
  timeout: nil,
249
251
  headers: nil,
250
252
  payload: '{}')
@@ -256,7 +258,7 @@ describe Auth0::Mixins::HTTPProxy do
256
258
  to path defined through HTTP when 400 status received" do
257
259
  @exception.response = StubResponse.new({}, false, 400)
258
260
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
259
- url: '/test',
261
+ url: 'https://auth0.com/test',
260
262
  timeout: nil,
261
263
  headers: nil,
262
264
  payload: '{}')
@@ -267,7 +269,7 @@ describe Auth0::Mixins::HTTPProxy do
267
269
  it "should raise Auth0::ServerError on send http #{http_method} method
268
270
  to path defined through HTTP when 500 received" do
269
271
  @exception.response = StubResponse.new({}, false, 500)
270
- allow(RestClient::Request).to receive(:execute).with(method: http_method, url: '/test',
272
+ allow(RestClient::Request).to receive(:execute).with(method: http_method, url: 'https://auth0.com/test',
271
273
  timeout: nil,
272
274
  headers: nil,
273
275
  payload: '{}')
@@ -275,9 +277,9 @@ describe Auth0::Mixins::HTTPProxy do
275
277
  expect { @instance.send(http_method, '/test') }.to raise_error(Auth0::ServerError)
276
278
  end
277
279
 
278
- it 'should escape path with Addressable::URI.escape' do
280
+ it 'should normalize path with Addressable::URI' do
279
281
  expect(RestClient::Request).to receive(:execute).with(method: http_method,
280
- url: '/te%20st',
282
+ url: 'https://auth0.com/te%20st',
281
283
  timeout: nil,
282
284
  headers: nil,
283
285
  payload: '{}')
@@ -292,7 +294,7 @@ describe Auth0::Mixins::HTTPProxy do
292
294
  3241312' on property id (The user_id of the user to retrieve).",
293
295
  'errorCode' => 'invalid_uri')
294
296
  expect(RestClient::Request).to receive(:execute).with(method: http_method,
295
- url: '/test',
297
+ url: 'https://auth0.com/test',
296
298
  timeout: nil,
297
299
  headers: nil,
298
300
  payload: '{}')
@@ -1,5 +1,4 @@
1
1
  class DummyClassForProxy
2
2
  include Auth0::Mixins::HTTPProxy
3
3
  include Auth0::Mixins::Headers
4
- @base_uri = 'http://auth0.com'
5
- end
4
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth0
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Auth0
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-07-25 00:00:00.000000000 Z
14
+ date: 2021-07-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rest-client
@@ -272,11 +272,6 @@ files:
272
272
  - ".rspec"
273
273
  - ".rubocop.yml"
274
274
  - ".rubocop_todo.yml"
275
- - ".yardoc/checksums"
276
- - ".yardoc/complete"
277
- - ".yardoc/object_types"
278
- - ".yardoc/objects/root.dat"
279
- - ".yardoc/proxy_types"
280
275
  - CHANGELOG.md
281
276
  - CODE_OF_CONDUCT.md
282
277
  - DEPLOYMENT.md
data/.yardoc/checksums DELETED
@@ -1,22 +0,0 @@
1
- lib/auth0/api/v2/jobs.rb 53fe5a814c9da1bb89d7cb885fe7f1151d6ca44a
2
- lib/auth0/api/v2/logs.rb f4b9b93248d85d29d58ac12b6b5ebabd72f98adb
3
- lib/auth0/api/v2/roles.rb 99e9d0222f0d59f21cb061d13b434bf1a903660a
4
- lib/auth0/api/v2/rules.rb 2fbbf4258ba7e6fe67d1ab197ca3503d4e5daf84
5
- lib/auth0/api/v2/stats.rb 035b172ad69efb2b040ffcd29319f23017352b4c
6
- lib/auth0/api/v2/users.rb 6a648030a6851db60ab13dc3a8a7d46bd51ce977
7
- lib/auth0/api/v2/emails.rb 83aaf5ed8082cb2787a0f9c47c463d218a3aee77
8
- lib/auth0/api/v2/anomaly.rb c0e38b3cbb4cca65fbe51e6ed69d56cfa5ea8d0e
9
- lib/auth0/api/v2/clients.rb 23c2b6f307f6a20537720ad24de30b62de51b9f2
10
- lib/auth0/api/v2/prompts.rb 688c71d37885b64ed8c174d54c9403fe21dc0735
11
- lib/auth0/api/v2/tenants.rb d20a9c46b6754d504667b6d5187b525274d5ffe8
12
- lib/auth0/api/v2/tickets.rb fd192d8b281ca54d318cac0a6b5cff3cad555076
13
- lib/auth0/api/v2/guardian.rb 367ea7046c90fdb2065bc66eddb64e47b2d3370d
14
- lib/auth0/api/v2/blacklists.rb c3405a13b9c6481a43136b3f4c755602e24a9511
15
- lib/auth0/api/v2/connections.rb 3a2ac77a7f9ba97df3fd2e7b958192e06db2e0a7
16
- lib/auth0/api/v2/log_streams.rb 1624abe964bd0e9bcfa1107a970f8fa823ec5955
17
- lib/auth0/api/v2/user_blocks.rb ce0f80dc00eb32dc1b825c0bbafb89e94d30a28c
18
- lib/auth0/api/v2/client_grants.rb ac7489b697d58e7514014e5ae125ffa88015306d
19
- lib/auth0/api/v2/users_by_email.rb 95bb92421fb03ec8feee8ef0b5f2ab64c8e51403
20
- lib/auth0/api/v2/resource_servers.rb f9c6e7c8fc0bd497e34b0a9e3ac1a81d7fbbe88b
21
- lib/auth0/api/v2/device_credentials.rb 94b92db7091ebc7af97fe0fb10a3ad64fa36cdc8
22
- lib/auth0/api/authentication_endpoints.rb d6e5c2fabbd79b4f17864b6ec026488d65c5090d
data/.yardoc/complete DELETED
File without changes
data/.yardoc/object_types DELETED
Binary file
Binary file
data/.yardoc/proxy_types DELETED
Binary file