auth0 5.2.0 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/auth0/api/v2/logs.rb +2 -2
- data/lib/auth0/api/v2/organizations.rb +19 -3
- data/lib/auth0/api/v2/roles.rb +7 -3
- data/lib/auth0/version.rb +1 -1
- data/spec/lib/auth0/api/v2/organizations_spec.rb +31 -6
- data/spec/lib/auth0/api/v2/roles_spec.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d21b8018643c7c1fbe1749efc7bd375c6fca4bc67b8a7f6c1036bf17594c886
|
4
|
+
data.tar.gz: 7b89fc89c380469c0db6c86ddd4f00e6c1502a68c5f13c4bfcbbc35d58c6a23f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93fc45bd2a0c457d2f387291eb77cfabcad12c68bfa95d012b9ceeff3b62e25dfd31e8bd7ea67047c89a131f99ef375beb87dedaaabbaae391d6c210860b25cd
|
7
|
+
data.tar.gz: 694021376e92ab80198642919be1c2b94d27eb74a75862c4fdc15509251339faa6dd7eda013f7ab06df202ee4beeceab7465dfa0ae53b454e30c05e6338dbe09
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v5.3.0](https://github.com/auth0/ruby-auth0/tree/v5.3.0) (2021-07-23)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/auth0/ruby-auth0/compare/v5.2.0..v5.3.0)
|
6
|
+
|
7
|
+
**Added**
|
8
|
+
|
9
|
+
- Checkpoint Pagination [\#284](https://github.com/auth0/ruby-auth0/pull/284) ([davidpatrick](https://github.com/davidpatrick))
|
10
|
+
|
3
11
|
## [v5.2.0](https://github.com/auth0/ruby-auth0/tree/v5.2.0) (2021-07-20)
|
4
12
|
|
5
13
|
[Full Changelog](https://github.com/auth0/ruby-auth0/compare/v5.1.2..v5.2.0)
|
data/lib/auth0/api/v2/logs.rb
CHANGED
@@ -16,8 +16,8 @@ module Auth0
|
|
16
16
|
# * :fields [string] A comma separated list of fields to include or exclude from the result.
|
17
17
|
# * :include_fields [boolean] True if the fields specified are to be included in the result, false otherwise.
|
18
18
|
# * :include_totals [string] True if a query summary must be included in the result, false otherwise.
|
19
|
-
# * :from [string]
|
20
|
-
# * :take [integer]
|
19
|
+
# * :from [string] For checkpoint pagination, the ID from which to start selection from.
|
20
|
+
# * :take [integer] For checkpoint pagination, the number of entries to retrieve. Default is 50.
|
21
21
|
# Default: 50. Max value: 100.
|
22
22
|
#
|
23
23
|
# @return [json] Returns the list of existing log entries.
|
@@ -12,12 +12,16 @@ module Auth0
|
|
12
12
|
# @param options [hash] The Hash options used to define the paging of rersults
|
13
13
|
# * :per_page [integer] The amount of entries per page. Default: 50. Max value: 100.
|
14
14
|
# * :page [integer] The page number. Zero based.
|
15
|
+
# * :from [string] For checkpoint pagination, the ID from which to start selection from.
|
16
|
+
# * :take [integer] For checkpoint pagination, the number of entries to retrieve. Default is 50.
|
15
17
|
# * :include_totals [boolean] True to include query summary in the result, false or nil otherwise.
|
16
18
|
# @return [json] All Organizations
|
17
19
|
def organizations(options = {})
|
18
20
|
request_params = {
|
19
21
|
per_page: options.fetch(:per_page, nil),
|
20
22
|
page: options.fetch(:page, nil),
|
23
|
+
from: options.fetch(:from, nil),
|
24
|
+
take: options.fetch(:take, nil),
|
21
25
|
include_totals: options.fetch(:include_totals, nil)
|
22
26
|
}
|
23
27
|
get(organizations_path, request_params)
|
@@ -212,13 +216,25 @@ module Auth0
|
|
212
216
|
# Get Members in a Organization
|
213
217
|
# @see https://auth0.com/docs/api/management/v2/#!/Organizations/get_members
|
214
218
|
# @param organization_id [string] The Organization ID
|
215
|
-
# @param
|
219
|
+
# @param options [hash] The Hash options used to define the paging of rersults
|
220
|
+
# * :per_page [integer] The amount of entries per page. Default: 50. Max value: 100.
|
221
|
+
# * :page [integer] The page number. Zero based.
|
222
|
+
# * :from [string] For checkpoint pagination, the ID from which to start selection from.
|
223
|
+
# * :take [integer] For checkpoint pagination, the number of entries to retrieve. Default is 50.
|
224
|
+
# * :include_totals [boolean] True to include query summary in the result, false or nil otherwise.
|
216
225
|
#
|
217
226
|
# @return [json] Returns the members for the given organization
|
218
|
-
def get_organizations_members(organization_id)
|
227
|
+
def get_organizations_members(organization_id, options = {})
|
219
228
|
raise Auth0::MissingOrganizationId, 'Must supply a valid organization_id' if organization_id.to_s.empty?
|
229
|
+
request_params = {
|
230
|
+
per_page: options.fetch(:per_page, nil),
|
231
|
+
page: options.fetch(:page, nil),
|
232
|
+
from: options.fetch(:from, nil),
|
233
|
+
take: options.fetch(:take, nil),
|
234
|
+
include_totals: options.fetch(:include_totals, nil)
|
235
|
+
}
|
220
236
|
path = "#{organizations_members_path(organization_id)}"
|
221
|
-
get(path)
|
237
|
+
get(path, request_params)
|
222
238
|
end
|
223
239
|
|
224
240
|
# Add members in an organization
|
data/lib/auth0/api/v2/roles.rb
CHANGED
@@ -87,13 +87,17 @@ module Auth0
|
|
87
87
|
# @param options [hash] A hash of options for getting Roles
|
88
88
|
# - per_page: Number of Roles to return.
|
89
89
|
# - page: Page number to return, zero-based.
|
90
|
-
#
|
90
|
+
# * :from [string] For checkpoint pagination, the ID from which to start selection from.
|
91
|
+
# * :take [integer] For checkpoint pagination, the number of entries to retrieve. Default is 50.
|
92
|
+
# * :include_totals [boolean] True to include query summary in the result, false or nil otherwise.
|
91
93
|
def get_role_users(role_id, options = {})
|
92
94
|
raise Auth0::MissingParameter, 'Must supply a valid role_id' if role_id.to_s.empty?
|
93
95
|
|
94
96
|
request_params = {
|
95
|
-
per_page:
|
96
|
-
page:
|
97
|
+
per_page: options.fetch(:per_page, nil),
|
98
|
+
page: options.fetch(:page, nil),
|
99
|
+
from: options.fetch(:from, nil),
|
100
|
+
take: options.fetch(:take, nil),
|
97
101
|
include_totals: options.fetch(:include_totals, nil)
|
98
102
|
}
|
99
103
|
get "#{roles_path}/#{role_id}/users", request_params
|
data/lib/auth0/version.rb
CHANGED
@@ -20,6 +20,8 @@ describe Auth0::Api::V2::Organizations do
|
|
20
20
|
'/api/v2/organizations',
|
21
21
|
per_page: nil,
|
22
22
|
page: nil,
|
23
|
+
from: nil,
|
24
|
+
take: nil,
|
23
25
|
include_totals: nil
|
24
26
|
)
|
25
27
|
expect { @instance.organizations }.not_to raise_error
|
@@ -30,12 +32,16 @@ describe Auth0::Api::V2::Organizations do
|
|
30
32
|
'/api/v2/organizations',
|
31
33
|
per_page: 10,
|
32
34
|
page: 1,
|
35
|
+
from: 'org_id',
|
36
|
+
take: 50,
|
33
37
|
include_totals: true
|
34
38
|
)
|
35
39
|
expect do
|
36
40
|
@instance.organizations(
|
37
41
|
per_page: 10,
|
38
42
|
page: 1,
|
43
|
+
from: 'org_id',
|
44
|
+
take: 50,
|
39
45
|
include_totals: true
|
40
46
|
)
|
41
47
|
end.not_to raise_error
|
@@ -438,19 +444,38 @@ describe Auth0::Api::V2::Organizations do
|
|
438
444
|
expect { @instance.get_organizations_members(nil) }.to raise_exception(Auth0::MissingOrganizationId)
|
439
445
|
end
|
440
446
|
|
441
|
-
it 'is expected to get
|
447
|
+
it 'is expected to get members for an org' do
|
442
448
|
expect(@instance).to receive(:get).with(
|
443
|
-
'/api/v2/organizations/org_id/members'
|
449
|
+
'/api/v2/organizations/org_id/members',
|
450
|
+
per_page: nil,
|
451
|
+
page: nil,
|
452
|
+
from: nil,
|
453
|
+
take: nil,
|
454
|
+
include_totals: nil
|
444
455
|
)
|
445
|
-
expect
|
456
|
+
expect do
|
457
|
+
@instance.get_organizations_members('org_id')
|
458
|
+
end.not_to raise_error
|
446
459
|
end
|
447
460
|
|
448
|
-
it 'is expected to get
|
461
|
+
it 'is expected to get /api/v2/organizations with custom parameters' do
|
449
462
|
expect(@instance).to receive(:get).with(
|
450
|
-
'/api/v2/organizations/org_id/members'
|
463
|
+
'/api/v2/organizations/org_id/members',
|
464
|
+
per_page: 10,
|
465
|
+
page: 1,
|
466
|
+
from: 'org_id',
|
467
|
+
take: 50,
|
468
|
+
include_totals: true
|
451
469
|
)
|
452
470
|
expect do
|
453
|
-
@instance.get_organizations_members(
|
471
|
+
@instance.get_organizations_members(
|
472
|
+
'org_id',
|
473
|
+
per_page: 10,
|
474
|
+
page: 1,
|
475
|
+
from: 'org_id',
|
476
|
+
take: 50,
|
477
|
+
include_totals: true
|
478
|
+
)
|
454
479
|
end.not_to raise_error
|
455
480
|
end
|
456
481
|
end
|
@@ -152,6 +152,8 @@ describe Auth0::Api::V2::Roles do
|
|
152
152
|
'/api/v2/roles/ROLE_ID/users',
|
153
153
|
per_page: nil,
|
154
154
|
page: nil,
|
155
|
+
from: nil,
|
156
|
+
take: nil,
|
155
157
|
include_totals: nil
|
156
158
|
)
|
157
159
|
expect { @instance.get_role_users('ROLE_ID') }.not_to raise_error
|
@@ -162,10 +164,12 @@ describe Auth0::Api::V2::Roles do
|
|
162
164
|
'/api/v2/roles/ROLE_ID/users',
|
163
165
|
per_page: 30,
|
164
166
|
page: 4,
|
167
|
+
from: 'org_id',
|
168
|
+
take: 50,
|
165
169
|
include_totals: true
|
166
170
|
)
|
167
171
|
expect do
|
168
|
-
@instance.get_role_users('ROLE_ID', per_page: 30, page: 4, include_totals: true)
|
172
|
+
@instance.get_role_users('ROLE_ID', per_page: 30, page: 4, from: 'org_id', take: 50, include_totals: true)
|
169
173
|
end.not_to raise_error
|
170
174
|
end
|
171
175
|
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.
|
4
|
+
version: 5.3.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-
|
14
|
+
date: 2021-07-25 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rest-client
|