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
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: patch
5
- uri: https://auth0-sdk-tests.auth0.com/api/v2/roles/rol_rSi7DH8MezaQ229K
5
+ uri: https://auth0-sdk-tests.auth0.com/api/v2/roles/rol_Me7CwJxYruZRfq7q
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"name":"New name","description":"New description"}'
@@ -16,7 +16,7 @@ http_interactions:
16
16
  Content-Type:
17
17
  - application/json
18
18
  Auth0-Client:
19
- - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjcuMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
19
+ - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjguMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
20
20
  Authorization:
21
21
  - Bearer API_TOKEN
22
22
  Content-Length:
@@ -29,29 +29,31 @@ http_interactions:
29
29
  message: OK
30
30
  headers:
31
31
  Date:
32
- - Fri, 28 Jun 2019 19:10:31 GMT
32
+ - Wed, 25 Sep 2019 16:28:52 GMT
33
33
  Content-Type:
34
34
  - application/json; charset=utf-8
35
35
  Transfer-Encoding:
36
36
  - chunked
37
37
  Connection:
38
38
  - keep-alive
39
+ Server:
40
+ - nginx
39
41
  Ot-Tracer-Spanid:
40
- - 20c71ae449c24331
42
+ - 56b9e1f77e2b9784
41
43
  Ot-Tracer-Traceid:
42
- - 0fadb49a7bfa27ea
44
+ - 247f6a2179c5d286
43
45
  Ot-Tracer-Sampled:
44
46
  - 'true'
45
47
  X-Ratelimit-Limit:
46
48
  - '10'
47
49
  X-Ratelimit-Remaining:
48
- - '9'
50
+ - '6'
49
51
  X-Ratelimit-Reset:
50
- - '1561749033'
52
+ - '1569428935'
51
53
  Vary:
52
54
  - origin,accept-encoding
53
55
  Cache-Control:
54
- - private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
56
+ - no-cache
55
57
  Content-Encoding:
56
58
  - gzip
57
59
  Strict-Transport-Security:
@@ -61,7 +63,7 @@ http_interactions:
61
63
  body:
62
64
  encoding: ASCII-8BIT
63
65
  string: !binary |-
64
- H4sIAAAAAAAAA6tWykxRslIqys+JLwrONHfxsPBNrUoMNDKy9FbSUcpLzE0FyvqlliuAmTpKKanFyUWZBSWZ+XlQCWSRWgAPVW4MTwAAAA==
66
+ H4sIAAAAAAAAA6tWykxRslIqys+J9001dy73qogsKo0KSis0L1TSUcpLzE0FyvqlliuAmTpKKanFyUWZBSWZ+XlQCWSRWgD0ZSapTwAAAA==
65
67
  http_version:
66
- recorded_at: Fri, 28 Jun 2019 19:10:31 GMT
67
- recorded_with: VCR 4.0.0
68
+ recorded_at: Wed, 25 Sep 2019 16:28:52 GMT
69
+ recorded_with: VCR 5.0.0
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://auth0-sdk-tests.auth0.com/api/v2/resource-servers
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"name":"rubytest-test-api-for-roles","scopes":[{"value":"test:scope"}],"identifier":"rubytest-test-api-for-roles"}'
8
+ string: '{"name":"rubytest-test-api-for-roles","scopes":[{"value":"rubytest-test-permission"}],"identifier":"rubytest-test-api-for-roles"}'
9
9
  headers:
10
10
  Accept:
11
11
  - "*/*"
@@ -16,11 +16,11 @@ http_interactions:
16
16
  Content-Type:
17
17
  - application/json
18
18
  Auth0-Client:
19
- - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjcuMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
19
+ - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjguMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
20
20
  Authorization:
21
21
  - Bearer API_TOKEN
22
22
  Content-Length:
23
- - '115'
23
+ - '129'
24
24
  Host:
25
25
  - auth0-sdk-tests.auth0.com
26
26
  response:
@@ -29,29 +29,31 @@ http_interactions:
29
29
  message: Created
30
30
  headers:
31
31
  Date:
32
- - Fri, 28 Jun 2019 19:10:26 GMT
32
+ - Wed, 25 Sep 2019 16:28:50 GMT
33
33
  Content-Type:
34
34
  - application/json; charset=utf-8
35
35
  Transfer-Encoding:
36
36
  - chunked
37
37
  Connection:
38
38
  - keep-alive
39
+ Server:
40
+ - nginx
39
41
  Ot-Tracer-Spanid:
40
- - 1ece1bd1238ae75f
42
+ - 377712c43c3d3f0c
41
43
  Ot-Tracer-Traceid:
42
- - '09cde2520aa156b8'
44
+ - 1808ccb97d180ded
43
45
  Ot-Tracer-Sampled:
44
46
  - 'true'
45
47
  X-Ratelimit-Limit:
46
48
  - '10'
47
49
  X-Ratelimit-Remaining:
48
- - '8'
50
+ - '9'
49
51
  X-Ratelimit-Reset:
50
- - '1561749028'
52
+ - '1569428932'
51
53
  Vary:
52
54
  - origin,accept-encoding
53
55
  Cache-Control:
54
- - private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
56
+ - no-cache
55
57
  Content-Encoding:
56
58
  - gzip
57
59
  Strict-Transport-Security:
@@ -61,7 +63,7 @@ http_interactions:
61
63
  body:
62
64
  encoding: ASCII-8BIT
63
65
  string: !binary |-
64
- H4sIAAAAAAAAA4WPsW7DMAxE/0VzDDhKo6b+jHYsCoKWKYMIKxmikiAI8u+lvRTo0oXD8e7w7uF4coM7TvsQgvfHsI+H0IfxEP3byaPbuYzfZI56Ge+NtHXbwYW7VGpXi5CaiSfKjRNT/deKIuUGJSXhTIAxkqobEorSzumZF4glq9WBpeBK1WpxFILEVRssWNsdorA5fnOtnCmDcKLGK+4pvPT9X3krvNHohle/fpXnzHkGlNmo3z9svfFpLIuBDp8Pd0W5rNvXHcOmu+fX8wfh5EpnMwEAAA==
66
+ H4sIAAAAAAAAA4WPQY7CMAxF7+I1laJCC/QYM0s0stLUrixMUsUBhBB3n8AGiVnMxgv7/a/nO8gEA3TTbtx3oeVN74jdtlszuXW7hxVEf6JK5PN4K2SleQ2/SMMpNzkpWYVkoliEhfK/qFdNV0zMKpHQh0BmMLBXoxXYURYMKVqtw5rCC+Va60clZMlWcPG53DCoVOKdK+lIEVWYijx1d/3Guc/1q/BKIwzb9nk1maPEGb3O1frru+366mchLVV0ONzh4vX89/eF8knMJEV4/Dx+ARDgi0BBAQAA
65
67
  http_version:
66
- recorded_at: Fri, 28 Jun 2019 19:10:26 GMT
67
- recorded_with: VCR 4.0.0
68
+ recorded_at: Wed, 25 Sep 2019 16:28:50 GMT
69
+ recorded_with: VCR 5.0.0
@@ -16,7 +16,7 @@ http_interactions:
16
16
  Content-Type:
17
17
  - application/json
18
18
  Auth0-Client:
19
- - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjcuMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
19
+ - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjguMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
20
20
  Authorization:
21
21
  - Bearer API_TOKEN
22
22
  Content-Length:
@@ -29,29 +29,31 @@ http_interactions:
29
29
  message: OK
30
30
  headers:
31
31
  Date:
32
- - Fri, 28 Jun 2019 19:10:27 GMT
32
+ - Wed, 25 Sep 2019 16:28:51 GMT
33
33
  Content-Type:
34
34
  - application/json; charset=utf-8
35
35
  Transfer-Encoding:
36
36
  - chunked
37
37
  Connection:
38
38
  - keep-alive
39
+ Server:
40
+ - nginx
39
41
  Ot-Tracer-Spanid:
40
- - 7d7b46586ea44d7a
42
+ - 4965d1a63d1cd7b6
41
43
  Ot-Tracer-Traceid:
42
- - 50bb4f735f294947
44
+ - 7b1239cb6df00d3e
43
45
  Ot-Tracer-Sampled:
44
46
  - 'true'
45
47
  X-Ratelimit-Limit:
46
48
  - '10'
47
49
  X-Ratelimit-Remaining:
48
- - '7'
50
+ - '9'
49
51
  X-Ratelimit-Reset:
50
- - '1561749029'
52
+ - '1569428933'
51
53
  Vary:
52
54
  - origin,accept-encoding
53
55
  Cache-Control:
54
- - private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
56
+ - no-cache
55
57
  Content-Encoding:
56
58
  - gzip
57
59
  Strict-Transport-Security:
@@ -61,7 +63,7 @@ http_interactions:
61
63
  body:
62
64
  encoding: ASCII-8BIT
63
65
  string: !binary |-
64
- H4sIAAAAAAAAA6tWykxRslIqys+JLwrONHfxsPBNrUoMNDKy9FbSUcpLzE0FyZYmVZakFpfoggmg2lSgXEpqcXJRZkFJZn4eUEkIUEYBJKOALF4LAIwSdAlfAAAA
66
+ H4sIAAAAAAAAA6tWykxRslIqys+J9001dy73qogsKo0KSis0L1TSUcpLzE0FyZYmVZakFpfoggmg2lSgXEpqcXJRZkFJZn4eUEkIUEYBJKOALF4LADvySGBfAAAA
65
67
  http_version:
66
- recorded_at: Fri, 28 Jun 2019 19:10:27 GMT
67
- recorded_with: VCR 4.0.0
68
+ recorded_at: Wed, 25 Sep 2019 16:28:51 GMT
69
+ recorded_with: VCR 5.0.0
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://auth0-sdk-tests.auth0.com/api/v2/users
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"email":"rubytest-rubytest-username-for-roles@auth0.com","password":"6e13ZeM3V","connection":"Username-Password-Authentication","name":"rubytest-username-for-roles"}'
8
+ string: '{"email":"rubytest-rubytest-username-for-roles@auth0.com","password":"LlRwJrJ402J7UdX","connection":"Username-Password-Authentication","name":"rubytest-username-for-roles"}'
9
9
  headers:
10
10
  Accept:
11
11
  - "*/*"
@@ -16,11 +16,11 @@ http_interactions:
16
16
  Content-Type:
17
17
  - application/json
18
18
  Auth0-Client:
19
- - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjcuMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
19
+ - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjguMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
20
20
  Authorization:
21
21
  - Bearer API_TOKEN
22
22
  Content-Length:
23
- - '166'
23
+ - '172'
24
24
  Host:
25
25
  - auth0-sdk-tests.auth0.com
26
26
  response:
@@ -29,17 +29,19 @@ http_interactions:
29
29
  message: Created
30
30
  headers:
31
31
  Date:
32
- - Fri, 28 Jun 2019 19:10:26 GMT
32
+ - Wed, 25 Sep 2019 16:28:49 GMT
33
33
  Content-Type:
34
34
  - application/json; charset=utf-8
35
35
  Transfer-Encoding:
36
36
  - chunked
37
37
  Connection:
38
38
  - keep-alive
39
+ Server:
40
+ - nginx
39
41
  Ot-Tracer-Spanid:
40
- - 57b61bc248e2e114
42
+ - 3f68371e6cec83cf
41
43
  Ot-Tracer-Traceid:
42
- - 5fa52f6668e15cb8
44
+ - 19e48fd614f086d2
43
45
  Ot-Tracer-Sampled:
44
46
  - 'true'
45
47
  X-Ratelimit-Limit:
@@ -47,11 +49,11 @@ http_interactions:
47
49
  X-Ratelimit-Remaining:
48
50
  - '9'
49
51
  X-Ratelimit-Reset:
50
- - '1561749028'
52
+ - '1569428930'
51
53
  Vary:
52
54
  - origin,accept-encoding
53
55
  Cache-Control:
54
- - private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
56
+ - no-cache
55
57
  Content-Encoding:
56
58
  - gzip
57
59
  Strict-Transport-Security:
@@ -61,7 +63,7 @@ http_interactions:
61
63
  body:
62
64
  encoding: ASCII-8BIT
63
65
  string: !binary |-
64
- H4sIAAAAAAAAA41RXUvDMBT9L4HtaW2TbE2bwtC9+CyoL4qMNLndgl1SknQic//dtHMyFIaQh3PJ+bice0CwE7pFFXJ9/RHAh+QH9B6cETtIGusSZ1vwt6IPW5xKu0MzNHxd6v7SI2l0X+/B6UaDQlUjWg8z1HdKBFBrEaIDxYQnmCW0fCS8IriiLC14/hzlg+daRx0akz9zRRhjlM6LmnCG1SKvcwyFjNROy9C7YaNtCJ2vssynGyf2Igg3bJydYFaUMueEMK6ALLgiVEiQtCxYMxclI/WNXy5KPHXLbjNVy9FrMl9N6F18Upn0p4I4nyx9RK5PO7MZWtHy7Xcz1yvSCkzQQcehejkgaY0BGbQ10eLpLLgX3r9bp5JVjB/4UoyUy4qulePsPua4c5FDrH+wUov2+ybH1xmSDv5xleMXsu0GVjQCAAA=
66
+ H4sIAAAAAAAAA41RXWvCMBT9LwF9sh+pbU0Ksvmy58G2l40h8d5Uw2pSktQxnP99aZ0iDmSQh3PJ+bicuydyK1RDKmK71ZeXzkdn0DlptdjKqDY2sqaR7l50fpPGYLZkQvqvS91feiAN7sudtKpWEklVi8bJCelaFF7iUvjgkKWURymPsuKZllXGqpzHOWevQd57LlXQkSH5u0C24gVQzBkWLEUExtJiWgZqq8B3tt9o433rqiRx8dqKnfDC9hsnR5jMGBSc0pKjpDlHmgmQkLFZWU8FK+nqzs1zlo7tvF2PcT54jaaLUfYQHqCOzxWE+WjpArJd3Op134qCj+tmblekUGqvvApD9bYnYLSW4JXRweLlJHgUzn0ai9EixPd8EAPlsqJb5VizCzn2VGQf654MKNH83uTwPiFg5T+ucvgBoiwbUTQCAAA=
65
67
  http_version:
66
- recorded_at: Fri, 28 Jun 2019 19:10:26 GMT
67
- recorded_with: VCR 4.0.0
68
+ recorded_at: Wed, 25 Sep 2019 16:28:49 GMT
69
+ recorded_with: VCR 5.0.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: delete
5
- uri: https://auth0-sdk-tests.auth0.com/api/v2/resource-servers/5d166622561c3606b3c2982a
5
+ uri: https://auth0-sdk-tests.auth0.com/api/v2/resource-servers/5d8b95c2f460ef0753fe0329
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -16,7 +16,7 @@ http_interactions:
16
16
  Content-Type:
17
17
  - application/json
18
18
  Auth0-Client:
19
- - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjcuMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
19
+ - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjguMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
20
20
  Authorization:
21
21
  - Bearer API_TOKEN
22
22
  Host:
@@ -27,27 +27,29 @@ http_interactions:
27
27
  message: No Content
28
28
  headers:
29
29
  Date:
30
- - Fri, 28 Jun 2019 19:10:42 GMT
30
+ - Wed, 25 Sep 2019 16:28:55 GMT
31
31
  Content-Type:
32
32
  - application/json; charset=utf-8
33
33
  Connection:
34
34
  - keep-alive
35
+ Server:
36
+ - nginx
35
37
  Ot-Tracer-Spanid:
36
- - 6f62334427a74031
38
+ - 352f549921eeb010
37
39
  Ot-Tracer-Traceid:
38
- - 42c809b470ac018d
40
+ - 2bb526c61a4a0513
39
41
  Ot-Tracer-Sampled:
40
42
  - 'true'
41
43
  X-Ratelimit-Limit:
42
44
  - '10'
43
45
  X-Ratelimit-Remaining:
44
- - '7'
46
+ - '2'
45
47
  X-Ratelimit-Reset:
46
- - '1561749044'
48
+ - '1569428940'
47
49
  Vary:
48
50
  - origin,accept-encoding
49
51
  Cache-Control:
50
- - private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
52
+ - no-cache
51
53
  Strict-Transport-Security:
52
54
  - max-age=15724800
53
55
  X-Robots-Tag:
@@ -56,5 +58,5 @@ http_interactions:
56
58
  encoding: UTF-8
57
59
  string: ''
58
60
  http_version:
59
- recorded_at: Fri, 28 Jun 2019 19:10:42 GMT
60
- recorded_with: VCR 4.0.0
61
+ recorded_at: Wed, 25 Sep 2019 16:28:55 GMT
62
+ recorded_with: VCR 5.0.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: delete
5
- uri: https://auth0-sdk-tests.auth0.com/api/v2/users/auth0%7C5d16662237b1960d45b50e7c
5
+ uri: https://auth0-sdk-tests.auth0.com/api/v2/users/auth0%7C5d8b95c1d48d580ddc880536
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -16,7 +16,7 @@ http_interactions:
16
16
  Content-Type:
17
17
  - application/json
18
18
  Auth0-Client:
19
- - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjcuMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
19
+ - eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjguMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
20
20
  Authorization:
21
21
  - Bearer API_TOKEN
22
22
  Host:
@@ -27,27 +27,29 @@ http_interactions:
27
27
  message: No Content
28
28
  headers:
29
29
  Date:
30
- - Fri, 28 Jun 2019 19:10:42 GMT
30
+ - Wed, 25 Sep 2019 16:28:53 GMT
31
31
  Content-Type:
32
32
  - application/json; charset=utf-8
33
33
  Connection:
34
34
  - keep-alive
35
+ Server:
36
+ - nginx
35
37
  Ot-Tracer-Spanid:
36
- - 16c179630b124a9b
38
+ - 07f44a0152e1d4ed
37
39
  Ot-Tracer-Traceid:
38
- - 68df15882c051abc
40
+ - 1d0a177317e17335
39
41
  Ot-Tracer-Sampled:
40
42
  - 'true'
41
43
  X-Ratelimit-Limit:
42
44
  - '10'
43
45
  X-Ratelimit-Remaining:
44
- - '8'
46
+ - '1'
45
47
  X-Ratelimit-Reset:
46
- - '1561749044'
48
+ - '1569428939'
47
49
  Vary:
48
50
  - origin,accept-encoding
49
51
  Cache-Control:
50
- - private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
52
+ - no-cache
51
53
  Strict-Transport-Security:
52
54
  - max-age=15724800
53
55
  X-Robots-Tag:
@@ -56,5 +58,5 @@ http_interactions:
56
58
  encoding: UTF-8
57
59
  string: ''
58
60
  http_version:
59
- recorded_at: Fri, 28 Jun 2019 19:10:42 GMT
60
- recorded_with: VCR 4.0.0
61
+ recorded_at: Wed, 25 Sep 2019 16:28:53 GMT
62
+ recorded_with: VCR 5.0.0
@@ -10,11 +10,11 @@ describe Auth0::Api::V2::Roles do
10
10
  @test_user_email = "#{entity_suffix}-#{@test_user_name}@auth0.com"
11
11
 
12
12
  @test_api_name = "#{entity_suffix}-test-api-for-roles"
13
- @test_api_scope = 'test:scope'
14
13
 
15
14
  @test_role_name = "#{entity_suffix}-test-role"
16
15
 
17
- @test_permission = Permission.new("#{entity_suffix}-test-permission", @test_api_name)
16
+ @test_permission_name = "#{entity_suffix}-test-permission"
17
+ @test_permission = Permission.new(@test_permission_name, @test_api_name)
18
18
 
19
19
  VCR.use_cassette('Auth0_Api_V2_Roles/create_test_user') do
20
20
  @test_user ||= client.create_user(
@@ -29,7 +29,7 @@ describe Auth0::Api::V2::Roles do
29
29
  @test_api ||= client.create_resource_server(
30
30
  @test_api_name,
31
31
  name: @test_api_name,
32
- scopes: [{ value: @test_api_scope }]
32
+ scopes: [{ value: @test_permission_name }]
33
33
  )
34
34
  end
35
35
 
@@ -0,0 +1,154 @@
1
+ require 'spec_helper'
2
+ describe Auth0::Api::V2::Guardian do
3
+ before :all do
4
+ dummy_instance = DummyClass.new
5
+ dummy_instance.extend(Auth0::Api::V2::Guardian)
6
+ @instance = dummy_instance
7
+ end
8
+
9
+ context '.guardian_factors' do
10
+ it 'is expected to respond to a guardian_factors method' do
11
+ expect(@instance).to respond_to(:guardian_factors)
12
+ end
13
+
14
+ it 'is expected to respond to a get_guardian_factors method' do
15
+ expect(@instance).to respond_to(:get_guardian_factors)
16
+ end
17
+
18
+ it 'is expected to get /api/v2/guardian/factors' do
19
+ expect(@instance).to receive(:get).with(
20
+ '/api/v2/guardian/factors'
21
+ )
22
+ expect { @instance.guardian_factors }.not_to raise_error
23
+ end
24
+ end
25
+
26
+ context '.guardian_enrollment' do
27
+ it 'is expected to respond to a guardian_enrollment method' do
28
+ expect(@instance).to respond_to(:guardian_enrollment)
29
+ end
30
+
31
+ it 'is expected to call get request to /api/v2/guardian/enrollments/ENROLLMENT_ID' do
32
+ expect(@instance).to receive(:get).with(
33
+ '/api/v2/guardian/enrollments/ENROLLMENT_ID'
34
+ )
35
+ expect { @instance.guardian_enrollment('ENROLLMENT_ID') }.not_to raise_error
36
+ end
37
+
38
+ it 'is expected to raise an exception when the enrollment ID is empty' do
39
+ expect { @instance.guardian_enrollment(nil) }.to raise_exception(Auth0::MissingParameter)
40
+ end
41
+ end
42
+
43
+ context '.delete_guardian_enrollment' do
44
+ it 'is expected to respond to a delete_guardian_enrollment method' do
45
+ expect(@instance).to respond_to(:delete_guardian_enrollment)
46
+ end
47
+
48
+ it 'is expected to delete /api/v2/guardian/enrollments/ENROLLMENT_ID' do
49
+ expect(@instance).to receive(:delete).with('/api/v2/guardian/enrollments/ENROLLMENT_ID')
50
+ @instance.delete_guardian_enrollment('ENROLLMENT_ID')
51
+ end
52
+
53
+ it 'is expected not to delete /api/v2/guardian/enrollments/ENROLLMENT_ID if enrollment_id is blank' do
54
+ expect(@instance).not_to receive(:delete)
55
+ expect { @instance.delete_guardian_enrollment(nil) }.to raise_exception(
56
+ Auth0::MissingParameter
57
+ )
58
+ end
59
+ end
60
+
61
+ context '.guardian_sms_templates' do
62
+ it 'is expected to respond to a guardian_sms_templates method' do
63
+ expect(@instance).to respond_to(:guardian_sms_templates)
64
+ end
65
+
66
+ it 'is expected to call get request to /api/v2/guardian/factors/sms/templates' do
67
+ expect(@instance).to receive(:get).with(
68
+ '/api/v2/guardian/factors/sms/templates'
69
+ )
70
+ expect { @instance.guardian_sms_templates }.not_to raise_error
71
+ end
72
+ end
73
+
74
+ context '.guardian_update_enrollment_verification_templates' do
75
+ it 'is expected to respond to a guardian_update_enrollment_verification_templates method' do
76
+ expect(@instance).to respond_to(:guardian_update_enrollment_verification_templates)
77
+ end
78
+
79
+ it 'is expected to patch /api/v2/guardian/factors/sms/templates' do
80
+ expect(@instance).to receive(:put).with('/api/v2/guardian/factors/sms/templates', 'BODY')
81
+ @instance.guardian_update_enrollment_verification_templates('BODY')
82
+ end
83
+ end
84
+
85
+ context '.guardian_sns_provider_config' do
86
+ it 'is expected to respond to a guardian_sns_provider_config method' do
87
+ expect(@instance).to respond_to(:guardian_sns_provider_config)
88
+ end
89
+
90
+ it 'is expected to call get request to /api/v2/guardian/factors/push-notification/providers/sns' do
91
+ expect(@instance).to receive(:get).with(
92
+ '/api/v2/guardian/factors/push-notification/providers/sns'
93
+ )
94
+ expect { @instance.guardian_sns_provider_config }.not_to raise_error
95
+ end
96
+ end
97
+
98
+ context '.guardian_update_sns_provider_config' do
99
+ it 'is expected to respond to a guardian_update_sns_provider_config method' do
100
+ expect(@instance).to respond_to(:guardian_update_sns_provider_config)
101
+ end
102
+
103
+ it 'is expected to patch /api/v2/guardian/factors/push-notification/providers/sns' do
104
+ expect(@instance).to receive(:put).with('/api/v2/guardian/factors/push-notification/providers/sns', 'BODY')
105
+ @instance.guardian_update_sns_provider_config('BODY')
106
+ end
107
+ end
108
+
109
+ context '.guardian_twillo_provider_config' do
110
+ it 'is expected to respond to a guardian_twillo_provider_config method' do
111
+ expect(@instance).to respond_to(:guardian_twillo_provider_config)
112
+ end
113
+
114
+ it 'is expected to call get request to /api/v2/guardian/factors/sms/providers/twilio' do
115
+ expect(@instance).to receive(:get).with(
116
+ '/api/v2/guardian/factors/sms/providers/twilio'
117
+ )
118
+ expect { @instance.guardian_twillo_provider_config }.not_to raise_error
119
+ end
120
+ end
121
+
122
+ context '.guardian_update_twillo_provider_config' do
123
+ it 'is expected to respond to a guardian_update_twillo_provider_config method' do
124
+ expect(@instance).to respond_to(:guardian_update_twillo_provider_config)
125
+ end
126
+
127
+ it 'is expected to patch /api/v2/guardian/factors/sms/providers/twilio' do
128
+ expect(@instance).to receive(:put).with('/api/v2/guardian/factors/sms/providers/twilio', 'BODY')
129
+ @instance.guardian_update_twillo_provider_config('BODY')
130
+ end
131
+ end
132
+
133
+ context '.guardian_create_enrollment_ticket' do
134
+ it 'is expected to respond to a guardian_create_enrollment_ticket method' do
135
+ expect(@instance).to respond_to(:guardian_create_enrollment_ticket)
136
+ end
137
+
138
+ it 'is expected to post /api/v2/guardian/enrollments/ticket' do
139
+ expect(@instance).to receive(:post).with('/api/v2/guardian/enrollments/ticket', 'BODY')
140
+ @instance.guardian_create_enrollment_ticket('BODY')
141
+ end
142
+ end
143
+
144
+ context '.guardian_update_factor' do
145
+ it 'is expected to respond to a guardian_update_factor method' do
146
+ expect(@instance).to respond_to(:guardian_update_factor)
147
+ end
148
+
149
+ it 'is expected to patch /api/v2/guardian/factors/NAME' do
150
+ expect(@instance).to receive(:put).with('/api/v2/guardian/factors/NAME', 'BODY')
151
+ @instance.guardian_update_factor('NAME', 'BODY')
152
+ end
153
+ end
154
+ end