auth0 4.16.0 → 4.17.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: c773de4346d595a93a87c037c195c59eaee818777201c8ee3bc291a3e49845bc
4
- data.tar.gz: 647034c402dcbe84488ca6f472b7bfe451e3567b4b6d70ff7b79ec81cbb8a16b
3
+ metadata.gz: c8c62c5e91e6d2cb4c8f880cfaa40748810e4a4f4597614b62443a437ebe33da
4
+ data.tar.gz: 2c795124374e41882193dd1ca28f66d0836b41f612c19b886965f377d7180b0f
5
5
  SHA512:
6
- metadata.gz: d7a196b81295ac4657f4789239e328f68522a510608d2282614c975900f50b46355ad0277b51b50f5a75b02fe04601e8dc511cc016d6f40607520b24af4b0bd0
7
- data.tar.gz: 303ac2f09a489a6727e73ce384fc3257bae9c872a2039fe732fea8bc853f8aa625d397d3da0e885f78eb96ee3f8bfca9d8bcc6adaddaf82335eaa7680ddd94ea
6
+ metadata.gz: 2b52f55fd579802757e32a671c8683e78b97aac5b16b95e01f12c38f1c07e309e144ce8e4e550708a1d8c6e020f562c465c217335fa11b7b1792fd7982b06df2
7
+ data.tar.gz: b001dad86055959657c27493d34a553e5a165a9ffd10947ac9d461bb76cc9c2c4995d82e99501ef8ea4b2d2f4cbbc08fdd3c7b59b145828cad40310c1b72e7b6
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+
4
+ ## [v4.17.0](https://github.com/auth0/ruby-auth0/tree/v4.17.0) (2020-10-19)
5
+
6
+ [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v4.16.0...v4.17.0)
7
+
8
+ **Added**
9
+
10
+ - Add pagination to user permissions [\#241](https://github.com/auth0/ruby-auth0/pull/241) ([davidpatrick](https://github.com/davidpatrick))
11
+
12
+ **Deprecated**
13
+
14
+ - Addressable URI Escape [\#240](https://github.com/auth0/ruby-auth0/pull/240) ([davidpatrick](https://github.com/apps/davidpatrick))
15
+
16
+
3
17
  ## [v4.16.0](https://github.com/auth0/ruby-auth0/tree/v4.16.0) (2020-10-02)
4
18
 
5
19
  [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v4.15.0...v4.16.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- auth0 (4.16.0)
4
+ auth0 (4.17.0)
5
5
  jwt (~> 2.2.0)
6
6
  rest-client (~> 2.0.0)
7
7
  zache (~> 0.12.0)
@@ -9,20 +9,20 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (6.0.3.3)
13
- actionview (= 6.0.3.3)
14
- activesupport (= 6.0.3.3)
12
+ actionpack (6.0.3.4)
13
+ actionview (= 6.0.3.4)
14
+ activesupport (= 6.0.3.4)
15
15
  rack (~> 2.0, >= 2.0.8)
16
16
  rack-test (>= 0.6.3)
17
17
  rails-dom-testing (~> 2.0)
18
18
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
19
- actionview (6.0.3.3)
20
- activesupport (= 6.0.3.3)
19
+ actionview (6.0.3.4)
20
+ activesupport (= 6.0.3.4)
21
21
  builder (~> 3.1)
22
22
  erubi (~> 1.4)
23
23
  rails-dom-testing (~> 2.0)
24
24
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
25
- activesupport (6.0.3.3)
25
+ activesupport (6.0.3.4)
26
26
  concurrent-ruby (~> 1.0, >= 1.0.2)
27
27
  i18n (>= 0.7, < 2)
28
28
  minitest (~> 5.1)
@@ -32,7 +32,7 @@ GEM
32
32
  public_suffix (>= 2.0.2, < 5.0)
33
33
  ast (2.4.1)
34
34
  builder (3.2.4)
35
- codecov (0.2.11)
35
+ codecov (0.2.12)
36
36
  json
37
37
  simplecov
38
38
  coderay (1.1.3)
@@ -105,7 +105,7 @@ GEM
105
105
  nenv (~> 0.1)
106
106
  shellany (~> 0.0)
107
107
  parallel (1.19.2)
108
- parser (2.7.1.5)
108
+ parser (2.7.2.0)
109
109
  ast (~> 2.4.1)
110
110
  pry (0.10.4)
111
111
  coderay (~> 1.1.0)
@@ -122,9 +122,9 @@ GEM
122
122
  nokogiri (>= 1.6)
123
123
  rails-html-sanitizer (1.3.0)
124
124
  loofah (~> 2.3)
125
- railties (6.0.3.3)
126
- actionpack (= 6.0.3.3)
127
- activesupport (= 6.0.3.3)
125
+ railties (6.0.3.4)
126
+ actionpack (= 6.0.3.4)
127
+ activesupport (= 6.0.3.4)
128
128
  method_source
129
129
  rake (>= 0.8.7)
130
130
  thor (>= 0.20.3, < 2.0)
@@ -133,7 +133,7 @@ GEM
133
133
  rb-fsevent (0.10.4)
134
134
  rb-inotify (0.10.1)
135
135
  ffi (~> 1.0)
136
- regexp_parser (1.8.1)
136
+ regexp_parser (1.8.2)
137
137
  rest-client (2.0.2)
138
138
  http-cookie (>= 1.0.2, < 2.0)
139
139
  mime-types (>= 1.16, < 4.0)
@@ -152,16 +152,16 @@ GEM
152
152
  diff-lcs (>= 1.2.0, < 2.0)
153
153
  rspec-support (~> 3.9.0)
154
154
  rspec-support (3.9.3)
155
- rubocop (0.92.0)
155
+ rubocop (0.93.1)
156
156
  parallel (~> 1.10)
157
157
  parser (>= 2.7.1.5)
158
158
  rainbow (>= 2.2.2, < 4.0)
159
- regexp_parser (>= 1.7)
159
+ regexp_parser (>= 1.8)
160
160
  rexml
161
- rubocop-ast (>= 0.5.0)
161
+ rubocop-ast (>= 0.6.0)
162
162
  ruby-progressbar (~> 1.7)
163
163
  unicode-display_width (>= 1.4.0, < 2.0)
164
- rubocop-ast (0.7.1)
164
+ rubocop-ast (0.8.0)
165
165
  parser (>= 2.7.1.5)
166
166
  rubocop-rails (2.8.1)
167
167
  activesupport (>= 4.2.0)
@@ -180,7 +180,7 @@ GEM
180
180
  terminal-notifier-guard (1.7.0)
181
181
  thor (1.0.1)
182
182
  thread_safe (0.3.6)
183
- tins (1.25.0)
183
+ tins (1.26.0)
184
184
  sync
185
185
  tzinfo (1.2.7)
186
186
  thread_safe (~> 0.1)
@@ -189,7 +189,7 @@ GEM
189
189
  unf_ext (0.0.7.7)
190
190
  unicode-display_width (1.7.0)
191
191
  vcr (6.0.0)
192
- webmock (3.9.1)
192
+ webmock (3.9.3)
193
193
  addressable (>= 2.3.6)
194
194
  crack (>= 0.3.2)
195
195
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -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.
@@ -1,4 +1,4 @@
1
1
  # current version of gem
2
2
  module Auth0
3
- VERSION = '4.16.0'.freeze
3
+ VERSION = '4.17.0'.freeze
4
4
  end
@@ -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,
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: 4.16.0
4
+ version: 4.17.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: 2020-10-03 00:00:00.000000000 Z
14
+ date: 2020-10-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rest-client