auth0 4.4.0 → 5.1.2

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 (289) hide show
  1. checksums.yaml +4 -4
  2. data/.bundle/config +3 -2
  3. data/.circleci/config.yml +44 -0
  4. data/.env.example +2 -0
  5. data/.github/CODEOWNERS +1 -0
  6. data/.github/ISSUE_TEMPLATE/config.yml +8 -0
  7. data/.github/ISSUE_TEMPLATE/feature_request.md +39 -0
  8. data/.github/ISSUE_TEMPLATE/report_a_bug.md +55 -0
  9. data/.github/PULL_REQUEST_TEMPLATE.md +35 -0
  10. data/.github/stale.yml +20 -0
  11. data/.gitignore +1 -2
  12. data/.rubocop.yml +2 -0
  13. data/.yardoc/checksums +22 -0
  14. data/.yardoc/complete +0 -0
  15. data/.yardoc/object_types +0 -0
  16. data/.yardoc/objects/root.dat +0 -0
  17. data/.yardoc/proxy_types +0 -0
  18. data/CHANGELOG.md +334 -19
  19. data/CODE_OF_CONDUCT.md +3 -0
  20. data/DEPLOYMENT.md +56 -9
  21. data/Gemfile +10 -3
  22. data/README.md +260 -37
  23. data/Rakefile +4 -23
  24. data/auth0.gemspec +10 -9
  25. data/codecov.yml +22 -0
  26. data/examples/ruby-api/.gitignore +0 -6
  27. data/lib/auth0/algorithm.rb +5 -0
  28. data/lib/auth0/api/authentication_endpoints.rb +244 -237
  29. data/lib/auth0/api/v2/anomaly.rb +36 -0
  30. data/lib/auth0/api/v2/branding.rb +66 -0
  31. data/lib/auth0/api/v2/client_grants.rb +14 -5
  32. data/lib/auth0/api/v2/clients.rb +9 -6
  33. data/lib/auth0/api/v2/connections.rb +19 -7
  34. data/lib/auth0/api/v2/device_credentials.rb +5 -4
  35. data/lib/auth0/api/v2/guardian.rb +142 -0
  36. data/lib/auth0/api/v2/jobs.rb +77 -13
  37. data/lib/auth0/api/v2/log_streams.rb +78 -0
  38. data/lib/auth0/api/v2/logs.rb +11 -11
  39. data/lib/auth0/api/v2/organizations.rb +335 -0
  40. data/lib/auth0/api/v2/prompts.rb +70 -0
  41. data/lib/auth0/api/v2/resource_servers.rb +32 -8
  42. data/lib/auth0/api/v2/roles.rb +172 -0
  43. data/lib/auth0/api/v2/rules.rb +6 -2
  44. data/lib/auth0/api/v2/tickets.rb +55 -8
  45. data/lib/auth0/api/v2/users.rb +168 -28
  46. data/lib/auth0/api/v2/users_by_email.rb +3 -2
  47. data/lib/auth0/api/v2.rb +16 -2
  48. data/lib/auth0/client.rb +1 -1
  49. data/lib/auth0/exception.rb +34 -9
  50. data/lib/auth0/mixins/access_token_struct.rb +20 -0
  51. data/lib/auth0/mixins/api_token_struct.rb +10 -0
  52. data/lib/auth0/mixins/headers.rb +35 -0
  53. data/lib/auth0/mixins/httpproxy.rb +37 -14
  54. data/lib/auth0/mixins/initializer.rb +10 -26
  55. data/lib/auth0/mixins/permission_struct.rb +3 -0
  56. data/lib/auth0/mixins/validation.rb +346 -0
  57. data/lib/auth0/mixins.rb +9 -1
  58. data/lib/auth0/version.rb +1 -1
  59. data/lib/auth0.rb +1 -0
  60. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_change_password/should_trigger_a_password_reset.yml +63 -0
  61. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_login_with_resource_owner/should_fail_with_an_incorrect_email.yml +54 -0
  62. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_login_with_resource_owner/should_fail_with_an_incorrect_password.yml +54 -0
  63. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_login_with_resource_owner/should_fail_with_an_invalid_audience.yml +55 -0
  64. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_login_with_resource_owner/should_login_successfully_with_a_custom_audience.yml +117 -0
  65. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_login_with_resource_owner/should_login_successfully_with_a_default_scope.yml +119 -0
  66. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_saml_metadata/should_retrieve_SAML_metadata.yml +57 -0
  67. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_userinfo/should_fail_as_not_authorized.yml +55 -0
  68. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_userinfo/should_return_the_userinfo.yml +118 -0
  69. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/_wsfed_metadata/should_retrieve_WSFED_metadata.yml +55 -0
  70. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/create_test_user.yml +58 -0
  71. data/spec/fixtures/vcr_cassettes/Auth0_Api_AuthenticationEndpoints/delete_test_user.yml +54 -0
  72. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Anomaly/_check_if_ip_is_blocked/should_return_200_response_code.yml +65 -0
  73. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Anomaly/_remove_ip_block/should_remove_an_IP_successfully.yml +60 -0
  74. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Blacklists/_add_token_to_blacklist/should_add_a_token_to_the_blacklist.yml +56 -0
  75. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Blacklists/_blacklisted_tokens/should_get_the_added_token_from_the_blacklist.yml +59 -0
  76. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/_client_grants/should_return_at_least_1_result.yml +62 -0
  77. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/_client_grants/should_return_the_first_page_of_one_result.yml +66 -0
  78. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/_client_grants/should_return_the_test_client_grant.yml +62 -0
  79. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/_delete_client_grant/should_delete_the_test_client_grant.yml +54 -0
  80. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/_patch_client_grant/should_update_the_test_client_grant.yml +64 -0
  81. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/create_test_client.yml +118 -0
  82. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/create_test_client_grant.yml +64 -0
  83. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/delete_test_client.yml +54 -0
  84. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ClientGrants/delete_test_client_grant.yml +54 -0
  85. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_client/_filters/should_exclude_and_include_fields_properly.yml +91 -0
  86. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_client/_filters/should_include_the_specified_fields.yml +63 -0
  87. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_client/should_get_the_test_client.yml +92 -0
  88. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_clients/_filters/should_exclude_fields_not_specified.yml +60 -0
  89. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_clients/_filters/should_exclude_the_specified_fields.yml +132 -0
  90. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_clients/_filters/should_include_the_specified_fields.yml +63 -0
  91. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_clients/_filters/should_paginate_results.yml +65 -0
  92. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_clients/should_get_at_least_one_client.yml +132 -0
  93. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_delete_client/should_delete_the_test_client_without_an_error.yml +54 -0
  94. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/_patch_client/should_update_the_client_with_the_correct_attributes.yml +94 -0
  95. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Clients/create_test_client.yml +118 -0
  96. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connection/_filters/should_exclude_the_fields_indicated.yml +63 -0
  97. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connection/_filters/should_include_the_fields_indicated.yml +61 -0
  98. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connection/should_find_the_correct_connection.yml +63 -0
  99. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connections/_filters/should_include_previously-created_connection_when_filtered.yml +59 -0
  100. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connections/_filters/should_should_exclude_the_fields_indicated_from_filtered_results.yml +59 -0
  101. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connections/_filters/should_should_include_the_fields_indicated_from_filtered_results.yml +59 -0
  102. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connections/should_include_the_previously_created_connection.yml +59 -0
  103. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_connections/should_not_be_empty.yml +59 -0
  104. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_delete_connection/should_delete_the_connection.yml +54 -0
  105. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_delete_connection_user/should_delete_the_user_created.yml +110 -0
  106. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/_update_connection/should_update_the_connection.yml +66 -0
  107. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/create_test_connection.yml +65 -0
  108. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Connections/create_test_user.yml +68 -0
  109. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_DeviceCredentials/_delete_device_credential/should_delete_the_test_credential_without_an_error.yml +54 -0
  110. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_DeviceCredentials/_device_credentials/_filter_by_type/should_exclude_the_test_credential.yml +59 -0
  111. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_DeviceCredentials/_device_credentials/should_have_at_least_1_entry.yml +62 -0
  112. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_DeviceCredentials/_device_credentials/should_include_the_test_credential.yml +62 -0
  113. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_DeviceCredentials/create_test_credential.yml +62 -0
  114. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_DeviceCredentials/create_test_user.yml +68 -0
  115. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_DeviceCredentials/delete_test_credential.yml +54 -0
  116. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_DeviceCredentials/delete_test_user.yml +54 -0
  117. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_configure_provider/should_configure_a_new_email_provider.yml +63 -0
  118. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_delete_provider/should_delete_the_existing_email_provider_without_an_error.yml +54 -0
  119. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_delete_provider/should_throw_an_error_trying_to_get_the_email_provider.yml +51 -0
  120. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_get_provider/_filters/should_get_the_existing_email_provider_with_specific_fields.yml +60 -0
  121. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_get_provider/_filters/should_get_the_existing_email_provider_without_specific_fields.yml +61 -0
  122. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_get_provider/should_get_the_existing_email_provider.yml +61 -0
  123. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/_update_provider/should_update_the_existing_email_provider.yml +63 -0
  124. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Emails/delete_existing_provider.yml +54 -0
  125. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_export_users_and_get_job/should_create_an_export_users_job_successfully.yml +61 -0
  126. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_export_users_and_get_job/should_get_the_export_users_job.yml +117 -0
  127. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_import_users_and_get_job/should_create_an_import_users_job_successfully.yml +60 -0
  128. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_import_users_and_get_job/should_get_the_import_users_job.yml +116 -0
  129. 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
  130. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_get_the_completed_verification_email.yml +175 -0
  131. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/_send_verification_email_and_get_job/should_reject_an_invalid_client_id.yml +109 -0
  132. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/delete_imported_user.yml +110 -0
  133. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Jobs/search_for_connection_id.yml +59 -0
  134. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_log/should_match_the_created_log_entry.yml +265 -0
  135. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_log/should_not_be_empty.yml +265 -0
  136. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_filters/should_exclude_fields_not_specified.yml +61 -0
  137. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_filters/should_exclude_the_specified_fields.yml +75 -0
  138. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_filters/should_have_one_log_entry.yml +76 -0
  139. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_filters/should_include_the_specified_fields.yml +62 -0
  140. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/_logs/_from/should_take_one_log_entry.yml +258 -0
  141. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/create_test_user.yml +68 -0
  142. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/delete_test_disabled_rule.yml +54 -0
  143. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/delete_test_enabled_rule.yml +54 -0
  144. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Logs/delete_test_user.yml +54 -0
  145. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_delete_resource_server/should_delete_the_test_server_without_an_error.yml +54 -0
  146. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_patch_resource_server/should_update_the_resource_server_with_the_correct_attributes.yml +61 -0
  147. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_server/should_get_the_test_server.yml +59 -0
  148. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_get_the_test_server.yml +59 -0
  149. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_return_at_least_1_result.yml +59 -0
  150. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/_resource_servers/should_return_the_first_page_of_one_result.yml +64 -0
  151. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/create_test_server.yml +61 -0
  152. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_ResourceServers/delete_test_server.yml +54 -0
  153. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_add_role_permissions/should_add_a_Permission_to_the_Role_successfully.yml +69 -0
  154. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_add_role_users/should_add_a_User_to_the_Role_successfully.yml +69 -0
  155. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_delete_role/should_delete_the_Role_successfully.yml +62 -0
  156. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role/should_get_the_Role_successfully.yml +67 -0
  157. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_permissions/should_get_exactly_1_Permission.yml +67 -0
  158. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_permissions/should_get_the_added_Permission_from_the_Role_successfully.yml +67 -0
  159. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_users/should_get_exactly_1_User.yml +67 -0
  160. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_role_users/should_get_the_added_User_from_the_Role_successfully.yml +67 -0
  161. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_get_roles/should_get_the_Role_successfully.yml +67 -0
  162. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_remove_role_permissions/should_remove_a_Permission_from_the_Role_successfully.yml +64 -0
  163. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/_update_role/should_update_the_Role_successfully.yml +69 -0
  164. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_api.yml +69 -0
  165. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_role.yml +69 -0
  166. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/create_test_user.yml +69 -0
  167. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/delete_test_api.yml +62 -0
  168. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Roles/delete_test_user.yml +62 -0
  169. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_delete_rule/should_delete_the_test_disabled_rule_without_an_error.yml +54 -0
  170. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_delete_rule/should_delete_the_test_enabled_rule_without_an_error.yml +54 -0
  171. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rule/_filters/should_exclude_the_fields_not_specified.yml +62 -0
  172. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rule/_filters/should_exclude_the_specified_fields.yml +62 -0
  173. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rule/_filters/should_include_the_specified_fields.yml +61 -0
  174. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rule/should_get_a_specific_rule.yml +62 -0
  175. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/_filters/should_exclude_fields_not_specified.yml +60 -0
  176. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/_filters/should_include_the_specified_fields.yml +61 -0
  177. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/_filters/should_return_at_least_1_disabled_rule.yml +63 -0
  178. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/_filters/should_return_at_least_1_enabled_rule.yml +62 -0
  179. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/_filters/should_return_paginated_results.yml +128 -0
  180. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_rules/should_return_at_least_1_rule.yml +64 -0
  181. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/_update_rule/should_update_the_disabled_rule_to_be_enabled.yml +64 -0
  182. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/create_test_disabled_rule.yml +65 -0
  183. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Rules/create_test_enabled_rule.yml +65 -0
  184. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Stats/_active_users/should_have_at_least_one_active_user.yml +59 -0
  185. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Stats/_daily_stats/should_have_at_least_one_stats_entry_for_the_timeframe.yml +63 -0
  186. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tenants/_get_tenant_settings/should_get_the_tenant_settings.yml +95 -0
  187. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tenants/_get_tenant_settings_with_specific_fields/should_exclude_a_field_not_requested.yml +61 -0
  188. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tenants/_get_tenant_settings_with_specific_fields/should_include_the_field_requested.yml +61 -0
  189. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tenants/_update_tenant_settings/should_revert_the_tenant_name.yml +96 -0
  190. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tenants/_update_tenant_settings/should_update_the_tenant_settings_with_a_new_tenant_name.yml +96 -0
  191. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tickets/_post_email_verification/should_create_an_email_verification_ticket.yml +63 -0
  192. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tickets/_post_password_change/should_create_a_password_change_ticket.yml +63 -0
  193. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tickets/create_test_user.yml +68 -0
  194. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Tickets/delete_test_user.yml +54 -0
  195. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_add_user_permissions/should_add_a_Permissions_for_a_User_successfully.yml +67 -0
  196. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_add_user_roles/should_add_a_Role_to_a_User_successfully.yml +62 -0
  197. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_delete_user/should_delete_the_User_successfully.yml +60 -0
  198. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_delete_user/should_delete_the_secondary_User_successfully.yml +60 -0
  199. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_delete_user_provider/should_attempt_to_delete_the_MFA_provider_for_the_User.yml +60 -0
  200. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_get_enrollments/should_get_Enrollments_for_a_User_successfully.yml +65 -0
  201. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_get_user_permissions/should_get_exactly_1_Permission_for_a_User_successfully.yml +65 -0
  202. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_get_user_permissions/should_get_the_correct_Permission_for_a_User_successfully.yml +65 -0
  203. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_get_user_roles/should_get_Roles_for_a_User_successfully.yml +65 -0
  204. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_invalidate_browsers/should_invalidate_MFA_browsers_for_the_User_successfully.yml +62 -0
  205. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_link_user_account/should_link_two_Users_successfully.yml +67 -0
  206. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_patch_user/should_patch_the_User_successfully.yml +68 -0
  207. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_remove_user_permissions/should_remove_a_Permission_from_a_User_successfully.yml +62 -0
  208. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_remove_user_roles/should_remove_a_Role_from_a_User_successfully.yml +62 -0
  209. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_unlink_user_account/should_unlink_two_Users_successfully.yml +65 -0
  210. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_user/_filters/should_exclude_fields_not_indicated.yml +65 -0
  211. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_user/_filters/should_exclude_the_fields_indicated.yml +65 -0
  212. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_user/_filters/should_include_the_fields_indicated.yml +65 -0
  213. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_user/should_retrieve_the_created_user.yml +65 -0
  214. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_user_logs/should_get_Logs_for_a_User_successfully.yml +69 -0
  215. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/is_expected_to_find_a_user_with_a_v2_search_engine_query.yml +65 -0
  216. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/is_expected_to_find_a_user_with_a_v3_search_engine_query.yml +65 -0
  217. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/should_exclude_the_indicated_fields_when_paginated.yml +65 -0
  218. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/should_include_the_indicated_fields_when_paginated.yml +65 -0
  219. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/should_not_include_other_fields_when_paginated.yml +65 -0
  220. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/_filters/should_return_the_correct_number_of_results_when_paginated.yml +65 -0
  221. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/_users/should_have_at_least_one_user.yml +65 -0
  222. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/create_secondary_test_user.yml +67 -0
  223. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/create_test_api.yml +67 -0
  224. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/create_test_role.yml +67 -0
  225. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/create_test_user.yml +67 -0
  226. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/delete_test_api.yml +60 -0
  227. data/spec/fixtures/vcr_cassettes/Auth0_Api_V2_Users/delete_test_role.yml +60 -0
  228. data/spec/integration/lib/auth0/api/api_authentication_spec.rb +96 -54
  229. data/spec/integration/lib/auth0/api/v2/api_anomaly_spec.rb +17 -0
  230. data/spec/integration/lib/auth0/api/v2/api_blacklist_spec.rb +18 -5
  231. data/spec/integration/lib/auth0/api/v2/api_client_grants_spec.rb +46 -33
  232. data/spec/integration/lib/auth0/api/v2/api_clients_spec.rb +115 -61
  233. data/spec/integration/lib/auth0/api/v2/api_connections_spec.rb +117 -103
  234. data/spec/integration/lib/auth0/api/v2/api_device_credentials_spec.rb +101 -58
  235. data/spec/integration/lib/auth0/api/v2/api_email_spec.rb +72 -77
  236. data/spec/integration/lib/auth0/api/v2/api_jobs_spec.rb +113 -60
  237. data/spec/integration/lib/auth0/api/v2/api_logs_spec.rb +46 -38
  238. data/spec/integration/lib/auth0/api/v2/api_resource_servers_spec.rb +110 -40
  239. data/spec/integration/lib/auth0/api/v2/api_roles_spec.rb +145 -0
  240. data/spec/integration/lib/auth0/api/v2/api_rules_spec.rb +119 -62
  241. data/spec/integration/lib/auth0/api/v2/api_stats_spec.rb +11 -14
  242. data/spec/integration/lib/auth0/api/v2/api_tenants_spec.rb +40 -34
  243. data/spec/integration/lib/auth0/api/v2/api_tickets_spec.rb +42 -28
  244. data/spec/integration/lib/auth0/api/v2/api_user_blocks_spec.rb +1 -1
  245. data/spec/integration/lib/auth0/api/v2/api_users_spec.rb +252 -120
  246. data/spec/integration/lib/auth0/auth0_client_spec.rb +32 -26
  247. data/spec/lib/auth0/api/v2/anomaly_spec.rb +26 -0
  248. data/spec/lib/auth0/api/v2/branding_spec.rb +70 -0
  249. data/spec/lib/auth0/api/v2/client_grants_spec.rb +34 -2
  250. data/spec/lib/auth0/api/v2/clients_spec.rb +50 -5
  251. data/spec/lib/auth0/api/v2/connections_spec.rb +49 -1
  252. data/spec/lib/auth0/api/v2/guardian_spec.rb +154 -0
  253. data/spec/lib/auth0/api/v2/jobs_spec.rb +109 -6
  254. data/spec/lib/auth0/api/v2/log_streams_spec.rb +84 -0
  255. data/spec/lib/auth0/api/v2/organizations_spec.rb +593 -0
  256. data/spec/lib/auth0/api/v2/prompts_spec.rb +88 -0
  257. data/spec/lib/auth0/api/v2/resource_servers_spec.rb +23 -0
  258. data/spec/lib/auth0/api/v2/roles_spec.rb +362 -0
  259. data/spec/lib/auth0/api/v2/rules_spec.rb +23 -1
  260. data/spec/lib/auth0/api/v2/tickets_spec.rb +95 -5
  261. data/spec/lib/auth0/api/v2/users_spec.rb +465 -61
  262. data/spec/lib/auth0/client_spec.rb +196 -18
  263. data/spec/lib/auth0/mixins/httpproxy_spec.rb +83 -4
  264. data/spec/lib/auth0/mixins/initializer_spec.rb +1 -0
  265. data/spec/lib/auth0/mixins/validation_spec.rb +498 -0
  266. data/spec/spec_helper.rb +54 -11
  267. data/spec/support/credentials.rb +6 -18
  268. data/spec/support/dummy_class.rb +7 -3
  269. data/spec/support/dummy_class_for_proxy.rb +1 -0
  270. data/spec/support/stub_response.rb +1 -1
  271. metadata +497 -53
  272. data/.travis.yml +0 -18
  273. data/build_travis.sh +0 -7
  274. data/deploy_documentation.sh +0 -29
  275. data/doc_config/templates/default/fulldoc/html/css/full_list.css +0 -79
  276. data/doc_config/templates/default/fulldoc/html/css/style.css +0 -546
  277. data/doc_config/templates/default/layout/html/breadcrumb.erb +0 -11
  278. data/doc_config/templates/default/layout/html/footer.erb +0 -115
  279. data/doc_config/templates/default/layout/html/headers.erb +0 -17
  280. data/doc_config/templates/default/layout/html/layout.erb +0 -27
  281. data/lib/auth0/api/v1/clients.rb +0 -48
  282. data/lib/auth0/api/v1/connections.rb +0 -53
  283. data/lib/auth0/api/v1/logs.rb +0 -34
  284. data/lib/auth0/api/v1/rules.rb +0 -45
  285. data/lib/auth0/api/v1/users.rb +0 -164
  286. data/lib/auth0/api/v1.rb +0 -19
  287. data/spec/lib/auth0/api/authentication_endpoints_spec.rb +0 -348
  288. data/spec/spec_helper_full.rb +0 -45
  289. data/spec/spec_helper_unit.rb +0 -3
@@ -1,115 +0,0 @@
1
- <footer class="site-footer">
2
- <div class="container">
3
- <div class="logo">
4
- <img src="https://cdn.auth0.com/styleguide/1.0.0/img/badge.png" width="30">
5
- </div>
6
- <div class="footer-grid">
7
- <div class="column">
8
- <div class="item">
9
- <h6>Product</h6>
10
- </div>
11
- <div class="item">
12
- <a href="https://auth0.com/pricing">Pricing</a>
13
- </div>
14
- <div class="item">
15
- <a href="https://auth0.com/why-auth0">Why Auth0</a>
16
- </div>
17
- <div class="item">
18
- <a href="https://auth0.com/how-it-works">How It Works</a>
19
- </div>
20
- </div>
21
- <div class="column">
22
- <div class="item">
23
- <h6>Company</h6>
24
- </div>
25
- <div class="item">
26
- <a href="https://auth0.com/about">About Us</a>
27
- </div>
28
- <div class="item">
29
- <a href="https://auth0.com/blog">Blog</a>
30
- </div>
31
- <div class="item">
32
- <a href="https://auth0.com/jobs">Jobs</a>
33
- </div>
34
- </div>
35
- <div class="column">
36
- <div class="item"><h6>Security</h6></div>
37
- <div class="item">
38
- <a href="https://auth0.com/availability-trust">Availability &amp; Trust</a>
39
- </div>
40
- <div class="item">
41
- <a href="https://auth0.com/security">Security</a>
42
- </div>
43
- <div class="item">
44
- <a href="https://auth0.com/whitehat">White Hat</a>
45
- </div>
46
- </div>
47
- <div class="column">
48
- <div class="item">
49
- <h6>Learn</h6>
50
- </div>
51
- <div class="item">
52
- <a href="https://auth0.com/support">Help &amp; Support</a>
53
- </div>
54
- <div class="item">
55
- <a href="https://auth0.com/docs">Documentation</a>
56
- </div>
57
- <div class="item">
58
- <a href="https://auth0.com/opensource">Open Source</a>
59
- </div>
60
- </div>
61
- <div class="column">
62
- <div class="item">
63
- <h6>Extend</h6>
64
- </div>
65
- <div class="item">
66
- <a href="https://auth0.com/lock">Lock</a>
67
- </div>
68
- <div class="item">
69
- <a href="https://auth0.com/wordpress">WordPress</a>
70
- </div>
71
- <div class="item">
72
- <a href="https://auth0.com/docs/apiv2">API Explorer</a>
73
- </div>
74
- </div>
75
- <div class="contact">
76
- <div class="column">
77
- <div class="item">
78
- <h6>Contact</h6>
79
- </div>
80
- <div class="item">
81
- <a href="mailto:support@auth0.com">Email Us</a>
82
- </div>
83
- <div class="item item-text">10900 NE 8th St.<br>Suite 700<br>Bellevue, WA 98004</div>
84
- </div>
85
- <div class="column no-heading">
86
- <div class="item item-phone-label">Sales</div>
87
- <div class="item"><a href="tel:+18882352699">+1 (888) 235-2699</a>
88
- <a href="tel:+14253126521">+1 (425) 312-6521</a>
89
- </div>
90
- <div class="item item-phone-label">Support</div>
91
- <div class="item"><a href="tel:+14255599554">+1 (425) 559-9554</a></div>
92
- </div>
93
- </div>
94
- </div>
95
- <div class="colophon">
96
- <div class="column">
97
- <div class="social">
98
- <div class="twitter">
99
- <iframe allowtransparency="true" frameborder="0" scrolling="no" src="https://platform.twitter.com/widgets/follow_button.html?screen_name=auth0" class="twitter"></iframe>
100
- </div>
101
- <div class="facebook">
102
- <iframe src="http://www.facebook.com/plugins/like.php?href=https%3A%2F%2Ffacebook.com%2Fgetauth0&width&layout=button_count&action=like&show_faces=false&show_count=false&share=false&height=21&appId=507756515938786" scrolling="no" frameborder="0" allowtransparency="true" class="facebook"></iframe>
103
- </div>
104
- </div>
105
- </div>
106
- <div class="column">
107
- <ul class="list-inline text-right">
108
- <li><a href="https://auth0.com/privacy">Privacy Policy</a></li>
109
- <li><a href="https://auth0.com/terms">Terms of Service</a></li>
110
- <li><span>© 2013-2016 Auth0 Inc. All Rights Reserved.</span></li>
111
- </ul>
112
- </div>
113
- </div>
114
- </div>
115
- </footer>
@@ -1,17 +0,0 @@
1
- <meta http-equiv="Content-Type" content="text/html; charset=<%= charset %>" />
2
- <title>
3
- <%= h @page_title %>
4
- <% if options.title && @page_title != options.title %>
5
- &mdash; <%= h options.title %>
6
- <% end %>
7
- </title>
8
- <link href="https://cdn.auth0.com/styleguide/latest/index.css" rel="stylesheet" />
9
- <link href="https://cdn.auth0.com/web-header/latest/standalone.css" rel="stylesheet"/>
10
- <script type="text/javascript" src="https://cdn.auth0.com/web-header/latest/standalone.min.js"></script>
11
- <% stylesheets.each do |stylesheet| %>
12
- <link rel="stylesheet" href="<%= url_for(stylesheet) %>" type="text/css" charset="utf-8" />
13
- <% end %>
14
- <%= erb :script_setup %>
15
- <% javascripts.each do |javascript| %>
16
- <script type="text/javascript" charset="utf-8" src="<%= url_for(javascript) %>"></script>
17
- <% end %>
@@ -1,27 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <%= erb(:headers) %>
6
- </head>
7
- <body>
8
- <header class="site-header clearfix"></header>
9
- <script type="text/javascript">(function() {
10
- var header = new WebHeader({ base_url: 'https://auth0.com' });
11
- header.render('header.site-header');
12
- })();
13
- </script>
14
-
15
- <div id="header">
16
- <%= erb(:breadcrumb) %>
17
- <%= erb(:search) %>
18
- <div class="clear"></div>
19
- </div>
20
-
21
- <iframe id="search_frame"></iframe>
22
-
23
- <div id="content"><%= yieldall %></div>
24
-
25
- <%= erb(:footer) %>
26
- </body>
27
- </html>
@@ -1,48 +0,0 @@
1
- module Auth0
2
- module Api
3
- module V1
4
- # {https://auth0.com/docs/api#applications}
5
- module Clients
6
- # {https://auth0.com/docs/api#!#get--api-clients}
7
- def clients
8
- path = '/api/clients'
9
- get(path)
10
- end
11
-
12
- alias get_clients clients
13
-
14
- # {https://auth0.com/docs/api#!#post--api-clients}
15
- def create_client(name, callbacks = '')
16
- path = '/api/clients'
17
- request_params = {
18
- name: name,
19
- callbacks: callbacks
20
- }
21
- post(path, request_params)
22
- end
23
-
24
- # @deprecated use {#patch_client}
25
- # {https://auth0.com/docs/api#!#put--api-clients--client-id-}
26
- def update_client(name, callbacks = '', client_id = @client_id)
27
- warn 'This endpoint has been deprecated in favor of PATCH.'
28
- path = "/api/clients/#{client_id}"
29
- request_params = {
30
- name: name,
31
- callbacks: callbacks
32
- }
33
- put(path, request_params)
34
- end
35
-
36
- # {https://auth0.com/docs/api#!#patch--api-clients--client-id-}
37
- def patch_client(name, callbacks = '', client_id = @client_id)
38
- path = "/api/clients/#{client_id}"
39
- request_params = {
40
- name: name,
41
- callbacks: callbacks
42
- }
43
- patch(path, request_params)
44
- end
45
- end
46
- end
47
- end
48
- end
@@ -1,53 +0,0 @@
1
- module Auth0
2
- module Api
3
- module V1
4
- # {https://auth0.com/docs/api#connections}
5
- module Connections
6
- # {https://auth0.com/docs/api#!#get--api-connections}
7
- def connections
8
- get('/api/connections')
9
- end
10
- alias get_connections connections
11
-
12
- # {https://auth0.com/docs/api#!#get--api-connections--connection-name-}
13
- def connection(connection_name)
14
- path = "/api/connections/#{connection_name}"
15
- get(path)
16
- end
17
- alias get_connection connection
18
-
19
- # {https://auth0.com/docs/api#!#delete--api-connections--connection-name-}
20
- def delete_connection(connection_name)
21
- path = "/api/connections/#{connection_name}"
22
- delete(path)
23
- end
24
-
25
- # {https://auth0.com/docs/api#!#post--api-connections}
26
- def create_connection(connection_name, strategy, tenant_domain, domain_aliases = nil)
27
- path = '/api/connections'
28
- request_params = {
29
- name: connection_name,
30
- strategy: strategy,
31
- options: {
32
- tenant_domain: tenant_domain,
33
- domain_aliases: domain_aliases
34
- }
35
- }
36
- post(path, request_params)
37
- end
38
-
39
- # {https://auth0.com/docs/api#!#put--api-connections--connection-name-}
40
- def update_connection(connection_name, tenant_domain, status = true)
41
- path = "/api/connections/#{connection_name}"
42
- request_params = {
43
- status: status,
44
- options: {
45
- tenant_domain: tenant_domain
46
- }
47
- }
48
- put(path, request_params)
49
- end
50
- end
51
- end
52
- end
53
- end
@@ -1,34 +0,0 @@
1
- module Auth0
2
- module Api
3
- module V1
4
- # {https://auth0.com/docs/api#logs}
5
- module Logs
6
- # https://auth0.com/docs/api/v1#!#logs
7
- def logs(options = {})
8
- acceptable_params = %i(take from search_criteria page per_page sort fields exclude_fields)
9
- options.reject! do |key, value|
10
- next unless key.nil? || value.nil? || !acceptable_params.include?(key.to_sym)
11
- warn "#{key} is not in acceptable params list: #{acceptable_params}"
12
- true
13
- end
14
- path = "/api/logs?#{URI.encode_www_form(options)}"
15
- get(path)
16
- end
17
-
18
- alias search_logs logs
19
-
20
- # {https://auth0.com/docs/api#!#get--api-logs--_id-}
21
- def log(id)
22
- path = "/api/logs/#{id}"
23
- get(path)
24
- end
25
-
26
- # {https://auth0.com/docs/api#!#get--api-users--user_id--logs-page--number--per_page--items-}
27
- def user_logs(user_id, page = 0, per_page = 50)
28
- path = "/api/users/#{user_id}/logs?page=#{page}&per_page=#{per_page}"
29
- get(path)
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,45 +0,0 @@
1
- module Auth0
2
- module Api
3
- module V1
4
- # https://auth0.com/docs/api#rules
5
- module Rules
6
- # https://auth0.com/docs/api#!#get--api-rules
7
- def rules
8
- path = '/api/rules'
9
- get(path)
10
- end
11
-
12
- alias get_rules rules
13
-
14
- # https://auth0.com/docs/api#!#post--api-rules
15
- def create_rule(name, script, order = nil, status = true)
16
- path = '/api/rules'
17
- request_params = {
18
- name: name,
19
- status: status,
20
- script: script,
21
- order: order
22
- }
23
- post(path, request_params)
24
- end
25
-
26
- # https://auth0.com/docs/api#!#put--api-rules--rule-name-
27
- def update_rule(name, script, order = nil, status = true)
28
- path = "/api/rules/#{name}"
29
- request_params = {
30
- status: status,
31
- script: script,
32
- order: order
33
- }
34
- put(path, request_params)
35
- end
36
-
37
- # https://auth0.com/docs/api#!#delete--api-rules--rule-name-
38
- def delete_rule(name)
39
- path = "/api/rules/#{name}"
40
- delete(path)
41
- end
42
- end
43
- end
44
- end
45
- end
@@ -1,164 +0,0 @@
1
- module Auth0
2
- module Api
3
- # rubocop:disable Metrics/ModuleLength
4
- module V1
5
- # {https://auth0.com/docs/api#users}
6
- module Users
7
- # {https://auth0.com/docs/api#!#get--api-users}
8
- #
9
- # {https://auth0.com/docs/api#!#get--api-users-search--criteria-}
10
- def users(search = nil)
11
- path = '/api/users'
12
- path += "?search=#{search}" unless search.to_s.empty?
13
- get(path)
14
- end
15
-
16
- alias users_search users
17
- alias get_users users
18
-
19
- # {https://auth0.com/docs/api#!#get--api-users--user_id-}
20
- def user(user_id)
21
- path = "/api/users/#{user_id}"
22
- get(path)
23
- end
24
-
25
- alias get_user user
26
-
27
- # {https://auth0.com/docs/api#!#get--api-users--user_id--devices}
28
- def user_devices(user_id)
29
- path = "/api/users/#{user_id}/devices"
30
- get(path)
31
- end
32
-
33
- # {https://auth0.com/docs/api#!#get--api-connections--connection--users}
34
- # {https://auth0.com/docs/api#!#get--api-connections--connection--users-search--criteria-}
35
- def connection_users(connection_name, search = nil)
36
- path = "/api/connections/#{connection_name}/users"
37
- path += "?search=#{search}" unless search.to_s.empty?
38
- get(path)
39
- end
40
-
41
- alias search_connection_users connection_users
42
-
43
- # {https://auth0.com/docs/api#!#get--api-enterpriseconnections-users-search--criteria-}
44
- def enterpriseconnections_users(search_criteria = nil, per_page = 500)
45
- path = "/api/enterpriseconnections/users?search=#{search_criteria}&per_page=#{per_page.to_i}"
46
- get(path)
47
- end
48
-
49
- # {https://auth0.com/docs/api#!#get--api-socialconnections-users-search--criteria-}
50
- def socialconnections_users(search_criteria = nil, per_page = 500)
51
- path = "/api/socialconnections/users?search=#{search_criteria}&per_page=#{per_page.to_i}"
52
- get(path)
53
- end
54
-
55
- # {https://auth0.com/docs/api#!#get--api-clients--client-id--users}
56
- def client_users(client_id = @client_id)
57
- path = "/api/clients/#{client_id}/users"
58
- get(path)
59
- end
60
-
61
- # {https://auth0.com/docs/api#!#post--api-users}
62
- def create_user(email, password, connection_name, request_params = {})
63
- options = { email: email, password: password, connection: connection_name }
64
- request_params.merge!(options)
65
- path = '/api/users'
66
- post(path, request_params)
67
- end
68
-
69
- # {https://auth0.com/docs/api#!#post--api-users--user_id--send_verification_email}
70
- def send_verification_email(user_id)
71
- path = "/api/users/#{user_id}/send_verification_email"
72
- post(path)
73
- end
74
-
75
- # {https://auth0.com/docs/api#!#post--api-users--user_id--change_password_ticket}
76
- def change_password_ticket(user_id, new_password, result_url = nil)
77
- request_params = { 'newPassword' => new_password, 'resultUrl' => result_url }
78
- path = "/api/users/#{user_id}/change_password_ticket"
79
- post(path, request_params)
80
- end
81
-
82
- # {https://auth0.com/docs/api#!#post--api-users--user_id--verification_ticket}
83
- def verification_ticket(user_id, result_url = nil)
84
- request_params = { 'resultUrl' => result_url }
85
- path = "/api/users/#{user_id}/verification_ticket"
86
- post(path, request_params)
87
- end
88
-
89
- # {https://auth0.com/docs/api#!#post--api-users--user_id--publickey}
90
- def create_public_key(user_id, device, public_key)
91
- path = "/api/users/#{user_id}/public_key"
92
- request_params = { device: device, public_key: public_key }
93
- post(path, request_params)
94
- end
95
-
96
- # {https://auth0.com/docs/api#!#put--api-users--user_id--email}
97
- def update_user_email(user_id, email, verify = true)
98
- path = "/api/users/#{user_id}/email"
99
- request_params = { email: email, verify: verify }
100
- put(path, request_params)
101
- end
102
-
103
- # {https://auth0.com/docs/api#!#put--api-users--user_id--metadata}
104
- # This will overwrite user's metadata, be really carefull, preffer using patch instead
105
- def update_user_metadata(user_id, metadata = {})
106
- path = "/api/users/#{user_id}/metadata"
107
- put(path, metadata)
108
- end
109
-
110
- # {https://auth0.com/docs/api#!#put--api-users--user_id--password}
111
- def update_user_password(user_id, password, verify = true)
112
- path = "/api/users/#{user_id}/password"
113
- request_params = { password: password, verify: verify }
114
- put(path, request_params)
115
- end
116
-
117
- # {https://auth0.com/docs/api#!#put--api-users--email--password}
118
- def update_user_password_using_email(email, password, connection_name, verify = true)
119
- request_params = {
120
- email: email,
121
- password: password,
122
- connection: connection_name,
123
- verify: verify
124
- }
125
- path = "/api/users/#{email}/password"
126
- put(path, request_params)
127
- end
128
-
129
- # {https://auth0.com/docs/api#!#patch--api-users--user_id--metadata}
130
- def patch_user_metadata(user_id, metadata = {})
131
- path = "/api/users/#{user_id}/metadata"
132
- patch(path, metadata)
133
- end
134
-
135
- # {https://auth0.com/docs/api#!#delete--api-users}
136
- #
137
- # This will remove all your users
138
- def delete_users
139
- path = '/api/users/'
140
- delete(path)
141
- end
142
-
143
- # {https://auth0.com/docs/api#!#delete--api-users--user_id-}
144
- def delete_user(user_id)
145
- raise Auth0::MissingUserId, 'if you want to remove all users use delete_users method' if user_id.to_s.empty?
146
- path = "/api/users/#{user_id}"
147
- delete(path)
148
- end
149
-
150
- # {https://auth0.com/docs/api#!#delete--api-users--user_id--refresh_tokens--refresh_token-}
151
- def revoke_user_refresh_token(user_id, refresh_token)
152
- path = "/api/users/#{user_id}/refresh_tokens/#{refresh_token}"
153
- delete(path)
154
- end
155
-
156
- # {https://auth0.com/docs/api#!#delete--api-users--user_id--publickey-device--device-}
157
- def revoke_user_device_public_key(user_id, device)
158
- path = "/api/users/#{user_id}/publickey?device=#{device}"
159
- delete(path)
160
- end
161
- end
162
- end
163
- end
164
- end
data/lib/auth0/api/v1.rb DELETED
@@ -1,19 +0,0 @@
1
- require 'auth0/api/v1/users'
2
- require 'auth0/api/v1/clients'
3
- require 'auth0/api/v1/connections'
4
- require 'auth0/api/v1/rules'
5
- require 'auth0/api/v1/logs'
6
- module Auth0
7
- # Space for all API calls
8
- module Api
9
- # {https://auth0.com/docs/api}
10
- # Describing current functionality of Auth0 API V1
11
- module V1
12
- include Auth0::Api::V1::Users
13
- include Auth0::Api::V1::Connections
14
- include Auth0::Api::V1::Clients
15
- include Auth0::Api::V1::Rules
16
- include Auth0::Api::V1::Logs
17
- end
18
- end
19
- end