auth0-python 4.0.0__tar.gz → 4.1.0__tar.gz

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 (112) hide show
  1. {auth0-python-4.0.0 → auth0-python-4.1.0}/PKG-INFO +1 -10
  2. {auth0-python-4.0.0 → auth0-python-4.1.0}/README.md +0 -9
  3. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/__init__.py +1 -1
  4. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/asyncify.py +5 -5
  5. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/async_token_verifier.py +3 -5
  6. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/base.py +1 -1
  7. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/client_authentication.py +1 -1
  8. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/database.py +2 -2
  9. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/delegated.py +1 -4
  10. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/get_token.py +6 -6
  11. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/passwordless.py +2 -2
  12. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/revoke_token.py +1 -1
  13. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/social.py +1 -1
  14. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/token_verifier.py +5 -7
  15. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/users.py +3 -4
  16. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/exceptions.py +2 -4
  17. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/actions.py +3 -3
  18. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/async_auth0.py +1 -1
  19. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/attack_protection.py +1 -1
  20. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/auth0.py +1 -1
  21. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/blacklists.py +2 -2
  22. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/branding.py +56 -3
  23. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/client_credentials.py +2 -2
  24. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/client_grants.py +3 -3
  25. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/clients.py +3 -3
  26. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/connections.py +3 -3
  27. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/custom_domains.py +2 -2
  28. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/device_credentials.py +3 -3
  29. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/email_templates.py +3 -3
  30. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/emails.py +3 -3
  31. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/grants.py +2 -2
  32. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/guardian.py +8 -8
  33. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/hooks.py +3 -3
  34. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/jobs.py +4 -4
  35. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/log_streams.py +3 -3
  36. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/logs.py +3 -3
  37. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/organizations.py +3 -3
  38. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/prompts.py +3 -3
  39. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/resource_servers.py +3 -3
  40. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/roles.py +8 -8
  41. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/rules.py +3 -3
  42. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/rules_configs.py +3 -3
  43. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/stats.py +2 -2
  44. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/tenants.py +2 -2
  45. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/tickets.py +2 -2
  46. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/user_blocks.py +3 -3
  47. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/users.py +110 -20
  48. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/users_by_email.py +2 -2
  49. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/rest.py +8 -12
  50. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/rest_async.py +2 -2
  51. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/authentication/test_base.py +2 -2
  52. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/authentication/test_database.py +1 -2
  53. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/authentication/test_delegated.py +1 -5
  54. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/authentication/test_enterprise.py +1 -4
  55. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/authentication/test_get_token.py +1 -7
  56. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/authentication/test_passwordless.py +1 -5
  57. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/authentication/test_revoke_token.py +1 -3
  58. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/authentication/test_social.py +1 -2
  59. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/authentication/test_token_verifier.py +1 -2
  60. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/authentication/test_users.py +1 -3
  61. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_actions.py +1 -2
  62. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_atack_protection.py +1 -2
  63. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_blacklists.py +1 -2
  64. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_branding.py +63 -2
  65. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_client_credentials.py +1 -2
  66. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_client_grants.py +1 -2
  67. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_clients.py +1 -2
  68. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_connections.py +1 -2
  69. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_custom_domains.py +1 -2
  70. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_device_credentials.py +1 -2
  71. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_email_endpoints.py +1 -2
  72. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_emails.py +1 -2
  73. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_grants.py +1 -2
  74. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_guardian.py +1 -2
  75. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_hooks.py +1 -2
  76. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_jobs.py +1 -2
  77. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_log_streams.py +1 -2
  78. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_logs.py +1 -2
  79. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_organizations.py +1 -2
  80. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_prompts.py +1 -2
  81. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_resource_servers.py +1 -2
  82. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_rest.py +2 -2
  83. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_roles.py +1 -2
  84. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_rules.py +1 -2
  85. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_rules_configs.py +1 -2
  86. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_stats.py +1 -2
  87. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_tenants.py +1 -2
  88. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_tickets.py +1 -2
  89. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_user_blocks.py +1 -2
  90. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_users.py +79 -2
  91. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_users_by_email.py +1 -2
  92. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test_async/test_async_auth0.py +1 -1
  93. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test_async/test_async_token_verifier.py +1 -1
  94. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test_async/test_asyncify.py +2 -2
  95. auth0-python-4.1.0/auth0/utils.py +11 -0
  96. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0_python.egg-info/PKG-INFO +1 -10
  97. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0_python.egg-info/requires.txt +0 -1
  98. {auth0-python-4.0.0 → auth0-python-4.1.0}/setup.py +3 -4
  99. auth0-python-4.0.0/auth0/utils.py +0 -15
  100. {auth0-python-4.0.0 → auth0-python-4.1.0}/LICENSE +0 -0
  101. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/__init__.py +0 -0
  102. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/authentication/enterprise.py +0 -0
  103. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/management/__init__.py +0 -0
  104. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/__init__.py +0 -0
  105. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/authentication/__init__.py +0 -0
  106. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/__init__.py +0 -0
  107. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test/management/test_auth0.py +0 -0
  108. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0/test_async/__init__.py +0 -0
  109. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0_python.egg-info/SOURCES.txt +0 -0
  110. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0_python.egg-info/dependency_links.txt +0 -0
  111. {auth0-python-4.0.0 → auth0-python-4.1.0}/auth0_python.egg-info/top_level.txt +0 -0
  112. {auth0-python-4.0.0 → auth0-python-4.1.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: auth0-python
3
- Version: 4.0.0
3
+ Version: 4.1.0
4
4
  Summary: Auth0 Python SDK
5
5
  Home-page: https://github.com/auth0/auth0-python
6
6
  Author: Auth0
@@ -52,15 +52,6 @@ pip install auth0-python
52
52
  #### Authentication SDK
53
53
  The Authentication SDK is organized into components that mirror the structure of the
54
54
  [API documentation](https://auth0.com/docs/auth-api).
55
- For example:
56
-
57
- ```python
58
- from auth0.authentication import Social
59
-
60
- social = Social('my-domain.us.auth0.com', 'my-client-id')
61
-
62
- social.login(access_token='...', connection='facebook')
63
- ```
64
55
 
65
56
  If you need to sign up a user using their email and password, you can use the Database object.
66
57
 
@@ -29,15 +29,6 @@ pip install auth0-python
29
29
  #### Authentication SDK
30
30
  The Authentication SDK is organized into components that mirror the structure of the
31
31
  [API documentation](https://auth0.com/docs/auth-api).
32
- For example:
33
-
34
- ```python
35
- from auth0.authentication import Social
36
-
37
- social = Social('my-domain.us.auth0.com', 'my-client-id')
38
-
39
- social.login(access_token='...', connection='facebook')
40
- ```
41
32
 
42
33
  If you need to sign up a user using their email and password, you can use the Database object.
43
34
 
@@ -1,4 +1,4 @@
1
- __version__ = "4.0.0"
1
+ __version__ = "4.1.0"
2
2
 
3
3
  from auth0.exceptions import Auth0Error, RateLimitError, TokenValidationError
4
4
 
@@ -31,10 +31,10 @@ def asyncify(cls):
31
31
  ):
32
32
  if token is None:
33
33
  # Wrap the auth client
34
- super(AsyncClient, self).__init__(domain, telemetry, timeout, protocol)
34
+ super().__init__(domain, telemetry, timeout, protocol)
35
35
  else:
36
36
  # Wrap the mngtmt client
37
- super(AsyncClient, self).__init__(
37
+ super().__init__(
38
38
  domain, token, telemetry, timeout, protocol, rest_options
39
39
  )
40
40
  self.client = AsyncRestClient(
@@ -53,10 +53,10 @@ def asyncify(cls):
53
53
  ):
54
54
  if token is None:
55
55
  # Wrap the auth client
56
- super(Wrapper, self).__init__(domain, telemetry, timeout, protocol)
56
+ super().__init__(domain, telemetry, timeout, protocol)
57
57
  else:
58
58
  # Wrap the mngtmt client
59
- super(Wrapper, self).__init__(
59
+ super().__init__(
60
60
  domain, token, telemetry, timeout, protocol, rest_options
61
61
  )
62
62
 
@@ -66,7 +66,7 @@ def asyncify(cls):
66
66
  for method in methods:
67
67
  setattr(
68
68
  self,
69
- "{}_async".format(method),
69
+ f"{method}_async",
70
70
  _gen_async(self._async_client, method),
71
71
  )
72
72
 
@@ -13,7 +13,7 @@ class AsyncAsymmetricSignatureVerifier(AsymmetricSignatureVerifier):
13
13
  """
14
14
 
15
15
  def __init__(self, jwks_url, algorithm="RS256"):
16
- super(AsyncAsymmetricSignatureVerifier, self).__init__(jwks_url, algorithm)
16
+ super().__init__(jwks_url, algorithm)
17
17
  self._fetcher = AsyncJwksFetcher(jwks_url)
18
18
 
19
19
  def set_session(self, session):
@@ -58,7 +58,7 @@ class AsyncJwksFetcher(JwksFetcher):
58
58
  """
59
59
 
60
60
  def __init__(self, *args, **kwargs):
61
- super(AsyncJwksFetcher, self).__init__(*args, **kwargs)
61
+ super().__init__(*args, **kwargs)
62
62
  self._async_client = AsyncRestClient(None)
63
63
 
64
64
  def set_session(self, session):
@@ -111,9 +111,7 @@ class AsyncJwksFetcher(JwksFetcher):
111
111
  keys = await self._fetch_jwks(force=True)
112
112
  if keys and key_id in keys:
113
113
  return keys[key_id]
114
- raise TokenValidationError(
115
- 'RSA Public Key with ID "{}" was not found.'.format(key_id)
116
- )
114
+ raise TokenValidationError(f'RSA Public Key with ID "{key_id}" was not found.')
117
115
 
118
116
 
119
117
  class AsyncTokenVerifier(TokenVerifier):
@@ -5,7 +5,7 @@ from .client_authentication import add_client_authentication
5
5
  UNKNOWN_ERROR = "a0.sdk.internal.unknown"
6
6
 
7
7
 
8
- class AuthenticationBase(object):
8
+ class AuthenticationBase:
9
9
  """Base authentication object providing simple REST methods.
10
10
 
11
11
  Args:
@@ -24,7 +24,7 @@ def create_client_assertion_jwt(
24
24
  {
25
25
  "iss": client_id,
26
26
  "sub": client_id,
27
- "aud": "https://{}/".format(domain),
27
+ "aud": f"https://{domain}/",
28
28
  "iat": now,
29
29
  "exp": now + datetime.timedelta(seconds=180),
30
30
  "jti": str(uuid.uuid4()),
@@ -72,7 +72,7 @@ class Database(AuthenticationBase):
72
72
  body.update({"picture": picture})
73
73
 
74
74
  return self.post(
75
- "{}://{}/dbconnections/signup".format(self.protocol, self.domain), data=body
75
+ f"{self.protocol}://{self.domain}/dbconnections/signup", data=body
76
76
  )
77
77
 
78
78
  def change_password(self, email, connection, password=None):
@@ -89,6 +89,6 @@ class Database(AuthenticationBase):
89
89
  }
90
90
 
91
91
  return self.post(
92
- "{}://{}/dbconnections/change_password".format(self.protocol, self.domain),
92
+ f"{self.protocol}://{self.domain}/dbconnections/change_password",
93
93
  data=body,
94
94
  )
@@ -17,7 +17,6 @@ class Delegated(AuthenticationBase):
17
17
  refresh_token=None,
18
18
  scope="openid",
19
19
  ):
20
-
21
20
  """Obtain a delegation token."""
22
21
 
23
22
  if id_token and refresh_token:
@@ -38,6 +37,4 @@ class Delegated(AuthenticationBase):
38
37
  else:
39
38
  raise ValueError("Either id_token or refresh_token must have a value")
40
39
 
41
- return self.post(
42
- "{}://{}/delegation".format(self.protocol, self.domain), data=data
43
- )
40
+ return self.post(f"{self.protocol}://{self.domain}/delegation", data=data)
@@ -36,7 +36,7 @@ class GetToken(AuthenticationBase):
36
36
  """
37
37
 
38
38
  return self.authenticated_post(
39
- "{}://{}/oauth/token".format(self.protocol, self.domain),
39
+ f"{self.protocol}://{self.domain}/oauth/token",
40
40
  data={
41
41
  "client_id": self.client_id,
42
42
  "code": code,
@@ -74,7 +74,7 @@ class GetToken(AuthenticationBase):
74
74
  """
75
75
 
76
76
  return self.post(
77
- "{}://{}/oauth/token".format(self.protocol, self.domain),
77
+ f"{self.protocol}://{self.domain}/oauth/token",
78
78
  data={
79
79
  "client_id": self.client_id,
80
80
  "code_verifier": code_verifier,
@@ -106,7 +106,7 @@ class GetToken(AuthenticationBase):
106
106
  """
107
107
 
108
108
  return self.authenticated_post(
109
- "{}://{}/oauth/token".format(self.protocol, self.domain),
109
+ f"{self.protocol}://{self.domain}/oauth/token",
110
110
  data={
111
111
  "client_id": self.client_id,
112
112
  "audience": audience,
@@ -154,7 +154,7 @@ class GetToken(AuthenticationBase):
154
154
  """
155
155
 
156
156
  return self.authenticated_post(
157
- "{}://{}/oauth/token".format(self.protocol, self.domain),
157
+ f"{self.protocol}://{self.domain}/oauth/token",
158
158
  data={
159
159
  "client_id": self.client_id,
160
160
  "username": username,
@@ -190,7 +190,7 @@ class GetToken(AuthenticationBase):
190
190
  """
191
191
 
192
192
  return self.authenticated_post(
193
- "{}://{}/oauth/token".format(self.protocol, self.domain),
193
+ f"{self.protocol}://{self.domain}/oauth/token",
194
194
  data={
195
195
  "client_id": self.client_id,
196
196
  "refresh_token": refresh_token,
@@ -223,7 +223,7 @@ class GetToken(AuthenticationBase):
223
223
  """
224
224
 
225
225
  return self.authenticated_post(
226
- "{}://{}/oauth/token".format(self.protocol, self.domain),
226
+ f"{self.protocol}://{self.domain}/oauth/token",
227
227
  data={
228
228
  "client_id": self.client_id,
229
229
  "username": username,
@@ -45,7 +45,7 @@ class Passwordless(AuthenticationBase):
45
45
  data.update({"authParams": auth_params})
46
46
 
47
47
  return self.authenticated_post(
48
- "{}://{}/passwordless/start".format(self.protocol, self.domain), data=data
48
+ f"{self.protocol}://{self.domain}/passwordless/start", data=data
49
49
  )
50
50
 
51
51
  def sms(self, phone_number):
@@ -68,5 +68,5 @@ class Passwordless(AuthenticationBase):
68
68
  }
69
69
 
70
70
  return self.authenticated_post(
71
- "{}://{}/passwordless/start".format(self.protocol, self.domain), data=data
71
+ f"{self.protocol}://{self.domain}/passwordless/start", data=data
72
72
  )
@@ -26,5 +26,5 @@ class RevokeToken(AuthenticationBase):
26
26
  }
27
27
 
28
28
  return self.authenticated_post(
29
- "{}://{}/oauth/revoke".format(self.protocol, self.domain), data=body
29
+ f"{self.protocol}://{self.domain}/oauth/revoke", data=body
30
30
  )
@@ -27,7 +27,7 @@ class Social(AuthenticationBase):
27
27
  """
28
28
 
29
29
  return self.post(
30
- "{}://{}/oauth/access_token".format(self.protocol, self.domain),
30
+ f"{self.protocol}://{self.domain}/oauth/access_token",
31
31
  data={
32
32
  "client_id": self.client_id,
33
33
  "access_token": access_token,
@@ -8,7 +8,7 @@ import requests
8
8
  from auth0.exceptions import TokenValidationError
9
9
 
10
10
 
11
- class SignatureVerifier(object):
11
+ class SignatureVerifier:
12
12
  """Abstract class that will verify a given JSON web token's signature
13
13
  using the key fetched internally given its key id.
14
14
 
@@ -119,7 +119,7 @@ class SymmetricSignatureVerifier(SignatureVerifier):
119
119
  """
120
120
 
121
121
  def __init__(self, shared_secret, algorithm="HS256"):
122
- super(SymmetricSignatureVerifier, self).__init__(algorithm)
122
+ super().__init__(algorithm)
123
123
  self._shared_secret = shared_secret
124
124
 
125
125
  def _fetch_key(self, key_id=None):
@@ -135,14 +135,14 @@ class AsymmetricSignatureVerifier(SignatureVerifier):
135
135
  """
136
136
 
137
137
  def __init__(self, jwks_url, algorithm="RS256"):
138
- super(AsymmetricSignatureVerifier, self).__init__(algorithm)
138
+ super().__init__(algorithm)
139
139
  self._fetcher = JwksFetcher(jwks_url)
140
140
 
141
141
  def _fetch_key(self, key_id=None):
142
142
  return self._fetcher.get_key(key_id)
143
143
 
144
144
 
145
- class JwksFetcher(object):
145
+ class JwksFetcher:
146
146
  """Class that fetches and holds a JSON web key set.
147
147
  This class makes use of an in-memory cache. For it to work properly, define this instance once and re-use it.
148
148
 
@@ -236,9 +236,7 @@ class JwksFetcher(object):
236
236
  keys = self._fetch_jwks(force=True)
237
237
  if keys and key_id in keys:
238
238
  return keys[key_id]
239
- raise TokenValidationError(
240
- 'RSA Public Key with ID "{}" was not found.'.format(key_id)
241
- )
239
+ raise TokenValidationError(f'RSA Public Key with ID "{key_id}" was not found.')
242
240
 
243
241
 
244
242
  class TokenVerifier:
@@ -1,7 +1,7 @@
1
1
  from auth0.rest import RestClient, RestClientOptions
2
2
 
3
3
 
4
- class Users(object):
4
+ class Users:
5
5
  """Users client.
6
6
 
7
7
  Args:
@@ -32,7 +32,6 @@ class Users(object):
32
32
  """
33
33
 
34
34
  def userinfo(self, access_token):
35
-
36
35
  """Returns the user information based on the Auth0 access token.
37
36
  This endpoint will work only if openid was granted as a scope for the access_token.
38
37
 
@@ -44,6 +43,6 @@ class Users(object):
44
43
  """
45
44
 
46
45
  return self.client.get(
47
- url="{}://{}/userinfo".format(self.protocol, self.domain),
48
- headers={"Authorization": "Bearer {}".format(access_token)},
46
+ url=f"{self.protocol}://{self.domain}/userinfo",
47
+ headers={"Authorization": f"Bearer {access_token}"},
49
48
  )
@@ -6,14 +6,12 @@ class Auth0Error(Exception):
6
6
  self.content = content
7
7
 
8
8
  def __str__(self):
9
- return "{}: {}".format(self.status_code, self.message)
9
+ return f"{self.status_code}: {self.message}"
10
10
 
11
11
 
12
12
  class RateLimitError(Auth0Error):
13
13
  def __init__(self, error_code, message, reset_at):
14
- super(RateLimitError, self).__init__(
15
- status_code=429, error_code=error_code, message=message
16
- )
14
+ super().__init__(status_code=429, error_code=error_code, message=message)
17
15
  self.reset_at = reset_at
18
16
 
19
17
 
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class Actions(object):
4
+ class Actions:
5
5
  """Auth0 Actions endpoints
6
6
 
7
7
  Args:
@@ -39,10 +39,10 @@ class Actions(object):
39
39
  )
40
40
 
41
41
  def _url(self, *args):
42
- url = "{}://{}/api/v2/actions".format(self.protocol, self.domain)
42
+ url = f"{self.protocol}://{self.domain}/api/v2/actions"
43
43
  for p in args:
44
44
  if p is not None:
45
- url = "{}/{}".format(url, p)
45
+ url = f"{url}/{p}"
46
46
  return url
47
47
 
48
48
  def get_actions(
@@ -4,7 +4,7 @@ from ..asyncify import asyncify
4
4
  from .auth0 import modules
5
5
 
6
6
 
7
- class AsyncAuth0(object):
7
+ class AsyncAuth0:
8
8
  """Provides easy access to all endpoint classes
9
9
 
10
10
  Args:
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class AttackProtection(object):
4
+ class AttackProtection:
5
5
  """Auth0 attack protection endpoints
6
6
 
7
7
  Args:
@@ -64,7 +64,7 @@ modules = {
64
64
  }
65
65
 
66
66
 
67
- class Auth0(object):
67
+ class Auth0:
68
68
  """Provides easy access to all endpoint classes
69
69
 
70
70
  Args:
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class Blacklists(object):
4
+ class Blacklists:
5
5
  """Auth0 blacklists endpoints
6
6
 
7
7
  Args:
@@ -32,7 +32,7 @@ class Blacklists(object):
32
32
  protocol="https",
33
33
  rest_options=None,
34
34
  ):
35
- self.url = "{}://{}/api/v2/blacklists/tokens".format(protocol, domain)
35
+ self.url = f"{protocol}://{domain}/api/v2/blacklists/tokens"
36
36
  self.client = RestClient(
37
37
  jwt=token, telemetry=telemetry, timeout=timeout, options=rest_options
38
38
  )
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class Branding(object):
4
+ class Branding:
5
5
  """Auth0 Branding endpoints
6
6
 
7
7
  Args:
@@ -39,10 +39,10 @@ class Branding(object):
39
39
  )
40
40
 
41
41
  def _url(self, *args):
42
- url = "{}://{}/api/v2/branding".format(self.protocol, self.domain)
42
+ url = f"{self.protocol}://{self.domain}/api/v2/branding"
43
43
  for p in args:
44
44
  if p is not None:
45
- url = "{}/{}".format(url, p)
45
+ url = f"{url}/{p}"
46
46
  return url
47
47
 
48
48
  def get(self, aud=None):
@@ -93,3 +93,56 @@ class Branding(object):
93
93
  self._url("templates", "universal-login"),
94
94
  body={"template": body},
95
95
  )
96
+
97
+ def get_default_branding_theme(self):
98
+ """Retrieve default branding theme.
99
+
100
+ See: https://auth0.com/docs/api/management/v2#!/Branding/get_default_branding_theme
101
+ """
102
+
103
+ return self.client.get(self._url("themes", "default"))
104
+
105
+ def get_branding_theme(self, theme_id):
106
+ """Retrieve branding theme.
107
+
108
+ Args:
109
+ theme_id (str): The theme_id to retrieve branding theme for.
110
+
111
+ See: https://auth0.com/docs/api/management/v2#!/Branding/get_branding_theme
112
+ """
113
+
114
+ return self.client.get(self._url("themes", theme_id))
115
+
116
+ def delete_branding_theme(self, theme_id):
117
+ """Delete branding theme.
118
+
119
+ Args:
120
+ theme_id (str): The theme_id to delete branding theme for.
121
+
122
+ See: https://auth0.com/docs/api/management/v2#!/Branding/delete_branding_theme
123
+ """
124
+
125
+ return self.client.delete(self._url("themes", theme_id))
126
+
127
+ def update_branding_theme(self, theme_id, body):
128
+ """Update branding theme.
129
+
130
+ Args:
131
+ theme_id (str): The theme_id to update branding theme for.
132
+ body (dict): The attributes to set on the theme.
133
+
134
+ See: https://auth0.com/docs/api/management/v2#!/Branding/patch_branding_theme
135
+ """
136
+
137
+ return self.client.patch(self._url("themes", theme_id), data=body)
138
+
139
+ def create_branding_theme(self, body):
140
+ """Create branding theme.
141
+
142
+ Args:
143
+ body (dict): The attributes to set on the theme.
144
+
145
+ See: https://auth0.com/docs/api/management/v2#!/Branding/post_branding_theme
146
+ """
147
+
148
+ return self.client.post(self._url("themes"), data=body)
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class ClientCredentials(object):
4
+ class ClientCredentials:
5
5
  """Auth0 client credentials endpoints.
6
6
 
7
7
  Args:
@@ -43,7 +43,7 @@ class ClientCredentials(object):
43
43
  self.protocol, self.domain, client_id
44
44
  )
45
45
  if id is not None:
46
- return "{}/{}".format(url, id)
46
+ return f"{url}/{id}"
47
47
  return url
48
48
 
49
49
  def all(self, client_id):
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class ClientGrants(object):
4
+ class ClientGrants:
5
5
  """Auth0 client grants endpoints
6
6
 
7
7
  Args:
@@ -39,9 +39,9 @@ class ClientGrants(object):
39
39
  )
40
40
 
41
41
  def _url(self, id=None):
42
- url = "{}://{}/api/v2/client-grants".format(self.protocol, self.domain)
42
+ url = f"{self.protocol}://{self.domain}/api/v2/client-grants"
43
43
  if id is not None:
44
- return "{}/{}".format(url, id)
44
+ return f"{url}/{id}"
45
45
  return url
46
46
 
47
47
  def all(
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class Clients(object):
4
+ class Clients:
5
5
  """Auth0 applications endpoints
6
6
 
7
7
  Args:
@@ -39,9 +39,9 @@ class Clients(object):
39
39
  )
40
40
 
41
41
  def _url(self, id=None):
42
- url = "{}://{}/api/v2/clients".format(self.protocol, self.domain)
42
+ url = f"{self.protocol}://{self.domain}/api/v2/clients"
43
43
  if id is not None:
44
- return "{}/{}".format(url, id)
44
+ return f"{url}/{id}"
45
45
  return url
46
46
 
47
47
  def all(
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class Connections(object):
4
+ class Connections:
5
5
  """Auth0 connection endpoints
6
6
 
7
7
  Args:
@@ -39,9 +39,9 @@ class Connections(object):
39
39
  )
40
40
 
41
41
  def _url(self, id=None):
42
- url = "{}://{}/api/v2/connections".format(self.protocol, self.domain)
42
+ url = f"{self.protocol}://{self.domain}/api/v2/connections"
43
43
  if id is not None:
44
- return "{}/{}".format(url, id)
44
+ return f"{url}/{id}"
45
45
  return url
46
46
 
47
47
  def all(
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class CustomDomains(object):
4
+ class CustomDomains:
5
5
  """Auth0 custom domains endpoints
6
6
 
7
7
  Args:
@@ -39,7 +39,7 @@ class CustomDomains(object):
39
39
  )
40
40
 
41
41
  def _url(self, id=None):
42
- url = "{}://{}/api/v2/custom-domains".format(self.protocol, self.domain)
42
+ url = f"{self.protocol}://{self.domain}/api/v2/custom-domains"
43
43
  if id is not None:
44
44
  return url + "/" + id
45
45
  return url
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class DeviceCredentials(object):
4
+ class DeviceCredentials:
5
5
  """Auth0 connection endpoints
6
6
 
7
7
  Args:
@@ -39,9 +39,9 @@ class DeviceCredentials(object):
39
39
  )
40
40
 
41
41
  def _url(self, id=None):
42
- url = "{}://{}/api/v2/device-credentials".format(self.protocol, self.domain)
42
+ url = f"{self.protocol}://{self.domain}/api/v2/device-credentials"
43
43
  if id is not None:
44
- return "{}/{}".format(url, id)
44
+ return f"{url}/{id}"
45
45
  return url
46
46
 
47
47
  def get(
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class EmailTemplates(object):
4
+ class EmailTemplates:
5
5
  """Auth0 email templates endpoints
6
6
 
7
7
  Args:
@@ -39,9 +39,9 @@ class EmailTemplates(object):
39
39
  )
40
40
 
41
41
  def _url(self, id=None):
42
- url = "{}://{}/api/v2/email-templates".format(self.protocol, self.domain)
42
+ url = f"{self.protocol}://{self.domain}/api/v2/email-templates"
43
43
  if id is not None:
44
- return "{}/{}".format(url, id)
44
+ return f"{url}/{id}"
45
45
  return url
46
46
 
47
47
  def create(self, body):
@@ -1,7 +1,7 @@
1
1
  from ..rest import RestClient
2
2
 
3
3
 
4
- class Emails(object):
4
+ class Emails:
5
5
  """Auth0 email endpoints
6
6
 
7
7
  Args:
@@ -39,9 +39,9 @@ class Emails(object):
39
39
  )
40
40
 
41
41
  def _url(self, id=None):
42
- url = "{}://{}/api/v2/emails/provider".format(self.protocol, self.domain)
42
+ url = f"{self.protocol}://{self.domain}/api/v2/emails/provider"
43
43
  if id is not None:
44
- return "{}/{}".format(url, id)
44
+ return f"{url}/{id}"
45
45
  return url
46
46
 
47
47
  def get(self, fields=None, include_fields=True):