auth0 4.6.0 → 4.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/DEPLOYMENT.md +2 -1
  4. data/lib/auth0/api/v2/jobs.rb +43 -10
  5. data/lib/auth0/api/v2/resource_servers.rb +25 -0
  6. data/lib/auth0/api/v2/tickets.rb +26 -6
  7. data/lib/auth0/mixins/httpproxy.rb +8 -1
  8. data/lib/auth0/version.rb +1 -1
  9. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_export_users_and_get_job/should_create_an_export_users_job_successfully.yml +61 -0
  10. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_export_users_and_get_job/should_get_the_export_users_job.yml +117 -0
  11. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_import_users_and_get_job/should_create_an_import_users_job_successfully.yml +60 -0
  12. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_import_users_and_get_job/should_get_the_import_users_job.yml +116 -0
  13. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_create_a_new_verification_email_job.yml +119 -0
  14. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_get_the_completed_verification_email.yml +175 -0
  15. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_reject_an_invalid_client_id.yml +109 -0
  16. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/delete_imported_user.yml +110 -0
  17. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/search_for_connection_id.yml +59 -0
  18. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_delete_resource_server/should_delete_the_test_server_without_an_error.yml +8 -8
  19. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_patch_resource_server/should_update_the_resource_server_with_the_correct_attributes.yml +61 -0
  20. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_server/should_get_the_test_server.yml +9 -14
  21. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_get_the_test_server.yml +59 -0
  22. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_return_at_least_1_result.yml +59 -0
  23. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_return_the_first_page_of_one_result.yml +64 -0
  24. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/create_test_server.yml +7 -12
  25. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/delete_test_server.yml +8 -8
  26. data/spec/integration/lib/auth0/api/v2/api_email_spec.rb +2 -2
  27. data/spec/integration/lib/auth0/api/v2/api_jobs_spec.rb +101 -60
  28. data/spec/integration/lib/auth0/api/v2/api_resource_servers_spec.rb +38 -0
  29. data/spec/lib/auth0/api/v2/jobs_spec.rb +48 -5
  30. data/spec/lib/auth0/api/v2/resource_servers_spec.rb +23 -0
  31. data/spec/lib/auth0/api/v2/tickets_spec.rb +10 -4
  32. data/spec/spec_helper.rb +1 -1
  33. metadata +35 -10
@@ -7,6 +7,19 @@ describe Auth0::Api::V2::ResourceServers do
7
7
  @instance = dummy_instance
8
8
  end
9
9
 
10
+ context '.resource_servers' do
11
+ it { expect(@instance).to respond_to(:resource_servers) }
12
+ it { expect(@instance).to respond_to(:get_resource_servers) }
13
+ it 'is expected to call get /api/v2/resource-servers' do
14
+ expect(@instance).to receive(:get).with(
15
+ '/api/v2/resource-servers',
16
+ page: nil,
17
+ per_page: nil,
18
+ )
19
+ expect { @instance.resource_servers }.not_to raise_error
20
+ end
21
+ end
22
+
10
23
  context '.resource_server' do
11
24
  it { expect(@instance).to respond_to(:resource_server) }
12
25
  it 'is expected to call get /api/v2/resource-servers/test' do
@@ -60,4 +73,14 @@ describe Auth0::Api::V2::ResourceServers do
60
73
  expect { @instance.delete_resource_server(nil) }.to raise_error 'Must supply a valid resource server id'
61
74
  end
62
75
  end
76
+
77
+ context '.patch_resource_server' do
78
+ it { expect(@instance).to respond_to(:patch_resource_server) }
79
+ it 'is expected to send patch to /api/v2/resource_servers/1' do
80
+ expect(@instance).to receive(:patch).with('/api/v2/resource-servers/1', fields: 'fields')
81
+ expect { @instance.patch_resource_server('1', fields: 'fields') }.not_to raise_error
82
+ end
83
+ it { expect { @instance.patch_resource_server('', nil) }.to raise_error Auth0::InvalidParameter }
84
+ it { expect { @instance.patch_resource_server('some', nil) }.to raise_error Auth0::InvalidParameter }
85
+ end
63
86
  end
@@ -31,10 +31,16 @@ describe Auth0::Api::V2::Tickets do
31
31
  context '.post_password_change' do
32
32
  it { expect(@instance).to respond_to(:post_password_change) }
33
33
  it 'expect client to send post to /api/v2/tickets/password-change with body' do
34
- expect(@instance).to receive(:post).with('/api/v2/tickets/password-change', user_id: nil, result_url: nil,
35
- new_password: nil,
36
- connection_id: nil, email: nil)
37
- expect { @instance.post_password_change }.not_to raise_error
34
+ expect(@instance).to receive(:post).with('/api/v2/tickets/password-change',
35
+ result_url: nil,
36
+ user_id: nil,
37
+ connection_id: nil,
38
+ email: nil,
39
+ ttl_sec: nil,
40
+ mark_email_as_verified: nil,
41
+ includeEmailInRedirect: nil,
42
+ new_password: nil)
43
+ expect {@instance.post_password_change}.not_to raise_error
38
44
  end
39
45
  end
40
46
  end
@@ -22,7 +22,7 @@ require 'vcr'
22
22
  VCR.configure do |config|
23
23
  # Uncomment the line below to record new VCR cassettes.
24
24
  # When this is commented out, VCR will reject all outbound HTTP calls.
25
- # config.allow_http_connections_when_no_cassette = true
25
+ config.allow_http_connections_when_no_cassette = true
26
26
  config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
27
27
  config.configure_rspec_metadata!
28
28
  config.hook_into :webmock
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.6.0
4
+ version: 4.7.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: 2018-12-17 00:00:00.000000000 Z
14
+ date: 2019-03-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rest-client
@@ -115,22 +115,22 @@ dependencies:
115
115
  name: rspec
116
116
  requirement: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - "~>"
119
- - !ruby/object:Gem::Version
120
- version: '3.1'
121
118
  - - ">="
122
119
  - !ruby/object:Gem::Version
123
120
  version: 3.1.0
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '3.1'
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: '3.1'
131
128
  - - ">="
132
129
  - !ruby/object:Gem::Version
133
130
  version: 3.1.0
131
+ - - "~>"
132
+ - !ruby/object:Gem::Version
133
+ version: '3.1'
134
134
  - !ruby/object:Gem::Dependency
135
135
  name: rack-test
136
136
  requirement: !ruby/object:Gem::Requirement
@@ -416,6 +416,15 @@ files:
416
416
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_get_provider/should_get_the_existing_email_provider.yml
417
417
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_update_provider/should_update_the_existing_email_provider.yml
418
418
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/delete_existing_provider.yml
419
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_export_users_and_get_job/should_create_an_export_users_job_successfully.yml
420
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_export_users_and_get_job/should_get_the_export_users_job.yml
421
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_import_users_and_get_job/should_create_an_import_users_job_successfully.yml
422
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_import_users_and_get_job/should_get_the_import_users_job.yml
423
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_create_a_new_verification_email_job.yml
424
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_get_the_completed_verification_email.yml
425
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_reject_an_invalid_client_id.yml
426
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/delete_imported_user.yml
427
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/search_for_connection_id.yml
419
428
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_log/should_match_the_created_log_entry.yml
420
429
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_log/should_not_be_empty.yml
421
430
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_filters/should_exclude_fields_not_specified.yml
@@ -428,7 +437,11 @@ files:
428
437
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/delete_test_enabled_rule.yml
429
438
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/delete_test_user.yml
430
439
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_delete_resource_server/should_delete_the_test_server_without_an_error.yml
440
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_patch_resource_server/should_update_the_resource_server_with_the_correct_attributes.yml
431
441
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_server/should_get_the_test_server.yml
442
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_get_the_test_server.yml
443
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_return_at_least_1_result.yml
444
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_return_the_first_page_of_one_result.yml
432
445
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/create_test_server.yml
433
446
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/delete_test_server.yml
434
447
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_delete_rule/should_delete_the_test_disabled_rule_without_an_error.yml
@@ -535,8 +548,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
535
548
  - !ruby/object:Gem::Version
536
549
  version: '0'
537
550
  requirements: []
538
- rubyforge_project: auth0
539
- rubygems_version: 2.7.7
551
+ rubygems_version: 3.0.3
540
552
  signing_key:
541
553
  specification_version: 4
542
554
  summary: Auth0 API Client
@@ -604,6 +616,15 @@ test_files:
604
616
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_get_provider/should_get_the_existing_email_provider.yml
605
617
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_update_provider/should_update_the_existing_email_provider.yml
606
618
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/delete_existing_provider.yml
619
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_export_users_and_get_job/should_create_an_export_users_job_successfully.yml
620
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_export_users_and_get_job/should_get_the_export_users_job.yml
621
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_import_users_and_get_job/should_create_an_import_users_job_successfully.yml
622
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_import_users_and_get_job/should_get_the_import_users_job.yml
623
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_create_a_new_verification_email_job.yml
624
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_get_the_completed_verification_email.yml
625
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_reject_an_invalid_client_id.yml
626
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/delete_imported_user.yml
627
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/search_for_connection_id.yml
607
628
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_log/should_match_the_created_log_entry.yml
608
629
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_log/should_not_be_empty.yml
609
630
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_filters/should_exclude_fields_not_specified.yml
@@ -616,7 +637,11 @@ test_files:
616
637
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/delete_test_enabled_rule.yml
617
638
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/delete_test_user.yml
618
639
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_delete_resource_server/should_delete_the_test_server_without_an_error.yml
640
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_patch_resource_server/should_update_the_resource_server_with_the_correct_attributes.yml
619
641
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_server/should_get_the_test_server.yml
642
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_get_the_test_server.yml
643
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_return_at_least_1_result.yml
644
+ - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_return_the_first_page_of_one_result.yml
620
645
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/create_test_server.yml
621
646
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/delete_test_server.yml
622
647
  - spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_delete_rule/should_delete_the_test_disabled_rule_without_an_error.yml