auth0 4.17.1 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/.yardoc/checksums +22 -0
  4. data/.yardoc/complete +0 -0
  5. data/.yardoc/object_types +0 -0
  6. data/.yardoc/objects/root.dat +0 -0
  7. data/.yardoc/proxy_types +0 -0
  8. data/CHANGELOG.md +33 -0
  9. data/Gemfile +0 -1
  10. data/Gemfile.lock +19 -21
  11. data/README.md +1 -7
  12. data/Rakefile +0 -22
  13. data/auth0.gemspec +0 -1
  14. data/examples/ruby-api/.gitignore +0 -6
  15. data/lib/auth0/api/authentication_endpoints.rb +6 -220
  16. data/lib/auth0/api/v2/users.rb +7 -5
  17. data/lib/auth0/exception.rb +2 -7
  18. data/lib/auth0/mixins.rb +0 -1
  19. data/lib/auth0/mixins/access_token_struct.rb +2 -2
  20. data/lib/auth0/mixins/api_token_struct.rb +2 -2
  21. data/lib/auth0/mixins/initializer.rb +1 -7
  22. data/lib/auth0/mixins/permission_struct.rb +2 -2
  23. data/lib/auth0/mixins/validation.rb +1 -1
  24. data/lib/auth0/version.rb +1 -1
  25. data/spec/integration/lib/auth0/api/api_authentication_spec.rb +1 -1
  26. data/spec/integration/lib/auth0/api/v2/api_roles_spec.rb +1 -1
  27. data/spec/integration/lib/auth0/api/v2/api_users_spec.rb +1 -1
  28. data/spec/lib/auth0/api/v2/roles_spec.rb +4 -4
  29. data/spec/lib/auth0/api/v2/users_spec.rb +19 -9
  30. data/spec/support/credentials.rb +0 -19
  31. metadata +7 -31
  32. data/deploy_documentation.sh +0 -29
  33. data/doc_config/templates/default/fulldoc/html/css/full_list.css +0 -79
  34. data/doc_config/templates/default/fulldoc/html/css/style.css +0 -546
  35. data/doc_config/templates/default/layout/html/breadcrumb.erb +0 -11
  36. data/doc_config/templates/default/layout/html/footer.erb +0 -115
  37. data/doc_config/templates/default/layout/html/headers.erb +0 -17
  38. data/doc_config/templates/default/layout/html/layout.erb +0 -27
  39. data/lib/auth0/api/v1.rb +0 -19
  40. data/lib/auth0/api/v1/clients.rb +0 -58
  41. data/lib/auth0/api/v1/connections.rb +0 -68
  42. data/lib/auth0/api/v1/logs.rb +0 -43
  43. data/lib/auth0/api/v1/rules.rb +0 -57
  44. data/lib/auth0/api/v1/users.rb +0 -227
  45. data/spec/lib/auth0/api/authentication_endpoints_spec.rb +0 -703
@@ -1,11 +0,0 @@
1
- <div id="menu">
2
- <% if @contents || @file %>
3
- <% if object != '_index.html' %><a href="<%= url_for_index.gsub! '_index.html', 'index.html' %>">Index</a> &raquo; <% end %>
4
- <span class="title"><%= @breadcrumb_title %></span>
5
- <% elsif object.is_a?(CodeObjects::Base) %>
6
- <a href="<%= url_for_index.gsub! '_index.html', 'index.html' %>"><% if object.root? || object.type == :method %>Index<% else %>Index (<%= object.name.to_s[0,1] %>)<% end %></a> &raquo;
7
- <%= @breadcrumb.map {|obj| "<span class='title'>" + linkify(obj, obj.name) + "</span>" }.join(" &raquo; ") %>
8
- <%= @breadcrumb.size > 0 ? " &raquo; " : "" %>
9
- <span class="title"><%= object.root? ? "Top Level Namespace" : object.name(true) %></span>
10
- <% end %>
11
- </div>
@@ -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,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
@@ -1,58 +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
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
8
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
9
- def clients
10
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
11
- path = '/api/clients'
12
- get(path)
13
- end
14
-
15
- alias get_clients clients
16
-
17
- # {https://auth0.com/docs/api#!#post--api-clients}
18
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
19
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
20
- def create_client(name, callbacks = '')
21
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
22
- path = '/api/clients'
23
- request_params = {
24
- name: name,
25
- callbacks: callbacks
26
- }
27
- post(path, request_params)
28
- end
29
-
30
- # {https://auth0.com/docs/api#!#put--api-clients--client-id-}
31
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
32
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
33
- def update_client(name, callbacks = '', client_id = @client_id)
34
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
35
- path = "/api/clients/#{client_id}"
36
- request_params = {
37
- name: name,
38
- callbacks: callbacks
39
- }
40
- put(path, request_params)
41
- end
42
-
43
- # {https://auth0.com/docs/api#!#patch--api-clients--client-id-}
44
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Clients
45
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
46
- def patch_client(name, callbacks = '', client_id = @client_id)
47
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
48
- path = "/api/clients/#{client_id}"
49
- request_params = {
50
- name: name,
51
- callbacks: callbacks
52
- }
53
- patch(path, request_params)
54
- end
55
- end
56
- end
57
- end
58
- end
@@ -1,68 +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
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
8
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
9
- def connections
10
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
11
- get('/api/connections')
12
- end
13
- alias get_connections connections
14
-
15
- # {https://auth0.com/docs/api#!#get--api-connections--connection-name-}
16
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
17
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
18
- def connection(connection_name)
19
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
20
- path = "/api/connections/#{connection_name}"
21
- get(path)
22
- end
23
- alias get_connection connection
24
-
25
- # {https://auth0.com/docs/api#!#delete--api-connections--connection-name-}
26
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
27
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
28
- def delete_connection(connection_name)
29
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
30
- path = "/api/connections/#{connection_name}"
31
- delete(path)
32
- end
33
-
34
- # {https://auth0.com/docs/api#!#post--api-connections}
35
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
36
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
37
- def create_connection(connection_name, strategy, tenant_domain, domain_aliases = nil)
38
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
39
- path = '/api/connections'
40
- request_params = {
41
- name: connection_name,
42
- strategy: strategy,
43
- options: {
44
- tenant_domain: tenant_domain,
45
- domain_aliases: domain_aliases
46
- }
47
- }
48
- post(path, request_params)
49
- end
50
-
51
- # {https://auth0.com/docs/api#!#put--api-connections--connection-name-}
52
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Connections
53
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
54
- def update_connection(connection_name, tenant_domain, status = true)
55
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
56
- path = "/api/connections/#{connection_name}"
57
- request_params = {
58
- status: status,
59
- options: {
60
- tenant_domain: tenant_domain
61
- }
62
- }
63
- put(path, request_params)
64
- end
65
- end
66
- end
67
- end
68
- end
@@ -1,43 +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
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Logs
8
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
9
- def logs(options = {})
10
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
11
- acceptable_params = %i(take from search_criteria page per_page sort fields exclude_fields)
12
- options.reject! do |key, value|
13
- next unless key.nil? || value.nil? || !acceptable_params.include?(key.to_sym)
14
- warn "#{key} is not in acceptable params list: #{acceptable_params}"
15
- true
16
- end
17
- path = "/api/logs?#{URI.encode_www_form(options)}"
18
- get(path)
19
- end
20
-
21
- alias search_logs logs
22
-
23
- # {https://auth0.com/docs/api#!#get--api-logs--_id-}
24
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Logs
25
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
26
- def log(id)
27
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
28
- path = "/api/logs/#{id}"
29
- get(path)
30
- end
31
-
32
- # {https://auth0.com/docs/api#!#get--api-users--user_id--logs-page--number--per_page--items-}
33
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Logs
34
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
35
- def user_logs(user_id, page = 0, per_page = 50)
36
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
37
- path = "/api/users/#{user_id}/logs?page=#{page}&per_page=#{per_page}"
38
- get(path)
39
- end
40
- end
41
- end
42
- end
43
- end
@@ -1,57 +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
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
8
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
9
- def rules
10
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
11
- path = '/api/rules'
12
- get(path)
13
- end
14
-
15
- alias get_rules rules
16
-
17
- # https://auth0.com/docs/api#!#post--api-rules
18
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
19
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
20
- def create_rule(name, script, order = nil, status = true)
21
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
22
- path = '/api/rules'
23
- request_params = {
24
- name: name,
25
- status: status,
26
- script: script,
27
- order: order
28
- }
29
- post(path, request_params)
30
- end
31
-
32
- # https://auth0.com/docs/api#!#put--api-rules--rule-name-
33
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
34
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
35
- def update_rule(name, script, order = nil, status = true)
36
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
37
- path = "/api/rules/#{name}"
38
- request_params = {
39
- status: status,
40
- script: script,
41
- order: order
42
- }
43
- put(path, request_params)
44
- end
45
-
46
- # https://auth0.com/docs/api#!#delete--api-rules--rule-name-
47
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Rules
48
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
49
- def delete_rule(name)
50
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
51
- path = "/api/rules/#{name}"
52
- delete(path)
53
- end
54
- end
55
- end
56
- end
57
- end
@@ -1,227 +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
- # @deprecated - 4.14.0, please use Auth0::Api::V2::Users
11
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
12
- def users(search = nil)
13
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
14
- path = '/api/users'
15
- path += "?search=#{search}" unless search.to_s.empty?
16
- get(path)
17
- end
18
-
19
- alias users_search users
20
- alias get_users users
21
-
22
- # {https://auth0.com/docs/api#!#get--api-users--user_id-}
23
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
24
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
25
- def user(user_id)
26
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
27
- path = "/api/users/#{user_id}"
28
- get(path)
29
- end
30
-
31
- alias get_user user
32
-
33
- # {https://auth0.com/docs/api#!#get--api-users--user_id--devices}
34
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
35
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
36
- def user_devices(user_id)
37
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
38
- path = "/api/users/#{user_id}/devices"
39
- get(path)
40
- end
41
-
42
- # {https://auth0.com/docs/api#!#get--api-connections--connection--users}
43
- # {https://auth0.com/docs/api#!#get--api-connections--connection--users-search--criteria-}
44
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
45
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
46
- def connection_users(connection_name, search = nil)
47
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
48
- path = "/api/connections/#{connection_name}/users"
49
- path += "?search=#{search}" unless search.to_s.empty?
50
- get(path)
51
- end
52
-
53
- alias search_connection_users connection_users
54
-
55
- # {https://auth0.com/docs/api#!#get--api-enterpriseconnections-users-search--criteria-}
56
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
57
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
58
- def enterpriseconnections_users(search_criteria = nil, per_page = 500)
59
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
60
- path = "/api/enterpriseconnections/users?search=#{search_criteria}&per_page=#{per_page.to_i}"
61
- get(path)
62
- end
63
-
64
- # {https://auth0.com/docs/api#!#get--api-socialconnections-users-search--criteria-}
65
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
66
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
67
- def socialconnections_users(search_criteria = nil, per_page = 500)
68
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
69
- path = "/api/socialconnections/users?search=#{search_criteria}&per_page=#{per_page.to_i}"
70
- get(path)
71
- end
72
-
73
- # {https://auth0.com/docs/api#!#get--api-clients--client-id--users}
74
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
75
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
76
- def client_users(client_id = @client_id)
77
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
78
- path = "/api/clients/#{client_id}/users"
79
- get(path)
80
- end
81
-
82
- # {https://auth0.com/docs/api#!#post--api-users}
83
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
84
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
85
- def create_user(email, password, connection_name, request_params = {})
86
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
87
- options = { email: email, password: password, connection: connection_name }
88
- request_params.merge!(options)
89
- path = '/api/users'
90
- post(path, request_params)
91
- end
92
-
93
- # {https://auth0.com/docs/api#!#post--api-users--user_id--send_verification_email}
94
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
95
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
96
- def send_verification_email(user_id)
97
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
98
- path = "/api/users/#{user_id}/send_verification_email"
99
- post(path)
100
- end
101
-
102
- # {https://auth0.com/docs/api#!#post--api-users--user_id--change_password_ticket}
103
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
104
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
105
- def change_password_ticket(user_id, new_password, result_url = nil)
106
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
107
- request_params = { 'newPassword' => new_password, 'resultUrl' => result_url }
108
- path = "/api/users/#{user_id}/change_password_ticket"
109
- post(path, request_params)
110
- end
111
-
112
- # {https://auth0.com/docs/api#!#post--api-users--user_id--verification_ticket}
113
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
114
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
115
- def verification_ticket(user_id, result_url = nil)
116
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
117
- request_params = { 'resultUrl' => result_url }
118
- path = "/api/users/#{user_id}/verification_ticket"
119
- post(path, request_params)
120
- end
121
-
122
- # {https://auth0.com/docs/api#!#post--api-users--user_id--publickey}
123
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
124
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
125
- def create_public_key(user_id, device, public_key)
126
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
127
- path = "/api/users/#{user_id}/public_key"
128
- request_params = { device: device, public_key: public_key }
129
- post(path, request_params)
130
- end
131
-
132
- # {https://auth0.com/docs/api#!#put--api-users--user_id--email}
133
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
134
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
135
- def update_user_email(user_id, email, verify = true)
136
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
137
- path = "/api/users/#{user_id}/email"
138
- request_params = { email: email, verify: verify }
139
- put(path, request_params)
140
- end
141
-
142
- # {https://auth0.com/docs/api#!#put--api-users--user_id--metadata}
143
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
144
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
145
- # This will overwrite user's metadata, be really carefull, preffer using patch instead
146
- def update_user_metadata(user_id, metadata = {})
147
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
148
- path = "/api/users/#{user_id}/metadata"
149
- put(path, metadata)
150
- end
151
-
152
- # {https://auth0.com/docs/api#!#put--api-users--user_id--password}
153
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
154
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
155
- def update_user_password(user_id, password, verify = true)
156
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
157
- path = "/api/users/#{user_id}/password"
158
- request_params = { password: password, verify: verify }
159
- put(path, request_params)
160
- end
161
-
162
- # {https://auth0.com/docs/api#!#put--api-users--email--password}
163
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
164
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
165
- def update_user_password_using_email(email, password, connection_name, verify = true)
166
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
167
- request_params = {
168
- email: email,
169
- password: password,
170
- connection: connection_name,
171
- verify: verify
172
- }
173
- path = "/api/users/#{email}/password"
174
- put(path, request_params)
175
- end
176
-
177
- # {https://auth0.com/docs/api#!#patch--api-users--user_id--metadata}
178
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
179
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
180
- def patch_user_metadata(user_id, metadata = {})
181
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
182
- path = "/api/users/#{user_id}/metadata"
183
- patch(path, metadata)
184
- end
185
-
186
- # {https://auth0.com/docs/api#!#delete--api-users}
187
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
188
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
189
- #
190
- # This will remove all your users
191
- def delete_users
192
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
193
- path = '/api/users/'
194
- delete(path)
195
- end
196
-
197
- # {https://auth0.com/docs/api#!#delete--api-users--user_id-}
198
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
199
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
200
- def delete_user(user_id)
201
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
202
- raise Auth0::MissingUserId, 'if you want to remove all users use delete_users method' if user_id.to_s.empty?
203
- path = "/api/users/#{user_id}"
204
- delete(path)
205
- end
206
-
207
- # {https://auth0.com/docs/api#!#delete--api-users--user_id--refresh_tokens--refresh_token-}
208
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
209
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
210
- def revoke_user_refresh_token(user_id, refresh_token)
211
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
212
- path = "/api/users/#{user_id}/refresh_tokens/#{refresh_token}"
213
- delete(path)
214
- end
215
-
216
- # {https://auth0.com/docs/api#!#delete--api-users--user_id--publickey-device--device-}
217
- # @deprecated - 4.14.0, API v1 is no longer in use, please use Auth0::Api::V2::Users
218
- # @see - https://auth0.com/docs/migrations/guides/management-api-v1-v2
219
- def revoke_user_device_public_key(user_id, device)
220
- warn "[DEPRECATION] Api::V1 is deprecated please use Api::V2"
221
- path = "/api/users/#{user_id}/publickey?device=#{device}"
222
- delete(path)
223
- end
224
- end
225
- end
226
- end
227
- end