auth0 4.8.0 → 4.9.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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +1 -0
  3. data/CHANGELOG.md +19 -0
  4. data/Gemfile.lock +18 -17
  5. data/README.md +10 -1
  6. data/auth0.gemspec +1 -1
  7. data/lib/auth0/api/v2.rb +2 -0
  8. data/lib/auth0/api/v2/guardian.rb +142 -0
  9. data/lib/auth0/api/v2/roles.rb +0 -2
  10. data/lib/auth0/api/v2/users.rb +0 -2
  11. data/lib/auth0/mixins.rb +8 -3
  12. data/lib/auth0/mixins/httpproxy.rb +1 -1
  13. data/lib/auth0/version.rb +1 -1
  14. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_add_role_permissions/should_add_a_Permission_to_the_Role_successfully.yml +12 -10
  15. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_add_role_users/should_add_a_User_to_the_Role_successfully.yml +13 -11
  16. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_delete_role/should_delete_the_Role_successfully.yml +12 -10
  17. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role/should_get_the_Role_successfully.yml +13 -11
  18. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_permissions/should_get_exactly_1_Permission.yml +12 -10
  19. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_permissions/should_get_the_added_Permission_from_the_Role_successfully.yml +12 -10
  20. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_users/should_get_exactly_1_User.yml +13 -11
  21. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_users/should_get_the_added_User_from_the_Role_successfully.yml +13 -11
  22. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_roles/should_get_the_Role_successfully.yml +12 -10
  23. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_remove_role_permissions/should_remove_a_Permission_from_the_Role_successfully.yml +12 -10
  24. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_update_role/should_update_the_Role_successfully.yml +13 -11
  25. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_api.yml +14 -12
  26. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_role.yml +12 -10
  27. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_user.yml +13 -11
  28. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/delete_test_api.yml +12 -10
  29. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/delete_test_user.yml +12 -10
  30. data/spec/integration/lib/auth0/api/v2/api_roles_spec.rb +3 -3
  31. data/spec/lib/auth0/api/v2/guardian_spec.rb +154 -0
  32. data/spec/lib/auth0/mixins/httpproxy_spec.rb +24 -2
  33. data/spec/spec_helper.rb +2 -1
  34. metadata +7 -4
@@ -66,8 +66,19 @@ describe Auth0::Mixins::HTTPProxy do
66
66
  expect { @instance.send(http_method, '/test') }.to raise_error(Auth0::Unsupported)
67
67
  end
68
68
 
69
+ it "should raise Auth0::RequestTimeout on send http #{http_method} method
70
+ to path defined through HTTP when RestClient::RequestTimeout received" do
71
+ allow(RestClient::Request).to receive(:execute).with(method: http_method,
72
+ url: '/test',
73
+ timeout: nil,
74
+ headers: { params: {} },
75
+ payload: nil)
76
+ .and_raise(RestClient::Exceptions::OpenTimeout.new)
77
+ expect { @instance.send(http_method, '/test') }.to raise_error(Auth0::RequestTimeout)
78
+ end
79
+
69
80
  it "should raise Auth0::BadRequest on send http #{http_method} method
70
- to path defined through HTTP when 400 or other unknown status received" do
81
+ to path defined through HTTP when 400 status received" do
71
82
  @exception.response = StubResponse.new({}, false, 400)
72
83
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
73
84
  url: '/test',
@@ -230,8 +241,19 @@ describe Auth0::Mixins::HTTPProxy do
230
241
  expect { @instance.send(http_method, '/test') }.to raise_error(Auth0::Unsupported)
231
242
  end
232
243
 
244
+ it "should raise Auth0::RequestTimeout on send http #{http_method} method
245
+ to path defined through HTTP when RestClient::RequestTimeout received" do
246
+ allow(RestClient::Request).to receive(:execute).with(method: http_method,
247
+ url: '/test',
248
+ timeout: nil,
249
+ headers: nil,
250
+ payload: '{}')
251
+ .and_raise(RestClient::Exceptions::OpenTimeout.new)
252
+ expect { @instance.send(http_method, '/test') }.to raise_error(Auth0::RequestTimeout)
253
+ end
254
+
233
255
  it "should raise Auth0::BadRequest on send http #{http_method} method
234
- to path defined through HTTP when 400 or other unknown status received" do
256
+ to path defined through HTTP when 400 status received" do
235
257
  @exception.response = StubResponse.new({}, false, 400)
236
258
  allow(RestClient::Request).to receive(:execute).with(method: http_method,
237
259
  url: '/test',
@@ -32,7 +32,8 @@ end
32
32
  $LOAD_PATH.unshift File.expand_path('..', __FILE__)
33
33
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
34
34
 
35
- Dir['./lib/**/*.rb'].each { |f| require f }
35
+ Dir['./lib/*.rb'].each { |f| require f }
36
+ Dir['./lib/api/**/*.rb'].each { |f| require f }
36
37
  Dir['./spec/support/**/*.rb'].each { |f| require f }
37
38
  Dir['./spec/support/*.rb'].each { |f| require f }
38
39
 
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.8.0
4
+ version: 4.9.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: 2019-08-01 00:00:00.000000000 Z
14
+ date: 2019-09-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rest-client
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: '2.0'
22
+ version: 2.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '2.0'
29
+ version: 2.0.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rake
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -335,6 +335,7 @@ files:
335
335
  - lib/auth0/api/v2/connections.rb
336
336
  - lib/auth0/api/v2/device_credentials.rb
337
337
  - lib/auth0/api/v2/emails.rb
338
+ - lib/auth0/api/v2/guardian.rb
338
339
  - lib/auth0/api/v2/jobs.rb
339
340
  - lib/auth0/api/v2/logs.rb
340
341
  - lib/auth0/api/v2/resource_servers.rb
@@ -554,6 +555,7 @@ files:
554
555
  - spec/lib/auth0/api/v2/connections_spec.rb
555
556
  - spec/lib/auth0/api/v2/device_credentials_spec.rb
556
557
  - spec/lib/auth0/api/v2/emails_spec.rb
558
+ - spec/lib/auth0/api/v2/guardian_spec.rb
557
559
  - spec/lib/auth0/api/v2/jobs_spec.rb
558
560
  - spec/lib/auth0/api/v2/logs_spec.rb
559
561
  - spec/lib/auth0/api/v2/resource_servers_spec.rb
@@ -794,6 +796,7 @@ test_files:
794
796
  - spec/lib/auth0/api/v2/connections_spec.rb
795
797
  - spec/lib/auth0/api/v2/device_credentials_spec.rb
796
798
  - spec/lib/auth0/api/v2/emails_spec.rb
799
+ - spec/lib/auth0/api/v2/guardian_spec.rb
797
800
  - spec/lib/auth0/api/v2/jobs_spec.rb
798
801
  - spec/lib/auth0/api/v2/logs_spec.rb
799
802
  - spec/lib/auth0/api/v2/resource_servers_spec.rb