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.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -0
- data/CHANGELOG.md +19 -0
- data/Gemfile.lock +18 -17
- data/README.md +10 -1
- data/auth0.gemspec +1 -1
- data/lib/auth0/api/v2.rb +2 -0
- data/lib/auth0/api/v2/guardian.rb +142 -0
- data/lib/auth0/api/v2/roles.rb +0 -2
- data/lib/auth0/api/v2/users.rb +0 -2
- data/lib/auth0/mixins.rb +8 -3
- data/lib/auth0/mixins/httpproxy.rb +1 -1
- data/lib/auth0/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_add_role_permissions/should_add_a_Permission_to_the_Role_successfully.yml +12 -10
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_add_role_users/should_add_a_User_to_the_Role_successfully.yml +13 -11
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_delete_role/should_delete_the_Role_successfully.yml +12 -10
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role/should_get_the_Role_successfully.yml +13 -11
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_permissions/should_get_exactly_1_Permission.yml +12 -10
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_permissions/should_get_the_added_Permission_from_the_Role_successfully.yml +12 -10
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_users/should_get_exactly_1_User.yml +13 -11
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_users/should_get_the_added_User_from_the_Role_successfully.yml +13 -11
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_roles/should_get_the_Role_successfully.yml +12 -10
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_remove_role_permissions/should_remove_a_Permission_from_the_Role_successfully.yml +12 -10
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_update_role/should_update_the_Role_successfully.yml +13 -11
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_api.yml +14 -12
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_role.yml +12 -10
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_user.yml +13 -11
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/delete_test_api.yml +12 -10
- data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/delete_test_user.yml +12 -10
- data/spec/integration/lib/auth0/api/v2/api_roles_spec.rb +3 -3
- data/spec/lib/auth0/api/v2/guardian_spec.rb +154 -0
- data/spec/lib/auth0/mixins/httpproxy_spec.rb +24 -2
- data/spec/spec_helper.rb +2 -1
- 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/
|
|
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
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
42
|
+
- 56b9e1f77e2b9784
|
|
41
43
|
Ot-Tracer-Traceid:
|
|
42
|
-
-
|
|
44
|
+
- 247f6a2179c5d286
|
|
43
45
|
Ot-Tracer-Sampled:
|
|
44
46
|
- 'true'
|
|
45
47
|
X-Ratelimit-Limit:
|
|
46
48
|
- '10'
|
|
47
49
|
X-Ratelimit-Remaining:
|
|
48
|
-
- '
|
|
50
|
+
- '6'
|
|
49
51
|
X-Ratelimit-Reset:
|
|
50
|
-
- '
|
|
52
|
+
- '1569428935'
|
|
51
53
|
Vary:
|
|
52
54
|
- origin,accept-encoding
|
|
53
55
|
Cache-Control:
|
|
54
|
-
-
|
|
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+
|
|
66
|
+
H4sIAAAAAAAAA6tWykxRslIqys+J9001dy73qogsKo0KSis0L1TSUcpLzE0FyvqlliuAmTpKKanFyUWZBSWZ+XlQCWSRWgD0ZSapTwAAAA==
|
|
65
67
|
http_version:
|
|
66
|
-
recorded_at:
|
|
67
|
-
recorded_with: VCR
|
|
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
|
|
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
|
-
-
|
|
19
|
+
- eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjguMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
|
|
20
20
|
Authorization:
|
|
21
21
|
- Bearer API_TOKEN
|
|
22
22
|
Content-Length:
|
|
23
|
-
- '
|
|
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
|
-
-
|
|
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
|
-
-
|
|
42
|
+
- 377712c43c3d3f0c
|
|
41
43
|
Ot-Tracer-Traceid:
|
|
42
|
-
-
|
|
44
|
+
- 1808ccb97d180ded
|
|
43
45
|
Ot-Tracer-Sampled:
|
|
44
46
|
- 'true'
|
|
45
47
|
X-Ratelimit-Limit:
|
|
46
48
|
- '10'
|
|
47
49
|
X-Ratelimit-Remaining:
|
|
48
|
-
- '
|
|
50
|
+
- '9'
|
|
49
51
|
X-Ratelimit-Reset:
|
|
50
|
-
- '
|
|
52
|
+
- '1569428932'
|
|
51
53
|
Vary:
|
|
52
54
|
- origin,accept-encoding
|
|
53
55
|
Cache-Control:
|
|
54
|
-
-
|
|
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
|
-
|
|
66
|
+
H4sIAAAAAAAAA4WPQY7CMAxF7+I1laJCC/QYM0s0stLUrixMUsUBhBB3n8AGiVnMxgv7/a/nO8gEA3TTbtx3oeVN74jdtlszuXW7hxVEf6JK5PN4K2SleQ2/SMMpNzkpWYVkoliEhfK/qFdNV0zMKpHQh0BmMLBXoxXYURYMKVqtw5rCC+Va60clZMlWcPG53DCoVOKdK+lIEVWYijx1d/3Guc/1q/BKIwzb9nk1maPEGb3O1frru+366mchLVV0ONzh4vX89/eF8knMJEV4/Dx+ARDgi0BBAQAA
|
|
65
67
|
http_version:
|
|
66
|
-
recorded_at:
|
|
67
|
-
recorded_with: VCR
|
|
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
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
42
|
+
- 4965d1a63d1cd7b6
|
|
41
43
|
Ot-Tracer-Traceid:
|
|
42
|
-
-
|
|
44
|
+
- 7b1239cb6df00d3e
|
|
43
45
|
Ot-Tracer-Sampled:
|
|
44
46
|
- 'true'
|
|
45
47
|
X-Ratelimit-Limit:
|
|
46
48
|
- '10'
|
|
47
49
|
X-Ratelimit-Remaining:
|
|
48
|
-
- '
|
|
50
|
+
- '9'
|
|
49
51
|
X-Ratelimit-Reset:
|
|
50
|
-
- '
|
|
52
|
+
- '1569428933'
|
|
51
53
|
Vary:
|
|
52
54
|
- origin,accept-encoding
|
|
53
55
|
Cache-Control:
|
|
54
|
-
-
|
|
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+
|
|
66
|
+
H4sIAAAAAAAAA6tWykxRslIqys+J9001dy73qogsKo0KSis0L1TSUcpLzE0FyZYmVZakFpfoggmg2lSgXEpqcXJRZkFJZn4eUEkIUEYBJKOALF4LADvySGBfAAAA
|
|
65
67
|
http_version:
|
|
66
|
-
recorded_at:
|
|
67
|
-
recorded_with: VCR
|
|
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":"
|
|
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
|
-
-
|
|
19
|
+
- eyJuYW1lIjoicnVieS1hdXRoMCIsInZlcnNpb24iOiI0LjguMCIsImVudiI6eyJydWJ5IjoiMi41LjEifX0=
|
|
20
20
|
Authorization:
|
|
21
21
|
- Bearer API_TOKEN
|
|
22
22
|
Content-Length:
|
|
23
|
-
- '
|
|
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
|
-
-
|
|
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
|
-
-
|
|
42
|
+
- 3f68371e6cec83cf
|
|
41
43
|
Ot-Tracer-Traceid:
|
|
42
|
-
-
|
|
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
|
-
- '
|
|
52
|
+
- '1569428930'
|
|
51
53
|
Vary:
|
|
52
54
|
- origin,accept-encoding
|
|
53
55
|
Cache-Control:
|
|
54
|
-
-
|
|
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
|
-
|
|
66
|
+
H4sIAAAAAAAAA41RXWvCMBT9LwF9sh+pbU0Ksvmy58G2l40h8d5Uw2pSktQxnP99aZ0iDmSQh3PJ+bicuydyK1RDKmK71ZeXzkdn0DlptdjKqDY2sqaR7l50fpPGYLZkQvqvS91feiAN7sudtKpWEklVi8bJCelaFF7iUvjgkKWURymPsuKZllXGqpzHOWevQd57LlXQkSH5u0C24gVQzBkWLEUExtJiWgZqq8B3tt9o433rqiRx8dqKnfDC9hsnR5jMGBSc0pKjpDlHmgmQkLFZWU8FK+nqzs1zlo7tvF2PcT54jaaLUfYQHqCOzxWE+WjpArJd3Op134qCj+tmblekUGqvvApD9bYnYLSW4JXRweLlJHgUzn0ai9EixPd8EAPlsqJb5VizCzn2VGQf654MKNH83uTwPiFg5T+ucvgBoiwbUTQCAAA=
|
|
65
67
|
http_version:
|
|
66
|
-
recorded_at:
|
|
67
|
-
recorded_with: VCR
|
|
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/
|
|
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
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
38
|
+
- 352f549921eeb010
|
|
37
39
|
Ot-Tracer-Traceid:
|
|
38
|
-
-
|
|
40
|
+
- 2bb526c61a4a0513
|
|
39
41
|
Ot-Tracer-Sampled:
|
|
40
42
|
- 'true'
|
|
41
43
|
X-Ratelimit-Limit:
|
|
42
44
|
- '10'
|
|
43
45
|
X-Ratelimit-Remaining:
|
|
44
|
-
- '
|
|
46
|
+
- '2'
|
|
45
47
|
X-Ratelimit-Reset:
|
|
46
|
-
- '
|
|
48
|
+
- '1569428940'
|
|
47
49
|
Vary:
|
|
48
50
|
- origin,accept-encoding
|
|
49
51
|
Cache-Control:
|
|
50
|
-
-
|
|
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:
|
|
60
|
-
recorded_with: VCR
|
|
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%
|
|
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
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
38
|
+
- 07f44a0152e1d4ed
|
|
37
39
|
Ot-Tracer-Traceid:
|
|
38
|
-
-
|
|
40
|
+
- 1d0a177317e17335
|
|
39
41
|
Ot-Tracer-Sampled:
|
|
40
42
|
- 'true'
|
|
41
43
|
X-Ratelimit-Limit:
|
|
42
44
|
- '10'
|
|
43
45
|
X-Ratelimit-Remaining:
|
|
44
|
-
- '
|
|
46
|
+
- '1'
|
|
45
47
|
X-Ratelimit-Reset:
|
|
46
|
-
- '
|
|
48
|
+
- '1569428939'
|
|
47
49
|
Vary:
|
|
48
50
|
- origin,accept-encoding
|
|
49
51
|
Cache-Control:
|
|
50
|
-
-
|
|
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:
|
|
60
|
-
recorded_with: VCR
|
|
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
|
-
@
|
|
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: @
|
|
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
|