diff --git a/.gitignore b/.gitignore index 350145a4..2fc9d878 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ bin/ *.egg .pypirc pyvenv.cfg +.python-version # Installer logs pip-log.txt diff --git a/EXAMPLES.md b/EXAMPLES.md index 365b10b3..8ad75944 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -32,7 +32,7 @@ For symmetric algorithms like HS256, use the `SymmetricSignatureVerifier` class, The following example demonstrates the verification of an ID token signed with the RS256 signing algorithm: ```python -from auth0.v3.authentication.token_verifier import TokenVerifier, AsymmetricSignatureVerifier +from auth0.authentication import TokenVerifier, AsymmetricSignatureVerifier domain = 'myaccount.auth0.com' client_id = 'exampleid' @@ -53,7 +53,7 @@ If the token verification fails, a `TokenValidationError` will be raised. In tha ### Authenticating with a application configured to use `private_key_jwt` token endpoint auth method ```python -from auth0.v3.authentication import GetToken +from auth0.authentication import GetToken private_key = """-----BEGIN RSA PRIVATE KEY----- MIIJKQIBAAKCAgEAwfUb0nUC0aKB3WiytFhnCIg455BYC+dR3MUGadWpIg7S6lbi @@ -152,22 +152,22 @@ Then additional methods with the `_async` suffix will be added to modules create ```python import asyncio import aiohttp -from auth0.v3.asyncify import asyncify -from auth0.v3.management import Auth0, Users, Connections -from auth0.v3.authentication import Users as AuthUsers +from auth0.asyncify import asyncify +from auth0.management import Auth0, Users, Connections +from auth0.authentication import Users as AuthUsers auth0 = Auth0('domain', 'mgmt_api_token') + async def main(): # users = auth0.users.all() <= sync - users = await auth0.users.all_async() # <= async + users = await auth0.users.all_async() # <= async # To share a session amongst multiple calls to the same service async with auth0.users as users: data = await users.get_async(id) users.update_async(id, data) - # To share a session amongst multiple calls to multiple services async with Auth0('domain', 'mgmt_api_token') as auth0: user = await auth0.users.get_async(user_id) diff --git a/README.md b/README.md index be4b5101..0dd0237e 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The Authentication SDK is organized into components that mirror the structure of For example: ```python -from auth0.v3.authentication import Social +from auth0.authentication import Social social = Social('my-domain.us.auth0.com', 'my-client-id') @@ -42,7 +42,7 @@ social.login(access_token='...', connection='facebook') If you need to sign up a user using their email and password, you can use the Database object. ```python -from auth0.v3.authentication import Database +from auth0.authentication import Database database = Database('my-domain.us.auth0.com', 'my-client-id') @@ -52,7 +52,7 @@ database.signup(email='user@domain.com', password='secr3t', connection='Username If you need to authenticate a user using their email and password, you can use the `GetToken` object, which enables making requests to the `/oauth/token` endpoint. ```python -from auth0.v3.authentication import GetToken +from auth0.authentication import GetToken token = GetToken('my-domain.us.auth0.com', 'my-client-id', client_secret='my-client-secret') @@ -63,7 +63,7 @@ token.login(username='user@domain.com', password='secr3t', realm='Username-Passw To use the management library you will need to instantiate an Auth0 object with a domain and a [Management API v2 token](https://auth0.com/docs/api/management/v2/tokens). Please note that these token last 24 hours, so if you need it constantly you should ask for it programmatically using the client credentials grant with a [non interactive client](https://auth0.com/docs/api/management/v2/tokens#1-create-and-authorize-a-client) authorized to access the API. For example: ```python -from auth0.v3.authentication import GetToken +from auth0.authentication import GetToken domain = 'myaccount.auth0.com' non_interactive_client_id = 'exampleid' @@ -77,7 +77,7 @@ mgmt_api_token = token['access_token'] Then use the token you've obtained as follows: ```python -from auth0.v3.management import Auth0 +from auth0.management import Auth0 domain = 'myaccount.auth0.com' mgmt_api_token = 'MGMT_API_TOKEN' diff --git a/V4_MIGRATION_GUIDE.md b/V4_MIGRATION_GUIDE.md index 74266853..8492d894 100644 --- a/V4_MIGRATION_GUIDE.md +++ b/V4_MIGRATION_GUIDE.md @@ -3,6 +3,7 @@ Guide to migrating from `3.x` to `4.x` - [Python <3.7 is no longer supported](#python-37-is-no-longer-supported) +- [The `v3` subfolder has been removed](#the-v3-subfolder-has-been-removed) - [Client ID and client secret are now specified in the constructor for authentication clients](#client-id-and-client-secret-are-now-specified-in-the-constructor-for-authentication-clients) - [AuthorizeClient and Logout have been removed](#authorizeclient-and-logout-have-been-removed) - [Methods that call deprecated endpoints have been removed](#methods-that-call-deprecated-endpoints-have-been-removed) @@ -11,12 +12,32 @@ Guide to migrating from `3.x` to `4.x` Python <=3.6 and Python 2 are EOL and are no longer supported. +## The `v3` subfolder has been removed + +Versioning the import paths was not necessary and made major upgrades unnecessarily complex, so this has been removed and all files have been moved up a directory. + +### Before + +```python +from auth0.v3.management import Auth0 + +auth0 = Auth0(domain, mgmt_api_token) +``` + +### After + +```python +from auth0.management import Auth0 + +auth0 = Auth0(domain, mgmt_api_token) +``` + ## Client ID and client secret are now specified in the constructor for authentication clients ### Before ```py -from auth0.v3.authentication import GetToken +from auth0.authentication import GetToken get_token = GetToken('my-domain.us.auth0.com') @@ -26,7 +47,7 @@ get_token.client_credentials('my-client-id', 'my-client-secret', 'my-api') ### After ```py -from auth0.v3.authentication import GetToken +from auth0.authentication import GetToken # `client_secret` is optional (you can now use `client_assertion_signing_key` as an alternative) get_token = GetToken('my-domain.us.auth0.com', 'my-client-id', client_secret='my-client-secret') diff --git a/auth0/__init__.py b/auth0/__init__.py index 3e6d8c7b..e8ae77bd 100644 --- a/auth0/__init__.py +++ b/auth0/__init__.py @@ -1 +1,5 @@ __version__ = "3.24.0" + +from auth0.exceptions import Auth0Error, RateLimitError, TokenValidationError + +__all__ = ("Auth0Error", "RateLimitError", "TokenValidationError") diff --git a/auth0/v3/asyncify.py b/auth0/asyncify.py similarity index 98% rename from auth0/v3/asyncify.py rename to auth0/asyncify.py index d76cc1e4..2d8c7a2f 100644 --- a/auth0/v3/asyncify.py +++ b/auth0/asyncify.py @@ -1,6 +1,6 @@ import aiohttp -from auth0.v3.rest_async import AsyncRestClient +from auth0.rest_async import AsyncRestClient def _gen_async(client, method): diff --git a/auth0/v3/authentication/__init__.py b/auth0/authentication/__init__.py similarity index 100% rename from auth0/v3/authentication/__init__.py rename to auth0/authentication/__init__.py diff --git a/auth0/v3/authentication/async_token_verifier.py b/auth0/authentication/async_token_verifier.py similarity index 100% rename from auth0/v3/authentication/async_token_verifier.py rename to auth0/authentication/async_token_verifier.py diff --git a/auth0/v3/authentication/base.py b/auth0/authentication/base.py similarity index 93% rename from auth0/v3/authentication/base.py rename to auth0/authentication/base.py index 14d36231..4994241f 100644 --- a/auth0/v3/authentication/base.py +++ b/auth0/authentication/base.py @@ -1,13 +1,5 @@ -import base64 -import json -import platform -import sys +from auth0.rest import RestClient, RestClientOptions -import requests - -from auth0.v3.rest import RestClient, RestClientOptions - -from ..exceptions import Auth0Error, RateLimitError from .client_authentication import add_client_authentication UNKNOWN_ERROR = "a0.sdk.internal.unknown" diff --git a/auth0/v3/authentication/client_authentication.py b/auth0/authentication/client_authentication.py similarity index 100% rename from auth0/v3/authentication/client_authentication.py rename to auth0/authentication/client_authentication.py diff --git a/auth0/v3/authentication/database.py b/auth0/authentication/database.py similarity index 100% rename from auth0/v3/authentication/database.py rename to auth0/authentication/database.py diff --git a/auth0/v3/authentication/delegated.py b/auth0/authentication/delegated.py similarity index 100% rename from auth0/v3/authentication/delegated.py rename to auth0/authentication/delegated.py diff --git a/auth0/v3/authentication/enterprise.py b/auth0/authentication/enterprise.py similarity index 100% rename from auth0/v3/authentication/enterprise.py rename to auth0/authentication/enterprise.py diff --git a/auth0/v3/authentication/get_token.py b/auth0/authentication/get_token.py similarity index 100% rename from auth0/v3/authentication/get_token.py rename to auth0/authentication/get_token.py diff --git a/auth0/v3/authentication/passwordless.py b/auth0/authentication/passwordless.py similarity index 100% rename from auth0/v3/authentication/passwordless.py rename to auth0/authentication/passwordless.py diff --git a/auth0/v3/authentication/revoke_token.py b/auth0/authentication/revoke_token.py similarity index 100% rename from auth0/v3/authentication/revoke_token.py rename to auth0/authentication/revoke_token.py diff --git a/auth0/v3/authentication/social.py b/auth0/authentication/social.py similarity index 100% rename from auth0/v3/authentication/social.py rename to auth0/authentication/social.py diff --git a/auth0/v3/authentication/token_verifier.py b/auth0/authentication/token_verifier.py similarity index 99% rename from auth0/v3/authentication/token_verifier.py rename to auth0/authentication/token_verifier.py index 5e44e5d2..e970493c 100644 --- a/auth0/v3/authentication/token_verifier.py +++ b/auth0/authentication/token_verifier.py @@ -5,7 +5,7 @@ import jwt import requests -from auth0.v3.exceptions import TokenValidationError +from auth0.exceptions import TokenValidationError class SignatureVerifier(object): diff --git a/auth0/v3/authentication/users.py b/auth0/authentication/users.py similarity index 95% rename from auth0/v3/authentication/users.py rename to auth0/authentication/users.py index 69a305d3..f06dbdcb 100644 --- a/auth0/v3/authentication/users.py +++ b/auth0/authentication/users.py @@ -1,6 +1,4 @@ -import warnings - -from auth0.v3.rest import RestClient, RestClientOptions +from auth0.rest import RestClient, RestClientOptions class Users(object): diff --git a/auth0/v3/exceptions.py b/auth0/exceptions.py similarity index 100% rename from auth0/v3/exceptions.py rename to auth0/exceptions.py diff --git a/auth0/v3/management/__init__.py b/auth0/management/__init__.py similarity index 100% rename from auth0/v3/management/__init__.py rename to auth0/management/__init__.py diff --git a/auth0/v3/management/actions.py b/auth0/management/actions.py similarity index 100% rename from auth0/v3/management/actions.py rename to auth0/management/actions.py diff --git a/auth0/v3/management/async_auth0.py b/auth0/management/async_auth0.py similarity index 100% rename from auth0/v3/management/async_auth0.py rename to auth0/management/async_auth0.py diff --git a/auth0/v3/management/attack_protection.py b/auth0/management/attack_protection.py similarity index 100% rename from auth0/v3/management/attack_protection.py rename to auth0/management/attack_protection.py diff --git a/auth0/v3/management/auth0.py b/auth0/management/auth0.py similarity index 100% rename from auth0/v3/management/auth0.py rename to auth0/management/auth0.py diff --git a/auth0/v3/management/blacklists.py b/auth0/management/blacklists.py similarity index 100% rename from auth0/v3/management/blacklists.py rename to auth0/management/blacklists.py diff --git a/auth0/v3/management/branding.py b/auth0/management/branding.py similarity index 100% rename from auth0/v3/management/branding.py rename to auth0/management/branding.py diff --git a/auth0/v3/management/client_credentials.py b/auth0/management/client_credentials.py similarity index 100% rename from auth0/v3/management/client_credentials.py rename to auth0/management/client_credentials.py diff --git a/auth0/v3/management/client_grants.py b/auth0/management/client_grants.py similarity index 100% rename from auth0/v3/management/client_grants.py rename to auth0/management/client_grants.py diff --git a/auth0/v3/management/clients.py b/auth0/management/clients.py similarity index 100% rename from auth0/v3/management/clients.py rename to auth0/management/clients.py diff --git a/auth0/v3/management/connections.py b/auth0/management/connections.py similarity index 100% rename from auth0/v3/management/connections.py rename to auth0/management/connections.py diff --git a/auth0/v3/management/custom_domains.py b/auth0/management/custom_domains.py similarity index 100% rename from auth0/v3/management/custom_domains.py rename to auth0/management/custom_domains.py diff --git a/auth0/v3/management/device_credentials.py b/auth0/management/device_credentials.py similarity index 100% rename from auth0/v3/management/device_credentials.py rename to auth0/management/device_credentials.py diff --git a/auth0/v3/management/email_templates.py b/auth0/management/email_templates.py similarity index 100% rename from auth0/v3/management/email_templates.py rename to auth0/management/email_templates.py diff --git a/auth0/v3/management/emails.py b/auth0/management/emails.py similarity index 100% rename from auth0/v3/management/emails.py rename to auth0/management/emails.py diff --git a/auth0/v3/management/grants.py b/auth0/management/grants.py similarity index 100% rename from auth0/v3/management/grants.py rename to auth0/management/grants.py diff --git a/auth0/v3/management/guardian.py b/auth0/management/guardian.py similarity index 100% rename from auth0/v3/management/guardian.py rename to auth0/management/guardian.py diff --git a/auth0/v3/management/hooks.py b/auth0/management/hooks.py similarity index 100% rename from auth0/v3/management/hooks.py rename to auth0/management/hooks.py diff --git a/auth0/v3/management/jobs.py b/auth0/management/jobs.py similarity index 100% rename from auth0/v3/management/jobs.py rename to auth0/management/jobs.py diff --git a/auth0/v3/management/log_streams.py b/auth0/management/log_streams.py similarity index 100% rename from auth0/v3/management/log_streams.py rename to auth0/management/log_streams.py diff --git a/auth0/v3/management/logs.py b/auth0/management/logs.py similarity index 100% rename from auth0/v3/management/logs.py rename to auth0/management/logs.py diff --git a/auth0/v3/management/organizations.py b/auth0/management/organizations.py similarity index 100% rename from auth0/v3/management/organizations.py rename to auth0/management/organizations.py diff --git a/auth0/v3/management/prompts.py b/auth0/management/prompts.py similarity index 100% rename from auth0/v3/management/prompts.py rename to auth0/management/prompts.py diff --git a/auth0/v3/management/resource_servers.py b/auth0/management/resource_servers.py similarity index 100% rename from auth0/v3/management/resource_servers.py rename to auth0/management/resource_servers.py diff --git a/auth0/v3/management/roles.py b/auth0/management/roles.py similarity index 100% rename from auth0/v3/management/roles.py rename to auth0/management/roles.py diff --git a/auth0/v3/management/rules.py b/auth0/management/rules.py similarity index 100% rename from auth0/v3/management/rules.py rename to auth0/management/rules.py diff --git a/auth0/v3/management/rules_configs.py b/auth0/management/rules_configs.py similarity index 100% rename from auth0/v3/management/rules_configs.py rename to auth0/management/rules_configs.py diff --git a/auth0/v3/management/stats.py b/auth0/management/stats.py similarity index 100% rename from auth0/v3/management/stats.py rename to auth0/management/stats.py diff --git a/auth0/v3/management/tenants.py b/auth0/management/tenants.py similarity index 100% rename from auth0/v3/management/tenants.py rename to auth0/management/tenants.py diff --git a/auth0/v3/management/tickets.py b/auth0/management/tickets.py similarity index 100% rename from auth0/v3/management/tickets.py rename to auth0/management/tickets.py diff --git a/auth0/v3/management/user_blocks.py b/auth0/management/user_blocks.py similarity index 100% rename from auth0/v3/management/user_blocks.py rename to auth0/management/user_blocks.py diff --git a/auth0/v3/management/users.py b/auth0/management/users.py similarity index 100% rename from auth0/v3/management/users.py rename to auth0/management/users.py diff --git a/auth0/v3/management/users_by_email.py b/auth0/management/users_by_email.py similarity index 100% rename from auth0/v3/management/users_by_email.py rename to auth0/management/users_by_email.py diff --git a/auth0/v3/rest.py b/auth0/rest.py similarity index 99% rename from auth0/v3/rest.py rename to auth0/rest.py index 12a349de..111e5f8c 100644 --- a/auth0/v3/rest.py +++ b/auth0/rest.py @@ -7,7 +7,7 @@ import requests -from auth0.v3.exceptions import Auth0Error, RateLimitError +from auth0.exceptions import Auth0Error, RateLimitError UNKNOWN_ERROR = "a0.sdk.internal.unknown" diff --git a/auth0/v3/rest_async.py b/auth0/rest_async.py similarity index 99% rename from auth0/v3/rest_async.py rename to auth0/rest_async.py index 7648c5b5..3781b4cf 100644 --- a/auth0/v3/rest_async.py +++ b/auth0/rest_async.py @@ -2,7 +2,7 @@ import aiohttp -from auth0.v3.exceptions import RateLimitError +from auth0.exceptions import RateLimitError from .rest import EmptyResponse, JsonResponse, PlainResponse, RestClient diff --git a/auth0/v3/test/__init__.py b/auth0/test/__init__.py similarity index 100% rename from auth0/v3/test/__init__.py rename to auth0/test/__init__.py diff --git a/auth0/v3/test/authentication/__init__.py b/auth0/test/authentication/__init__.py similarity index 100% rename from auth0/v3/test/authentication/__init__.py rename to auth0/test/authentication/__init__.py diff --git a/auth0/v3/test/authentication/test_base.py b/auth0/test/authentication/test_base.py similarity index 100% rename from auth0/v3/test/authentication/test_base.py rename to auth0/test/authentication/test_base.py diff --git a/auth0/v3/test/authentication/test_database.py b/auth0/test/authentication/test_database.py similarity index 95% rename from auth0/v3/test/authentication/test_database.py rename to auth0/test/authentication/test_database.py index 442ddb8e..2519985b 100644 --- a/auth0/v3/test/authentication/test_database.py +++ b/auth0/test/authentication/test_database.py @@ -6,7 +6,7 @@ class TestDatabase(unittest.TestCase): - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_signup(self, mock_post): d = Database("my.domain.com", "cid") @@ -61,7 +61,7 @@ def test_signup(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_change_password(self, mock_post): d = Database("my.domain.com", "cid") diff --git a/auth0/v3/test/authentication/test_delegated.py b/auth0/test/authentication/test_delegated.py similarity index 90% rename from auth0/v3/test/authentication/test_delegated.py rename to auth0/test/authentication/test_delegated.py index b3125eed..ceac9150 100644 --- a/auth0/v3/test/authentication/test_delegated.py +++ b/auth0/test/authentication/test_delegated.py @@ -6,7 +6,7 @@ class TestDelegated(unittest.TestCase): - @mock.patch("auth0.v3.authentication.delegated.Delegated.post") + @mock.patch("auth0.authentication.delegated.Delegated.post") def test_get_token_id_token(self, mock_post): d = Delegated("my.domain.com", "cid") @@ -34,7 +34,7 @@ def test_get_token_id_token(self, mock_post): }, ) - @mock.patch("auth0.v3.authentication.delegated.Delegated.post") + @mock.patch("auth0.authentication.delegated.Delegated.post") def test_get_token_refresh_token(self, mock_post): d = Delegated("my.domain.com", "cid") @@ -61,7 +61,7 @@ def test_get_token_refresh_token(self, mock_post): }, ) - @mock.patch("auth0.v3.authentication.delegated.Delegated.post") + @mock.patch("auth0.authentication.delegated.Delegated.post") def test_get_token_value_error(self, mock_post): d = Delegated("my.domain.com", "cid") diff --git a/auth0/v3/test/authentication/test_enterprise.py b/auth0/test/authentication/test_enterprise.py similarity index 82% rename from auth0/v3/test/authentication/test_enterprise.py rename to auth0/test/authentication/test_enterprise.py index 655d7c66..44f6c6a7 100644 --- a/auth0/v3/test/authentication/test_enterprise.py +++ b/auth0/test/authentication/test_enterprise.py @@ -6,7 +6,7 @@ class TestEnterprise(unittest.TestCase): - @mock.patch("auth0.v3.authentication.enterprise.Enterprise.get") + @mock.patch("auth0.authentication.enterprise.Enterprise.get") def test_saml_metadata(self, mock_get): e = Enterprise("my.domain.com", "cid") @@ -15,7 +15,7 @@ def test_saml_metadata(self, mock_get): mock_get.assert_called_with(url="https://my.domain.com/samlp/metadata/cid") - @mock.patch("auth0.v3.authentication.enterprise.Enterprise.get") + @mock.patch("auth0.authentication.enterprise.Enterprise.get") def test_wsfed_metadata(self, mock_get): e = Enterprise("my.domain.com", "cid") diff --git a/auth0/v3/test/authentication/test_get_token.py b/auth0/test/authentication/test_get_token.py similarity index 94% rename from auth0/v3/test/authentication/test_get_token.py rename to auth0/test/authentication/test_get_token.py index b1624f5d..d5b4dd87 100644 --- a/auth0/v3/test/authentication/test_get_token.py +++ b/auth0/test/authentication/test_get_token.py @@ -20,7 +20,7 @@ def get_private_key(): class TestGetToken(unittest.TestCase): - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_authorization_code(self, mock_post): g = GetToken("my.domain.com", "cid", client_secret="clsec") @@ -45,7 +45,7 @@ def test_authorization_code(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_authorization_code_with_client_assertion(self, mock_post): g = GetToken( @@ -69,7 +69,7 @@ def test_authorization_code_with_client_assertion(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_authorization_code_pkce(self, mock_post): g = GetToken("my.domain.com", "cid") @@ -95,7 +95,7 @@ def test_authorization_code_pkce(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_client_credentials(self, mock_post): g = GetToken("my.domain.com", "cid", client_secret="clsec") @@ -115,7 +115,7 @@ def test_client_credentials(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_client_credentials_with_client_assertion(self, mock_post): g = GetToken( "my.domain.com", "cid", client_assertion_signing_key=get_private_key() @@ -137,7 +137,7 @@ def test_client_credentials_with_client_assertion(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_login(self, mock_post): g = GetToken("my.domain.com", "cid", client_secret="clsec") @@ -168,7 +168,7 @@ def test_login(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_refresh_token(self, mock_post): g = GetToken("my.domain.com", "cid", client_secret="clsec") @@ -192,7 +192,7 @@ def test_refresh_token(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_passwordless_login_with_sms(self, mock_post): g = GetToken("my.domain.com", "cid", client_secret="csec") @@ -222,7 +222,7 @@ def test_passwordless_login_with_sms(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_passwordless_login_with_email(self, mock_post): g = GetToken("my.domain.com", "cid", client_secret="csec") diff --git a/auth0/v3/test/authentication/test_passwordless.py b/auth0/test/authentication/test_passwordless.py similarity index 91% rename from auth0/v3/test/authentication/test_passwordless.py rename to auth0/test/authentication/test_passwordless.py index b9024f8b..29d8dad5 100644 --- a/auth0/v3/test/authentication/test_passwordless.py +++ b/auth0/test/authentication/test_passwordless.py @@ -6,7 +6,7 @@ class TestPasswordless(unittest.TestCase): - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_send_email(self, mock_post): p = Passwordless("my.domain.com", "cid") @@ -26,7 +26,7 @@ def test_send_email(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_send_email_with_auth_params(self, mock_post): p = Passwordless("my.domain.com", "cid") @@ -47,7 +47,7 @@ def test_send_email_with_auth_params(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_send_email_with_client_secret(self, mock_post): p = Passwordless("my.domain.com", "cid", client_secret="csecret") @@ -68,7 +68,7 @@ def test_send_email_with_client_secret(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_send_sms(self, mock_post): p = Passwordless("my.domain.com", "cid") @@ -86,7 +86,7 @@ def test_send_sms(self, mock_post): }, ) - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_send_sms_with_client_secret(self, mock_post): p = Passwordless("my.domain.com", "cid", client_secret="csecret") diff --git a/auth0/v3/test/authentication/test_revoke_token.py b/auth0/test/authentication/test_revoke_token.py similarity index 94% rename from auth0/v3/test/authentication/test_revoke_token.py rename to auth0/test/authentication/test_revoke_token.py index f03878a7..cede75c9 100644 --- a/auth0/v3/test/authentication/test_revoke_token.py +++ b/auth0/test/authentication/test_revoke_token.py @@ -6,7 +6,7 @@ class TestRevokeToken(unittest.TestCase): - @mock.patch("auth0.v3.rest.RestClient.post") + @mock.patch("auth0.rest.RestClient.post") def test_revoke_refresh_token(self, mock_post): a = RevokeToken("my.domain.com", "cid") diff --git a/auth0/v3/test/authentication/test_social.py b/auth0/test/authentication/test_social.py similarity index 90% rename from auth0/v3/test/authentication/test_social.py rename to auth0/test/authentication/test_social.py index 6d1afcef..97d92016 100644 --- a/auth0/v3/test/authentication/test_social.py +++ b/auth0/test/authentication/test_social.py @@ -6,7 +6,7 @@ class TestSocial(unittest.TestCase): - @mock.patch("auth0.v3.authentication.social.Social.post") + @mock.patch("auth0.authentication.social.Social.post") def test_login(self, mock_post): s = Social("a.b.c", "cid") s.login(access_token="atk", connection="conn") @@ -24,7 +24,7 @@ def test_login(self, mock_post): }, ) - @mock.patch("auth0.v3.authentication.social.Social.post") + @mock.patch("auth0.authentication.social.Social.post") def test_login_with_scope(self, mock_post): s = Social("a.b.c", "cid") s.login( diff --git a/auth0/v3/test/authentication/test_token_verifier.py b/auth0/test/authentication/test_token_verifier.py similarity index 100% rename from auth0/v3/test/authentication/test_token_verifier.py rename to auth0/test/authentication/test_token_verifier.py diff --git a/auth0/v3/test/authentication/test_users.py b/auth0/test/authentication/test_users.py similarity index 88% rename from auth0/v3/test/authentication/test_users.py rename to auth0/test/authentication/test_users.py index 0cf2fc35..5c86f7e0 100644 --- a/auth0/v3/test/authentication/test_users.py +++ b/auth0/test/authentication/test_users.py @@ -6,7 +6,7 @@ class TestUsers(unittest.TestCase): - @mock.patch("auth0.v3.rest.RestClient.get") + @mock.patch("auth0.rest.RestClient.get") def test_userinfo(self, mock_get): u = Users("my.domain.com") diff --git a/auth0/v3/test/management/__init__.py b/auth0/test/management/__init__.py similarity index 100% rename from auth0/v3/test/management/__init__.py rename to auth0/test/management/__init__.py diff --git a/auth0/v3/test/management/test_actions.py b/auth0/test/management/test_actions.py similarity index 91% rename from auth0/v3/test/management/test_actions.py rename to auth0/test/management/test_actions.py index 3fee8f9d..08f1fe8a 100644 --- a/auth0/v3/test/management/test_actions.py +++ b/auth0/test/management/test_actions.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_get_actions(self, mock_rc): mock_instance = mock_rc.return_value @@ -66,7 +66,7 @@ def test_get_actions(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_create_action(self, mock_rc): mock_instance = mock_rc.return_value @@ -77,7 +77,7 @@ def test_create_action(self, mock_rc): "https://domain/api/v2/actions/actions", data={"a": "b", "c": "d"} ) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_update_action(self, mock_rc): mock_instance = mock_rc.return_value @@ -89,7 +89,7 @@ def test_update_action(self, mock_rc): self.assertEqual("https://domain/api/v2/actions/actions/action-id", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_get_action(self, mock_rc): mock_instance = mock_rc.return_value @@ -101,7 +101,7 @@ def test_get_action(self, mock_rc): self.assertEqual("https://domain/api/v2/actions/actions/action-id", args[0]) self.assertEqual(kwargs["params"], {}) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_get_triggers(self, mock_rc): mock_instance = mock_rc.return_value @@ -113,7 +113,7 @@ def test_get_triggers(self, mock_rc): self.assertEqual("https://domain/api/v2/actions/triggers", args[0]) self.assertEqual(kwargs["params"], {}) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_delete_action(self, mock_rc): mock_instance = mock_rc.return_value @@ -132,7 +132,7 @@ def test_delete_action(self, mock_rc): self.assertEqual("https://domain/api/v2/actions/actions/action-id", args[0]) self.assertEqual(kwargs["params"], {"force": "true"}) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_get_execution(self, mock_rc): mock_instance = mock_rc.return_value @@ -146,7 +146,7 @@ def test_get_execution(self, mock_rc): ) self.assertEqual(kwargs["params"], {}) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_get_action_versions(self, mock_rc): mock_instance = mock_rc.return_value @@ -169,7 +169,7 @@ def test_get_action_versions(self, mock_rc): ) self.assertEqual(kwargs["params"], {"page": 0, "per_page": 5}) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_get_trigger_bindings(self, mock_rc): mock_instance = mock_rc.return_value @@ -192,7 +192,7 @@ def test_get_trigger_bindings(self, mock_rc): ) self.assertEqual(kwargs["params"], {"page": 0, "per_page": 5}) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_get_action_version(self, mock_rc): mock_instance = mock_rc.return_value @@ -207,7 +207,7 @@ def test_get_action_version(self, mock_rc): ) self.assertEqual(kwargs["params"], {}) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_deploy_action(self, mock_rc): mock_instance = mock_rc.return_value @@ -220,7 +220,7 @@ def test_deploy_action(self, mock_rc): "https://domain/api/v2/actions/actions/action-id/deploy", args[0] ) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_rollback_action(self, mock_rc): mock_instance = mock_rc.return_value @@ -235,7 +235,7 @@ def test_rollback_action(self, mock_rc): ) self.assertEqual(kwargs["data"], {}) - @mock.patch("auth0.v3.management.actions.RestClient") + @mock.patch("auth0.management.actions.RestClient") def test_update_trigger_bindings(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_atack_protection.py b/auth0/test/management/test_atack_protection.py similarity index 88% rename from auth0/v3/test/management/test_atack_protection.py rename to auth0/test/management/test_atack_protection.py index 41b9cc2c..d45c8ab1 100644 --- a/auth0/v3/test/management/test_atack_protection.py +++ b/auth0/test/management/test_atack_protection.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.attack_protection.RestClient") + @mock.patch("auth0.management.attack_protection.RestClient") def test_get_breached_password_detection(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.get.return_value = {} @@ -29,7 +29,7 @@ def test_get_breached_password_detection(self, mock_rc): args[0], ) - @mock.patch("auth0.v3.management.attack_protection.RestClient") + @mock.patch("auth0.management.attack_protection.RestClient") def test_update_breached_password_detection(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.patch.return_value = {} @@ -42,7 +42,7 @@ def test_update_breached_password_detection(self, mock_rc): data={"a": "b", "c": "d"}, ) - @mock.patch("auth0.v3.management.attack_protection.RestClient") + @mock.patch("auth0.management.attack_protection.RestClient") def test_get_brute_force_protection(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.get.return_value = {} @@ -56,7 +56,7 @@ def test_get_brute_force_protection(self, mock_rc): "https://domain/api/v2/attack-protection/brute-force-protection", args[0] ) - @mock.patch("auth0.v3.management.attack_protection.RestClient") + @mock.patch("auth0.management.attack_protection.RestClient") def test_update_brute_force_protection(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.patch.return_value = {} @@ -69,7 +69,7 @@ def test_update_brute_force_protection(self, mock_rc): data={"a": "b", "c": "d"}, ) - @mock.patch("auth0.v3.management.attack_protection.RestClient") + @mock.patch("auth0.management.attack_protection.RestClient") def test_get_suspicious_ip_throttling(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.get.return_value = {} @@ -83,7 +83,7 @@ def test_get_suspicious_ip_throttling(self, mock_rc): "https://domain/api/v2/attack-protection/suspicious-ip-throttling", args[0] ) - @mock.patch("auth0.v3.management.attack_protection.RestClient") + @mock.patch("auth0.management.attack_protection.RestClient") def test_update_suspicious_ip_throttling(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.patch.return_value = {} diff --git a/auth0/v3/test/management/test_auth0.py b/auth0/test/management/test_auth0.py similarity index 100% rename from auth0/v3/test/management/test_auth0.py rename to auth0/test/management/test_auth0.py diff --git a/auth0/v3/test/management/test_blacklists.py b/auth0/test/management/test_blacklists.py similarity index 92% rename from auth0/v3/test/management/test_blacklists.py rename to auth0/test/management/test_blacklists.py index ab8e984c..7f577ebe 100644 --- a/auth0/v3/test/management/test_blacklists.py +++ b/auth0/test/management/test_blacklists.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.blacklists.RestClient") + @mock.patch("auth0.management.blacklists.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -25,7 +25,7 @@ def test_get(self, mock_rc): "https://domain/api/v2/blacklists/tokens", params={"aud": "an-id"} ) - @mock.patch("auth0.v3.management.blacklists.RestClient") + @mock.patch("auth0.management.blacklists.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_branding.py b/auth0/test/management/test_branding.py similarity index 88% rename from auth0/v3/test/management/test_branding.py rename to auth0/test/management/test_branding.py index 78ec9a1a..79602520 100644 --- a/auth0/v3/test/management/test_branding.py +++ b/auth0/test/management/test_branding.py @@ -15,7 +15,7 @@ def test_init_with_optionals(self): telemetry = branding.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry, None) - @mock.patch("auth0.v3.management.branding.RestClient") + @mock.patch("auth0.management.branding.RestClient") def test_get(self, mock_rc): api = mock_rc.return_value @@ -26,7 +26,7 @@ def test_get(self, mock_rc): "https://domain/api/v2/branding", ) - @mock.patch("auth0.v3.management.branding.RestClient") + @mock.patch("auth0.management.branding.RestClient") def test_update(self, mock_rc): api = mock_rc.return_value api.patch.return_value = {} @@ -38,7 +38,7 @@ def test_update(self, mock_rc): "https://domain/api/v2/branding", data={"a": "b", "c": "d"} ) - @mock.patch("auth0.v3.management.branding.RestClient") + @mock.patch("auth0.management.branding.RestClient") def test_get_template_universal_login(self, mock_rc): api = mock_rc.return_value @@ -49,7 +49,7 @@ def test_get_template_universal_login(self, mock_rc): "https://domain/api/v2/branding/templates/universal-login", ) - @mock.patch("auth0.v3.management.branding.RestClient") + @mock.patch("auth0.management.branding.RestClient") def test_delete_template_universal_login(self, mock_rc): api = mock_rc.return_value @@ -60,7 +60,7 @@ def test_delete_template_universal_login(self, mock_rc): "https://domain/api/v2/branding/templates/universal-login", ) - @mock.patch("auth0.v3.management.branding.RestClient") + @mock.patch("auth0.management.branding.RestClient") def test_update_template_universal_login(self, mock_rc): api = mock_rc.return_value api.put.return_value = {} diff --git a/auth0/v3/test/management/test_client_credentials.py b/auth0/test/management/test_client_credentials.py similarity index 86% rename from auth0/v3/test/management/test_client_credentials.py rename to auth0/test/management/test_client_credentials.py index dbeb09fe..8aa3d231 100644 --- a/auth0/v3/test/management/test_client_credentials.py +++ b/auth0/test/management/test_client_credentials.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.client_credentials.RestClient") + @mock.patch("auth0.management.client_credentials.RestClient") def test_all(self, mock_rc): mock_instance = mock_rc.return_value c = ClientCredentials(domain="domain", token="jwttoken") @@ -23,7 +23,7 @@ def test_all(self, mock_rc): "https://domain/api/v2/clients/cid/credentials" ) - @mock.patch("auth0.v3.management.client_credentials.RestClient") + @mock.patch("auth0.management.client_credentials.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value c = ClientCredentials(domain="domain", token="jwttoken") @@ -32,7 +32,7 @@ def test_get(self, mock_rc): "https://domain/api/v2/clients/cid/credentials/this-id" ) - @mock.patch("auth0.v3.management.client_credentials.RestClient") + @mock.patch("auth0.management.client_credentials.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value c = ClientCredentials(domain="domain", token="jwttoken") @@ -41,7 +41,7 @@ def test_create(self, mock_rc): "https://domain/api/v2/clients/cid/credentials", data={"a": "b", "c": "d"} ) - @mock.patch("auth0.v3.management.client_credentials.RestClient") + @mock.patch("auth0.management.client_credentials.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value c = ClientCredentials(domain="domain", token="jwttoken") diff --git a/auth0/v3/test/management/test_client_grants.py b/auth0/test/management/test_client_grants.py similarity index 93% rename from auth0/v3/test/management/test_client_grants.py rename to auth0/test/management/test_client_grants.py index 2bfc4fc0..415f3ef5 100644 --- a/auth0/v3/test/management/test_client_grants.py +++ b/auth0/test/management/test_client_grants.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.client_grants.RestClient") + @mock.patch("auth0.management.client_grants.RestClient") def test_all(self, mock_rc): mock_instance = mock_rc.return_value @@ -88,7 +88,7 @@ def test_all(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.client_grants.RestClient") + @mock.patch("auth0.management.client_grants.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value @@ -99,7 +99,7 @@ def test_create(self, mock_rc): "https://domain/api/v2/client-grants", data={"a": "b", "c": "d"} ) - @mock.patch("auth0.v3.management.client_grants.RestClient") + @mock.patch("auth0.management.client_grants.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value @@ -110,7 +110,7 @@ def test_delete(self, mock_rc): "https://domain/api/v2/client-grants/this-id" ) - @mock.patch("auth0.v3.management.client_grants.RestClient") + @mock.patch("auth0.management.client_grants.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_clients.py b/auth0/test/management/test_clients.py similarity index 92% rename from auth0/v3/test/management/test_clients.py rename to auth0/test/management/test_clients.py index acf5bf87..1ad973ca 100644 --- a/auth0/v3/test/management/test_clients.py +++ b/auth0/test/management/test_clients.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.clients.RestClient") + @mock.patch("auth0.management.clients.RestClient") def test_all(self, mock_rc): mock_instance = mock_rc.return_value @@ -73,7 +73,7 @@ def test_all(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.clients.RestClient") + @mock.patch("auth0.management.clients.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value @@ -84,7 +84,7 @@ def test_create(self, mock_rc): "https://domain/api/v2/clients", data={"a": "b", "c": "d"} ) - @mock.patch("auth0.v3.management.clients.RestClient") + @mock.patch("auth0.management.clients.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -103,7 +103,7 @@ def test_get(self, mock_rc): self.assertEqual("https://domain/api/v2/clients/this-id", args[0]) self.assertEqual(kwargs["params"], {"fields": "a,b", "include_fields": "false"}) - @mock.patch("auth0.v3.management.clients.RestClient") + @mock.patch("auth0.management.clients.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value @@ -112,7 +112,7 @@ def test_delete(self, mock_rc): mock_instance.delete.assert_called_with("https://domain/api/v2/clients/this-id") - @mock.patch("auth0.v3.management.clients.RestClient") + @mock.patch("auth0.management.clients.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value @@ -124,7 +124,7 @@ def test_update(self, mock_rc): self.assertEqual("https://domain/api/v2/clients/this-id", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.clients.RestClient") + @mock.patch("auth0.management.clients.RestClient") def test_rotate_secret(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_connections.py b/auth0/test/management/test_connections.py similarity index 93% rename from auth0/v3/test/management/test_connections.py rename to auth0/test/management/test_connections.py index b9dd9ad9..488a95f6 100644 --- a/auth0/v3/test/management/test_connections.py +++ b/auth0/test/management/test_connections.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.connections.RestClient") + @mock.patch("auth0.management.connections.RestClient") def test_all(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.get.return_value = {} @@ -106,7 +106,7 @@ def test_all(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.connections.RestClient") + @mock.patch("auth0.management.connections.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.get.return_value = {} @@ -130,7 +130,7 @@ def test_get(self, mock_rc): self.assertEqual("https://domain/api/v2/connections/an-id", args[0]) self.assertEqual(kwargs["params"], {"fields": "a,b", "include_fields": "false"}) - @mock.patch("auth0.v3.management.connections.RestClient") + @mock.patch("auth0.management.connections.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.delete.return_value = {} @@ -142,7 +142,7 @@ def test_delete(self, mock_rc): "https://domain/api/v2/connections/this-id" ) - @mock.patch("auth0.v3.management.connections.RestClient") + @mock.patch("auth0.management.connections.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.patch.return_value = {} @@ -154,7 +154,7 @@ def test_update(self, mock_rc): "https://domain/api/v2/connections/that-id", data={"a": "b", "c": "d"} ) - @mock.patch("auth0.v3.management.connections.RestClient") + @mock.patch("auth0.management.connections.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.post.return_value = {} @@ -166,7 +166,7 @@ def test_create(self, mock_rc): "https://domain/api/v2/connections", data={"a": "b", "c": "d"} ) - @mock.patch("auth0.v3.management.connections.RestClient") + @mock.patch("auth0.management.connections.RestClient") def test_delete_user_by_email(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.delete_user_by_email.return_value = {} diff --git a/auth0/v3/test/management/test_custom_domains.py b/auth0/test/management/test_custom_domains.py similarity index 86% rename from auth0/v3/test/management/test_custom_domains.py rename to auth0/test/management/test_custom_domains.py index 8c3de77f..17007466 100644 --- a/auth0/v3/test/management/test_custom_domains.py +++ b/auth0/test/management/test_custom_domains.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.custom_domains.RestClient") + @mock.patch("auth0.management.custom_domains.RestClient") def test_get_all(self, mock_rc): mock_instance = mock_rc.return_value @@ -23,7 +23,7 @@ def test_get_all(self, mock_rc): mock_instance.get.assert_called_with("https://domain/api/v2/custom-domains") - @mock.patch("auth0.v3.management.custom_domains.RestClient") + @mock.patch("auth0.management.custom_domains.RestClient") def test_create_new(self, mock_rc): mock_instance = mock_rc.return_value @@ -35,7 +35,7 @@ def test_create_new(self, mock_rc): self.assertEqual("https://domain/api/v2/custom-domains", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d", "e": "f"}) - @mock.patch("auth0.v3.management.custom_domains.RestClient") + @mock.patch("auth0.management.custom_domains.RestClient") def test_get_domain_by_id(self, mock_rc): mock_instance = mock_rc.return_value @@ -46,7 +46,7 @@ def test_get_domain_by_id(self, mock_rc): "https://domain/api/v2/custom-domains/an-id" ) - @mock.patch("auth0.v3.management.custom_domains.RestClient") + @mock.patch("auth0.management.custom_domains.RestClient") def test_verify(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_device_credentials.py b/auth0/test/management/test_device_credentials.py similarity index 92% rename from auth0/v3/test/management/test_device_credentials.py rename to auth0/test/management/test_device_credentials.py index 1199a933..49a6eec4 100644 --- a/auth0/v3/test/management/test_device_credentials.py +++ b/auth0/test/management/test_device_credentials.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.device_credentials.RestClient") + @mock.patch("auth0.management.device_credentials.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -64,7 +64,7 @@ def test_get(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.device_credentials.RestClient") + @mock.patch("auth0.management.device_credentials.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value @@ -76,7 +76,7 @@ def test_create(self, mock_rc): self.assertEqual("https://domain/api/v2/device-credentials", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.device_credentials.RestClient") + @mock.patch("auth0.management.device_credentials.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_email_endpoints.py b/auth0/test/management/test_email_endpoints.py similarity index 88% rename from auth0/v3/test/management/test_email_endpoints.py rename to auth0/test/management/test_email_endpoints.py index 8cf89403..7487a291 100644 --- a/auth0/v3/test/management/test_email_endpoints.py +++ b/auth0/test/management/test_email_endpoints.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.email_templates.RestClient") + @mock.patch("auth0.management.email_templates.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value @@ -25,7 +25,7 @@ def test_create(self, mock_rc): "https://domain/api/v2/email-templates", data={"a": "b", "c": "d"} ) - @mock.patch("auth0.v3.management.email_templates.RestClient") + @mock.patch("auth0.management.email_templates.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -36,7 +36,7 @@ def test_get(self, mock_rc): "https://domain/api/v2/email-templates/this-template-name" ) - @mock.patch("auth0.v3.management.email_templates.RestClient") + @mock.patch("auth0.management.email_templates.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_emails.py b/auth0/test/management/test_emails.py similarity index 89% rename from auth0/v3/test/management/test_emails.py rename to auth0/test/management/test_emails.py index 49aa723a..424869d2 100644 --- a/auth0/v3/test/management/test_emails.py +++ b/auth0/test/management/test_emails.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.emails.RestClient") + @mock.patch("auth0.management.emails.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -31,7 +31,7 @@ def test_get(self, mock_rc): self.assertEqual("https://domain/api/v2/emails/provider", args[0]) self.assertEqual(kwargs["params"], {"fields": "a,b", "include_fields": "false"}) - @mock.patch("auth0.v3.management.emails.RestClient") + @mock.patch("auth0.management.emails.RestClient") def test_config(self, mock_rc): mock_instance = mock_rc.return_value @@ -43,7 +43,7 @@ def test_config(self, mock_rc): self.assertEqual("https://domain/api/v2/emails/provider", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.emails.RestClient") + @mock.patch("auth0.management.emails.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value @@ -55,7 +55,7 @@ def test_update(self, mock_rc): self.assertEqual("https://domain/api/v2/emails/provider", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.emails.RestClient") + @mock.patch("auth0.management.emails.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_grants.py b/auth0/test/management/test_grants.py similarity index 92% rename from auth0/v3/test/management/test_grants.py rename to auth0/test/management/test_grants.py index 117e3e58..8e9d0134 100644 --- a/auth0/v3/test/management/test_grants.py +++ b/auth0/test/management/test_grants.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.grants.RestClient") + @mock.patch("auth0.management.grants.RestClient") def test_get_all(self, mock_rc): mock_instance = mock_rc.return_value @@ -35,7 +35,7 @@ def test_get_all(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.grants.RestClient") + @mock.patch("auth0.management.grants.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_guardian.py b/auth0/test/management/test_guardian.py similarity index 89% rename from auth0/v3/test/management/test_guardian.py rename to auth0/test/management/test_guardian.py index b4c24db4..600741ab 100644 --- a/auth0/v3/test/management/test_guardian.py +++ b/auth0/test/management/test_guardian.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.guardian.RestClient") + @mock.patch("auth0.management.guardian.RestClient") def test_all_factors(self, mock_rc): mock_instance = mock_rc.return_value @@ -23,7 +23,7 @@ def test_all_factors(self, mock_rc): mock_instance.get.assert_called_with("https://domain/api/v2/guardian/factors") - @mock.patch("auth0.v3.management.guardian.RestClient") + @mock.patch("auth0.management.guardian.RestClient") def test_update_factor(self, mock_rc): mock_instance = mock_rc.return_value @@ -42,7 +42,7 @@ def test_update_factor(self, mock_rc): self.assertEqual("https://domain/api/v2/guardian/factors/sms", args[0]) self.assertEqual(kwargs["data"], {"enabled": False}) - @mock.patch("auth0.v3.management.guardian.RestClient") + @mock.patch("auth0.management.guardian.RestClient") def test_update_templates(self, mock_rc): mock_instance = mock_rc.return_value @@ -60,7 +60,7 @@ def test_update_templates(self, mock_rc): {"enrollment_message": "hello", "verification_message": "verified"}, ) - @mock.patch("auth0.v3.management.guardian.RestClient") + @mock.patch("auth0.management.guardian.RestClient") def test_get_templates(self, mock_rc): mock_instance = mock_rc.return_value @@ -71,7 +71,7 @@ def test_get_templates(self, mock_rc): "https://domain/api/v2/guardian/factors/sms/templates" ) - @mock.patch("auth0.v3.management.guardian.RestClient") + @mock.patch("auth0.management.guardian.RestClient") def test_get_enrollment(self, mock_rc): mock_instance = mock_rc.return_value @@ -82,7 +82,7 @@ def test_get_enrollment(self, mock_rc): "https://domain/api/v2/guardian/enrollments/some_id" ) - @mock.patch("auth0.v3.management.guardian.RestClient") + @mock.patch("auth0.management.guardian.RestClient") def test_delete_enrollment(self, mock_rc): mock_instance = mock_rc.return_value @@ -93,7 +93,7 @@ def test_delete_enrollment(self, mock_rc): "https://domain/api/v2/guardian/enrollments/some_id" ) - @mock.patch("auth0.v3.management.guardian.RestClient") + @mock.patch("auth0.management.guardian.RestClient") def test_create_enrollment_ticket(self, mock_rc): mock_instance = mock_rc.return_value @@ -109,7 +109,7 @@ def test_create_enrollment_ticket(self, mock_rc): {"user_id": "some_id", "email": "test@test.com", "send_mail": "false"}, ) - @mock.patch("auth0.v3.management.guardian.RestClient") + @mock.patch("auth0.management.guardian.RestClient") def test_get_factor_providers(self, mock_rc): mock_instance = mock_rc.return_value @@ -120,7 +120,7 @@ def test_get_factor_providers(self, mock_rc): "https://domain/api/v2/guardian/factors/sms/providers/twilio" ) - @mock.patch("auth0.v3.management.guardian.RestClient") + @mock.patch("auth0.management.guardian.RestClient") def test_update_factor_providers(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_hooks.py b/auth0/test/management/test_hooks.py similarity index 91% rename from auth0/v3/test/management/test_hooks.py rename to auth0/test/management/test_hooks.py index cdd21bbf..ced9994b 100644 --- a/auth0/v3/test/management/test_hooks.py +++ b/auth0/test/management/test_hooks.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.hooks.RestClient") + @mock.patch("auth0.management.hooks.RestClient") def test_all(self, mock_rc): mock_instance = mock_rc.return_value @@ -72,7 +72,7 @@ def test_all(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.hooks.RestClient") + @mock.patch("auth0.management.hooks.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value @@ -84,7 +84,7 @@ def test_create(self, mock_rc): self.assertEqual("https://domain/api/v2/hooks", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.hooks.RestClient") + @mock.patch("auth0.management.hooks.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -103,7 +103,7 @@ def test_get(self, mock_rc): self.assertEqual("https://domain/api/v2/hooks/an-id", args[0]) self.assertEqual(kwargs["params"], {"fields": "a,b"}) - @mock.patch("auth0.v3.management.hooks.RestClient") + @mock.patch("auth0.management.hooks.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value @@ -112,7 +112,7 @@ def test_delete(self, mock_rc): mock_instance.delete.assert_called_with("https://domain/api/v2/hooks/an-id") - @mock.patch("auth0.v3.management.hooks.RestClient") + @mock.patch("auth0.management.hooks.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value @@ -125,7 +125,7 @@ def test_update(self, mock_rc): self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) # test for hooks secrets - @mock.patch("auth0.v3.management.hooks.RestClient") + @mock.patch("auth0.management.hooks.RestClient") def test_add_secret(self, mock_rc): mock_instance = mock_rc.return_value @@ -137,7 +137,7 @@ def test_add_secret(self, mock_rc): self.assertEqual("https://domain/api/v2/hooks/an-id/secrets", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.hooks.RestClient") + @mock.patch("auth0.management.hooks.RestClient") def test_get_secrets(self, mock_rc): mock_instance = mock_rc.return_value @@ -149,7 +149,7 @@ def test_get_secrets(self, mock_rc): self.assertEqual("https://domain/api/v2/hooks/an-id/secrets", args[0]) self.assertNotIn("params", kwargs) - @mock.patch("auth0.v3.management.hooks.RestClient") + @mock.patch("auth0.management.hooks.RestClient") def test_delete_secrets(self, mock_rc): mock_instance = mock_rc.return_value @@ -161,7 +161,7 @@ def test_delete_secrets(self, mock_rc): self.assertEqual("https://domain/api/v2/hooks/an-id/secrets", args[0]) self.assertEqual(kwargs["data"], ["a", "b"]) - @mock.patch("auth0.v3.management.hooks.RestClient") + @mock.patch("auth0.management.hooks.RestClient") def test_update_secrets(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_jobs.py b/auth0/test/management/test_jobs.py similarity index 92% rename from auth0/v3/test/management/test_jobs.py rename to auth0/test/management/test_jobs.py index f92d3724..15fddaf6 100644 --- a/auth0/v3/test/management/test_jobs.py +++ b/auth0/test/management/test_jobs.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.jobs.RestClient") + @mock.patch("auth0.management.jobs.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -23,7 +23,7 @@ def test_get(self, mock_rc): "https://domain/api/v2/jobs/an-id", ) - @mock.patch("auth0.v3.management.jobs.RestClient") + @mock.patch("auth0.management.jobs.RestClient") def test_get_failed_job(self, mock_rc): mock_instance = mock_rc.return_value @@ -34,7 +34,7 @@ def test_get_failed_job(self, mock_rc): "https://domain/api/v2/jobs/an-id/errors", ) - @mock.patch("auth0.v3.management.jobs.RestClient") + @mock.patch("auth0.management.jobs.RestClient") def test_export_users(self, mock_rc): mock_instance = mock_rc.return_value @@ -46,7 +46,7 @@ def test_export_users(self, mock_rc): data={"connection_id": "cxn_id", "format": "json"}, ) - @mock.patch("auth0.v3.management.jobs.RestClient") + @mock.patch("auth0.management.jobs.RestClient") def test_import_users(self, mock_rc): mock_instance = mock_rc.return_value @@ -96,7 +96,7 @@ def test_import_users(self, mock_rc): files={"users": {}}, ) - @mock.patch("auth0.v3.management.jobs.RestClient") + @mock.patch("auth0.management.jobs.RestClient") def test_verification_email(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_log_streams.py b/auth0/test/management/test_log_streams.py similarity index 88% rename from auth0/v3/test/management/test_log_streams.py rename to auth0/test/management/test_log_streams.py index 9547612e..95e05a12 100644 --- a/auth0/v3/test/management/test_log_streams.py +++ b/auth0/test/management/test_log_streams.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.log_streams.RestClient") + @mock.patch("auth0.management.log_streams.RestClient") def test_list(self, mock_rc): mock_instance = mock_rc.return_value @@ -26,7 +26,7 @@ def test_list(self, mock_rc): self.assertEqual("https://domain/api/v2/log-streams", args[0]) - @mock.patch("auth0.v3.management.log_streams.RestClient") + @mock.patch("auth0.management.log_streams.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -37,7 +37,7 @@ def test_get(self, mock_rc): self.assertEqual("https://domain/api/v2/log-streams/an-id", args[0]) - @mock.patch("auth0.v3.management.log_streams.RestClient") + @mock.patch("auth0.management.log_streams.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value @@ -60,7 +60,7 @@ def test_create(self, mock_rc): self.assertEqual("https://domain/api/v2/log-streams", args[0]) self.assertEqual(kwargs["data"], log_stream_data) - @mock.patch("auth0.v3.management.log_streams.RestClient") + @mock.patch("auth0.management.log_streams.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value @@ -71,7 +71,7 @@ def test_delete(self, mock_rc): "https://domain/api/v2/log-streams/an-id" ) - @mock.patch("auth0.v3.management.log_streams.RestClient") + @mock.patch("auth0.management.log_streams.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value log_stream_update = {"name": "string"} diff --git a/auth0/v3/test/management/test_logs.py b/auth0/test/management/test_logs.py similarity index 94% rename from auth0/v3/test/management/test_logs.py rename to auth0/test/management/test_logs.py index 806290ac..bbf02667 100644 --- a/auth0/v3/test/management/test_logs.py +++ b/auth0/test/management/test_logs.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.logs.RestClient") + @mock.patch("auth0.management.logs.RestClient") def test_search(self, mock_rc): mock_instance = mock_rc.return_value @@ -42,7 +42,7 @@ def test_search(self, mock_rc): self.assertEqual(kwargs["params"]["per_page"], 2) self.assertEqual(kwargs["params"]["page"], 0) - @mock.patch("auth0.v3.management.logs.RestClient") + @mock.patch("auth0.management.logs.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_organizations.py b/auth0/test/management/test_organizations.py similarity index 91% rename from auth0/v3/test/management/test_organizations.py rename to auth0/test/management/test_organizations.py index e4c58f29..00f1924a 100644 --- a/auth0/v3/test/management/test_organizations.py +++ b/auth0/test/management/test_organizations.py @@ -15,7 +15,7 @@ def test_init_with_optionals(self): self.assertEqual(telemetry_header, None) # Organizations - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_all_organizations(self, mock_rc): mock_instance = mock_rc.return_value @@ -72,7 +72,7 @@ def test_all_organizations(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_get_organization_by_name(self, mock_rc): mock_instance = mock_rc.return_value @@ -84,7 +84,7 @@ def test_get_organization_by_name(self, mock_rc): self.assertEqual("https://domain/api/v2/organizations/name/test-org", args[0]) self.assertEqual(kwargs["params"], {}) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_get_organization(self, mock_rc): mock_instance = mock_rc.return_value @@ -96,7 +96,7 @@ def test_get_organization(self, mock_rc): self.assertEqual("https://domain/api/v2/organizations/org123", args[0]) self.assertEqual(kwargs["params"], {}) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_create_organization(self, mock_rc): mock_instance = mock_rc.return_value @@ -107,7 +107,7 @@ def test_create_organization(self, mock_rc): "https://domain/api/v2/organizations", data={"a": "b", "c": "d"} ) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_update_organization(self, mock_rc): mock_instance = mock_rc.return_value @@ -119,7 +119,7 @@ def test_update_organization(self, mock_rc): self.assertEqual("https://domain/api/v2/organizations/this-id", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_delete_organization(self, mock_rc): mock_instance = mock_rc.return_value @@ -131,7 +131,7 @@ def test_delete_organization(self, mock_rc): ) # Organization Connections - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_all_organization_connections(self, mock_rc): mock_instance = mock_rc.return_value @@ -157,7 +157,7 @@ def test_all_organization_connections(self, mock_rc): ) self.assertEqual(kwargs["params"], {"page": 7, "per_page": 25}) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_get_organization_connection(self, mock_rc): mock_instance = mock_rc.return_value @@ -172,7 +172,7 @@ def test_get_organization_connection(self, mock_rc): ) self.assertEqual(kwargs["params"], {}) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_create_organization_connection(self, mock_rc): mock_instance = mock_rc.return_value @@ -184,7 +184,7 @@ def test_create_organization_connection(self, mock_rc): data={"a": "b", "c": "d"}, ) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_update_organization_connection(self, mock_rc): mock_instance = mock_rc.return_value @@ -199,7 +199,7 @@ def test_update_organization_connection(self, mock_rc): ) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_delete_organization_connection(self, mock_rc): mock_instance = mock_rc.return_value @@ -211,7 +211,7 @@ def test_delete_organization_connection(self, mock_rc): ) # Organization Members - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_all_organization_members(self, mock_rc): mock_instance = mock_rc.return_value @@ -276,7 +276,7 @@ def test_all_organization_members(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_create_organization_members(self, mock_rc): mock_instance = mock_rc.return_value @@ -288,7 +288,7 @@ def test_create_organization_members(self, mock_rc): data={"a": "b", "c": "d"}, ) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_delete_organization_members(self, mock_rc): mock_instance = mock_rc.return_value @@ -301,7 +301,7 @@ def test_delete_organization_members(self, mock_rc): ) # Organization Member Roles - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_all_organization_member_roles(self, mock_rc): mock_instance = mock_rc.return_value @@ -329,7 +329,7 @@ def test_all_organization_member_roles(self, mock_rc): ) self.assertEqual(kwargs["params"], {"page": 7, "per_page": 25}) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_create_organization_member_roles(self, mock_rc): mock_instance = mock_rc.return_value @@ -343,7 +343,7 @@ def test_create_organization_member_roles(self, mock_rc): data={"a": "b", "c": "d"}, ) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_delete_organization_member_roles(self, mock_rc): mock_instance = mock_rc.return_value @@ -358,7 +358,7 @@ def test_delete_organization_member_roles(self, mock_rc): ) # Organization Invitations - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_all_organization_invitations(self, mock_rc): mock_instance = mock_rc.return_value @@ -417,7 +417,7 @@ def test_all_organization_invitations(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_get_organization_invitation(self, mock_rc): mock_instance = mock_rc.return_value @@ -431,7 +431,7 @@ def test_get_organization_invitation(self, mock_rc): ) self.assertEqual(kwargs["params"], {}) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_create_organization_invitation(self, mock_rc): mock_instance = mock_rc.return_value @@ -443,7 +443,7 @@ def test_create_organization_invitation(self, mock_rc): data={"a": "b", "c": "d"}, ) - @mock.patch("auth0.v3.management.organizations.RestClient") + @mock.patch("auth0.management.organizations.RestClient") def test_delete_organization_invitation(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_prompts.py b/auth0/test/management/test_prompts.py similarity index 89% rename from auth0/v3/test/management/test_prompts.py rename to auth0/test/management/test_prompts.py index 4d4d56e1..ece89fcf 100644 --- a/auth0/v3/test/management/test_prompts.py +++ b/auth0/test/management/test_prompts.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.prompts.RestClient") + @mock.patch("auth0.management.prompts.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -23,7 +23,7 @@ def test_get(self, mock_rc): self.assertEqual("https://domain/api/v2/prompts", args[0]) - @mock.patch("auth0.v3.management.prompts.RestClient") + @mock.patch("auth0.management.prompts.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value @@ -35,7 +35,7 @@ def test_update(self, mock_rc): self.assertEqual("https://domain/api/v2/prompts", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.prompts.RestClient") + @mock.patch("auth0.management.prompts.RestClient") def test_get_custom_text(self, mock_rc): mock_instance = mock_rc.return_value @@ -49,7 +49,7 @@ def test_get_custom_text(self, mock_rc): args[0], ) - @mock.patch("auth0.v3.management.prompts.RestClient") + @mock.patch("auth0.management.prompts.RestClient") def test_update_custom_text(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_resource_servers.py b/auth0/test/management/test_resource_servers.py similarity index 88% rename from auth0/v3/test/management/test_resource_servers.py rename to auth0/test/management/test_resource_servers.py index 458dfde8..3260701f 100644 --- a/auth0/v3/test/management/test_resource_servers.py +++ b/auth0/test/management/test_resource_servers.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.resource_servers.RestClient") + @mock.patch("auth0.management.resource_servers.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value @@ -27,7 +27,7 @@ def test_create(self, mock_rc): data={"name": "TestApi", "identifier": "https://test.com/api"}, ) - @mock.patch("auth0.v3.management.resource_servers.RestClient") + @mock.patch("auth0.management.resource_servers.RestClient") def test_get_all(self, mock_rc): mock_instance = mock_rc.return_value @@ -49,7 +49,7 @@ def test_get_all(self, mock_rc): params={"page": 3, "per_page": 27, "include_totals": "true"}, ) - @mock.patch("auth0.v3.management.resource_servers.RestClient") + @mock.patch("auth0.management.resource_servers.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -61,7 +61,7 @@ def test_get(self, mock_rc): "https://domain/api/v2/resource-servers/some_id" ) - @mock.patch("auth0.v3.management.resource_servers.RestClient") + @mock.patch("auth0.management.resource_servers.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value @@ -73,7 +73,7 @@ def test_delete(self, mock_rc): "https://domain/api/v2/resource-servers/some_id" ) - @mock.patch("auth0.v3.management.resource_servers.RestClient") + @mock.patch("auth0.management.resource_servers.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_rest.py b/auth0/test/management/test_rest.py similarity index 99% rename from auth0/v3/test/management/test_rest.py rename to auth0/test/management/test_rest.py index b929b7a9..4e3b6ca1 100644 --- a/auth0/v3/test/management/test_rest.py +++ b/auth0/test/management/test_rest.py @@ -6,7 +6,7 @@ import mock import requests -from auth0.v3.rest import RestClient, RestClientOptions +from auth0.rest import RestClient, RestClientOptions from ...exceptions import Auth0Error, RateLimitError diff --git a/auth0/v3/test/management/test_roles.py b/auth0/test/management/test_roles.py similarity index 91% rename from auth0/v3/test/management/test_roles.py rename to auth0/test/management/test_roles.py index a78d5170..db029243 100644 --- a/auth0/v3/test/management/test_roles.py +++ b/auth0/test/management/test_roles.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.roles.RestClient") + @mock.patch("auth0.management.roles.RestClient") def test_list(self, mock_rc): mock_instance = mock_rc.return_value @@ -42,7 +42,7 @@ def test_list(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.roles.RestClient") + @mock.patch("auth0.management.roles.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value @@ -54,7 +54,7 @@ def test_create(self, mock_rc): self.assertEqual("https://domain/api/v2/roles", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.roles.RestClient") + @mock.patch("auth0.management.roles.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -65,7 +65,7 @@ def test_get(self, mock_rc): self.assertEqual("https://domain/api/v2/roles/an-id", args[0]) - @mock.patch("auth0.v3.management.roles.RestClient") + @mock.patch("auth0.management.roles.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value @@ -74,7 +74,7 @@ def test_delete(self, mock_rc): mock_instance.delete.assert_called_with("https://domain/api/v2/roles/an-id") - @mock.patch("auth0.v3.management.roles.RestClient") + @mock.patch("auth0.management.roles.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value @@ -86,7 +86,7 @@ def test_update(self, mock_rc): self.assertEqual("https://domain/api/v2/roles/an-id", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.roles.RestClient") + @mock.patch("auth0.management.roles.RestClient") def test_list_users(self, mock_rc): mock_instance = mock_rc.return_value @@ -138,7 +138,7 @@ def test_list_users(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.roles.RestClient") + @mock.patch("auth0.management.roles.RestClient") def test_add_users(self, mock_rc): mock_instance = mock_rc.return_value @@ -150,7 +150,7 @@ def test_add_users(self, mock_rc): self.assertEqual("https://domain/api/v2/roles/an-id/users", args[0]) self.assertEqual(kwargs["data"], {"users": ["a", "b"]}) - @mock.patch("auth0.v3.management.roles.RestClient") + @mock.patch("auth0.management.roles.RestClient") def test_list_permissions(self, mock_rc): mock_instance = mock_rc.return_value @@ -172,7 +172,7 @@ def test_list_permissions(self, mock_rc): kwargs["params"], {"per_page": 50, "page": 1, "include_totals": "false"} ) - @mock.patch("auth0.v3.management.roles.RestClient") + @mock.patch("auth0.management.roles.RestClient") def test_remove_permissions(self, mock_rc): mock_instance = mock_rc.return_value @@ -184,7 +184,7 @@ def test_remove_permissions(self, mock_rc): self.assertEqual("https://domain/api/v2/roles/an-id/permissions", args[0]) self.assertEqual(kwargs["data"], {"permissions": ["a", "b"]}) - @mock.patch("auth0.v3.management.roles.RestClient") + @mock.patch("auth0.management.roles.RestClient") def test_add_permissions(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_rules.py b/auth0/test/management/test_rules.py similarity index 93% rename from auth0/v3/test/management/test_rules.py rename to auth0/test/management/test_rules.py index fcdb4408..879e0a1a 100644 --- a/auth0/v3/test/management/test_rules.py +++ b/auth0/test/management/test_rules.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.rules.RestClient") + @mock.patch("auth0.management.rules.RestClient") def test_all(self, mock_rc): mock_instance = mock_rc.return_value @@ -75,7 +75,7 @@ def test_all(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.rules.RestClient") + @mock.patch("auth0.management.rules.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value @@ -87,7 +87,7 @@ def test_create(self, mock_rc): self.assertEqual("https://domain/api/v2/rules", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.rules.RestClient") + @mock.patch("auth0.management.rules.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -106,7 +106,7 @@ def test_get(self, mock_rc): self.assertEqual("https://domain/api/v2/rules/an-id", args[0]) self.assertEqual(kwargs["params"], {"fields": "a,b", "include_fields": "false"}) - @mock.patch("auth0.v3.management.rules.RestClient") + @mock.patch("auth0.management.rules.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value @@ -115,7 +115,7 @@ def test_delete(self, mock_rc): mock_instance.delete.assert_called_with("https://domain/api/v2/rules/an-id") - @mock.patch("auth0.v3.management.rules.RestClient") + @mock.patch("auth0.management.rules.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_rules_configs.py b/auth0/test/management/test_rules_configs.py similarity index 87% rename from auth0/v3/test/management/test_rules_configs.py rename to auth0/test/management/test_rules_configs.py index bfe08293..94b7e51a 100644 --- a/auth0/v3/test/management/test_rules_configs.py +++ b/auth0/test/management/test_rules_configs.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.rules_configs.RestClient") + @mock.patch("auth0.management.rules_configs.RestClient") def test_all(self, mock_rc): mock_instance = mock_rc.return_value @@ -26,7 +26,7 @@ def test_all(self, mock_rc): self.assertEqual("https://domain/api/v2/rules-configs", args[0]) - @mock.patch("auth0.v3.management.rules_configs.RestClient") + @mock.patch("auth0.management.rules_configs.RestClient") def test_unset(self, mock_rc): mock_instance = mock_rc.return_value @@ -37,7 +37,7 @@ def test_unset(self, mock_rc): "https://domain/api/v2/rules-configs/an-id" ) - @mock.patch("auth0.v3.management.rules_configs.RestClient") + @mock.patch("auth0.management.rules_configs.RestClient") def test_set(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_stats.py b/auth0/test/management/test_stats.py similarity index 91% rename from auth0/v3/test/management/test_stats.py rename to auth0/test/management/test_stats.py index dd4b3d34..ae79a030 100644 --- a/auth0/v3/test/management/test_stats.py +++ b/auth0/test/management/test_stats.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.stats.RestClient") + @mock.patch("auth0.management.stats.RestClient") def test_active_users(self, mock_rc): mock_instance = mock_rc.return_value @@ -23,7 +23,7 @@ def test_active_users(self, mock_rc): "https://domain/api/v2/stats/active-users", ) - @mock.patch("auth0.v3.management.stats.RestClient") + @mock.patch("auth0.management.stats.RestClient") def test_daily_stats(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_tenants.py b/auth0/test/management/test_tenants.py similarity index 93% rename from auth0/v3/test/management/test_tenants.py rename to auth0/test/management/test_tenants.py index 5b4f87d4..43cc5d7a 100644 --- a/auth0/v3/test/management/test_tenants.py +++ b/auth0/test/management/test_tenants.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.tenants.RestClient") + @mock.patch("auth0.management.tenants.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.get.return_value = {} @@ -39,7 +39,7 @@ def test_get(self, mock_rc): self.assertEqual("https://domain/api/v2/tenants/settings", args[0]) self.assertEqual(kwargs["params"], {"fields": "a,b", "include_fields": "true"}) - @mock.patch("auth0.v3.management.tenants.RestClient") + @mock.patch("auth0.management.tenants.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value mock_instance.patch.return_value = {} diff --git a/auth0/v3/test/management/test_tickets.py b/auth0/test/management/test_tickets.py similarity index 90% rename from auth0/v3/test/management/test_tickets.py rename to auth0/test/management/test_tickets.py index c5614576..c4f85ad4 100644 --- a/auth0/v3/test/management/test_tickets.py +++ b/auth0/test/management/test_tickets.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.tickets.RestClient") + @mock.patch("auth0.management.tickets.RestClient") def test_email(self, mock_rc): mock_instance = mock_rc.return_value @@ -24,7 +24,7 @@ def test_email(self, mock_rc): data={"a": "b", "c": "d"}, ) - @mock.patch("auth0.v3.management.tickets.RestClient") + @mock.patch("auth0.management.tickets.RestClient") def test_pswd(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_user_blocks.py b/auth0/test/management/test_user_blocks.py similarity index 88% rename from auth0/v3/test/management/test_user_blocks.py rename to auth0/test/management/test_user_blocks.py index 8555ee29..2c809de0 100644 --- a/auth0/v3/test/management/test_user_blocks.py +++ b/auth0/test/management/test_user_blocks.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.user_blocks.RestClient") + @mock.patch("auth0.management.user_blocks.RestClient") def test_get_by_identifier(self, mock_rc): mock_instance = mock_rc.return_value @@ -27,7 +27,7 @@ def test_get_by_identifier(self, mock_rc): params={"identifier": "some_identifier"}, ) - @mock.patch("auth0.v3.management.user_blocks.RestClient") + @mock.patch("auth0.management.user_blocks.RestClient") def test_unblock_by_identifier(self, mock_rc): mock_instance = mock_rc.return_value @@ -39,7 +39,7 @@ def test_unblock_by_identifier(self, mock_rc): "https://domain/api/v2/user-blocks", params={"identifier": "test@test.com"} ) - @mock.patch("auth0.v3.management.user_blocks.RestClient") + @mock.patch("auth0.management.user_blocks.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -51,7 +51,7 @@ def test_get(self, mock_rc): "https://domain/api/v2/user-blocks/auth0|584ad3c228be27504a2c80d5" ) - @mock.patch("auth0.v3.management.user_blocks.RestClient") + @mock.patch("auth0.management.user_blocks.RestClient") def test_unblock(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_users.py b/auth0/test/management/test_users.py similarity index 90% rename from auth0/v3/test/management/test_users.py rename to auth0/test/management/test_users.py index 29924dd0..a6837e53 100644 --- a/auth0/v3/test/management/test_users.py +++ b/auth0/test/management/test_users.py @@ -12,7 +12,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_list(self, mock_rc): mock_instance = mock_rc.return_value @@ -67,7 +67,7 @@ def test_list(self, mock_rc): }, ) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_create(self, mock_rc): mock_instance = mock_rc.return_value @@ -79,7 +79,7 @@ def test_create(self, mock_rc): self.assertEqual("https://domain/api/v2/users", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_get(self, mock_rc): mock_instance = mock_rc.return_value @@ -98,7 +98,7 @@ def test_get(self, mock_rc): self.assertEqual("https://domain/api/v2/users/an-id", args[0]) self.assertEqual(kwargs["params"], {"fields": "a,b", "include_fields": "false"}) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_delete(self, mock_rc): mock_instance = mock_rc.return_value @@ -107,7 +107,7 @@ def test_delete(self, mock_rc): mock_instance.delete.assert_called_with("https://domain/api/v2/users/an-id") - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_update(self, mock_rc): mock_instance = mock_rc.return_value @@ -119,7 +119,7 @@ def test_update(self, mock_rc): self.assertEqual("https://domain/api/v2/users/an-id", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_list_organizations(self, mock_rc): mock_instance = mock_rc.return_value @@ -141,7 +141,7 @@ def test_list_organizations(self, mock_rc): kwargs["params"], {"per_page": 50, "page": 1, "include_totals": "false"} ) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_list_roles(self, mock_rc): mock_instance = mock_rc.return_value @@ -163,7 +163,7 @@ def test_list_roles(self, mock_rc): kwargs["params"], {"per_page": 50, "page": 1, "include_totals": "false"} ) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_remove_roles(self, mock_rc): mock_instance = mock_rc.return_value @@ -175,7 +175,7 @@ def test_remove_roles(self, mock_rc): self.assertEqual("https://domain/api/v2/users/an-id/roles", args[0]) self.assertEqual(kwargs["data"], {"roles": ["a", "b"]}) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_add_roles(self, mock_rc): mock_instance = mock_rc.return_value @@ -187,7 +187,7 @@ def test_add_roles(self, mock_rc): self.assertEqual("https://domain/api/v2/users/an-id/roles", args[0]) self.assertEqual(kwargs["data"], {"roles": ["a", "b"]}) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_list_permissions(self, mock_rc): mock_instance = mock_rc.return_value @@ -209,7 +209,7 @@ def test_list_permissions(self, mock_rc): kwargs["params"], {"per_page": 50, "page": 1, "include_totals": "false"} ) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_remove_permissions(self, mock_rc): mock_instance = mock_rc.return_value @@ -221,7 +221,7 @@ def test_remove_permissions(self, mock_rc): self.assertEqual("https://domain/api/v2/users/an-id/permissions", args[0]) self.assertEqual(kwargs["data"], {"permissions": ["a", "b"]}) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_add_permissions(self, mock_rc): mock_instance = mock_rc.return_value @@ -233,7 +233,7 @@ def test_add_permissions(self, mock_rc): self.assertEqual("https://domain/api/v2/users/an-id/permissions", args[0]) self.assertEqual(kwargs["data"], {"permissions": ["a", "b"]}) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_delete_multifactor(self, mock_rc): mock_instance = mock_rc.return_value @@ -244,7 +244,7 @@ def test_delete_multifactor(self, mock_rc): "https://domain/api/v2/users/an-id/multifactor/provider" ) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_delete_authenticators(self, mock_rc): mock_instance = mock_rc.return_value @@ -255,7 +255,7 @@ def test_delete_authenticators(self, mock_rc): "https://domain/api/v2/users/an-id/authenticators" ) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_unlink_user_account(self, mock_rc): mock_instance = mock_rc.return_value @@ -266,7 +266,7 @@ def test_unlink_user_account(self, mock_rc): "https://domain/api/v2/users/an-id/identities/provider/user-id" ) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_link_user_account(self, mock_rc): mock_instance = mock_rc.return_value @@ -278,7 +278,7 @@ def test_link_user_account(self, mock_rc): self.assertEqual("https://domain/api/v2/users/user-id/identities", args[0]) self.assertEqual(kwargs["data"], {"a": "b", "c": "d"}) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_regenerate_recovery_code(self, mock_rc): mock_instance = mock_rc.return_value @@ -289,7 +289,7 @@ def test_regenerate_recovery_code(self, mock_rc): "https://domain/api/v2/users/user-id/recovery-code-regeneration" ) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_get_guardian_enrollments(self, mock_rc): mock_instance = mock_rc.return_value @@ -300,7 +300,7 @@ def test_get_guardian_enrollments(self, mock_rc): "https://domain/api/v2/users/user-id/enrollments" ) - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_get_log_events(self, mock_rc): mock_instance = mock_rc.return_value @@ -314,7 +314,7 @@ def test_get_log_events(self, mock_rc): self.assertIsNone(kwargs["params"]["sort"]) self.assertEqual(kwargs["params"]["include_totals"], "false") - @mock.patch("auth0.v3.management.users.RestClient") + @mock.patch("auth0.management.users.RestClient") def test_invalidate_remembered_browsers(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test/management/test_users_by_email.py b/auth0/test/management/test_users_by_email.py similarity index 95% rename from auth0/v3/test/management/test_users_by_email.py rename to auth0/test/management/test_users_by_email.py index aa510ccf..09edf766 100644 --- a/auth0/v3/test/management/test_users_by_email.py +++ b/auth0/test/management/test_users_by_email.py @@ -14,7 +14,7 @@ def test_init_with_optionals(self): telemetry_header = t.client.base_headers.get("Auth0-Client", None) self.assertEqual(telemetry_header, None) - @mock.patch("auth0.v3.management.users_by_email.RestClient") + @mock.patch("auth0.management.users_by_email.RestClient") def test_search_users_by_email(self, mock_rc): mock_instance = mock_rc.return_value diff --git a/auth0/v3/test_async/__init__.py b/auth0/test_async/__init__.py similarity index 100% rename from auth0/v3/test_async/__init__.py rename to auth0/test_async/__init__.py diff --git a/auth0/v3/test_async/test_async_auth0.py b/auth0/test_async/test_async_auth0.py similarity index 92% rename from auth0/v3/test_async/test_async_auth0.py rename to auth0/test_async/test_async_auth0.py index d9be2fe9..70e188e3 100644 --- a/auth0/v3/test_async/test_async_auth0.py +++ b/auth0/test_async/test_async_auth0.py @@ -1,17 +1,11 @@ -import base64 -import json -import platform import re -import sys import unittest -from tempfile import TemporaryFile -import aiohttp from aioresponses import CallbackResult, aioresponses from callee import Attrs from mock import ANY, MagicMock -from auth0.v3.management.async_auth0 import AsyncAuth0 as Auth0 +from auth0.management.async_auth0 import AsyncAuth0 as Auth0 clients = re.compile(r"^https://example\.com/api/v2/clients.*") factors = re.compile(r"^https://example\.com/api/v2/guardian/factors.*") diff --git a/auth0/v3/test_async/test_async_token_verifier.py b/auth0/test_async/test_async_token_verifier.py similarity index 99% rename from auth0/v3/test_async/test_async_token_verifier.py rename to auth0/test_async/test_async_token_verifier.py index 77fc6b57..09b8ab02 100644 --- a/auth0/v3/test_async/test_async_token_verifier.py +++ b/auth0/test_async/test_async_token_verifier.py @@ -80,7 +80,7 @@ async def test_async_asymmetric_verifier_fetches_key(self, mocked): class TestAsyncJwksFetcher(getattr(unittest, "IsolatedAsyncioTestCase", object)): @aioresponses() @unittest.mock.patch( - "auth0.v3.authentication.token_verifier.time.time", return_value=0 + "auth0.authentication.token_verifier.time.time", return_value=0 ) async def test_async_get_jwks_json_twice_on_cache_expired( self, mocked, mocked_time diff --git a/auth0/v3/test_async/test_asyncify.py b/auth0/test_async/test_asyncify.py similarity index 98% rename from auth0/v3/test_async/test_asyncify.py rename to auth0/test_async/test_asyncify.py index 18f9998b..312afa38 100644 --- a/auth0/v3/test_async/test_asyncify.py +++ b/auth0/test_async/test_asyncify.py @@ -11,8 +11,8 @@ from callee import Attrs from mock import ANY, MagicMock -from auth0.v3.asyncify import asyncify -from auth0.v3.management import Clients, Guardian, Jobs +from auth0.asyncify import asyncify +from auth0.management import Clients, Guardian, Jobs clients = re.compile(r"^https://example\.com/api/v2/clients.*") factors = re.compile(r"^https://example\.com/api/v2/guardian/factors.*") diff --git a/auth0/v3/utils.py b/auth0/utils.py similarity index 100% rename from auth0/v3/utils.py rename to auth0/utils.py diff --git a/auth0/v3/__init__.py b/auth0/v3/__init__.py deleted file mode 100644 index 2e0c960a..00000000 --- a/auth0/v3/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .exceptions import Auth0Error, RateLimitError, TokenValidationError - -__all__ = ("Auth0Error", "RateLimitError", "TokenValidationError") diff --git a/docs/make.bat b/docs/make.bat index 0afaf710..46a138e1 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -8,7 +8,7 @@ if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set SOURCEDIR=source -set BUILDDIR=../auth0/v3 +set BUILDDIR=../auth0 if "%1" == "" goto help diff --git a/docs/source/v3.authentication.rst b/docs/source/authentication.rst similarity index 71% rename from docs/source/v3.authentication.rst rename to docs/source/authentication.rst index 2324cb26..f74fb157 100644 --- a/docs/source/v3.authentication.rst +++ b/docs/source/authentication.rst @@ -4,7 +4,7 @@ authentication package authentication.base module ----------------------------- -.. automodule:: auth0.v3.authentication.base +.. automodule:: auth0.authentication.base :members: :undoc-members: :show-inheritance: @@ -12,7 +12,7 @@ authentication.base module authentication.database module --------------------------------- -.. automodule:: auth0.v3.authentication.database +.. automodule:: auth0.authentication.database :members: :undoc-members: :show-inheritance: @@ -20,7 +20,7 @@ authentication.database module authentication.delegated module ---------------------------------- -.. automodule:: auth0.v3.authentication.delegated +.. automodule:: auth0.authentication.delegated :members: :undoc-members: :show-inheritance: @@ -28,7 +28,7 @@ authentication.delegated module authentication.enterprise module ----------------------------------- -.. automodule:: auth0.v3.authentication.enterprise +.. automodule:: auth0.authentication.enterprise :members: :undoc-members: :show-inheritance: @@ -36,7 +36,7 @@ authentication.enterprise module authentication.get\_token module ----------------------------------- -.. automodule:: auth0.v3.authentication.get_token +.. automodule:: auth0.authentication.get_token :members: :undoc-members: :show-inheritance: @@ -44,7 +44,7 @@ authentication.get\_token module authentication.passwordless module ------------------------------------- -.. automodule:: auth0.v3.authentication.passwordless +.. automodule:: auth0.authentication.passwordless :members: :undoc-members: :show-inheritance: @@ -52,7 +52,7 @@ authentication.passwordless module authentication.revoke\_token module -------------------------------------- -.. automodule:: auth0.v3.authentication.revoke_token +.. automodule:: auth0.authentication.revoke_token :members: :undoc-members: :show-inheritance: @@ -60,7 +60,7 @@ authentication.revoke\_token module authentication.social module ------------------------------- -.. automodule:: auth0.v3.authentication.social +.. automodule:: auth0.authentication.social :members: :undoc-members: :show-inheritance: @@ -68,7 +68,7 @@ authentication.social module authentication.token\_verifier module ---------------------------------------- -.. automodule:: auth0.v3.authentication.token_verifier +.. automodule:: auth0.authentication.token_verifier :members: :undoc-members: :show-inheritance: @@ -76,7 +76,7 @@ authentication.token\_verifier module authentication.users module ------------------------------ -.. automodule:: auth0.v3.authentication.users +.. automodule:: auth0.authentication.users :members: :undoc-members: :show-inheritance: diff --git a/docs/source/conf.py b/docs/source/conf.py index a801107a..3394dde9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -39,7 +39,7 @@ def find_version(*file_paths): # -- regenerate autodoc definitions -# sphinx-apidoc -o ./source ../auth0/v3/ +# sphinx-apidoc -o ./source ../auth0/ # -- Project information ----------------------------------------------------- diff --git a/docs/source/v3.exceptions.rst b/docs/source/exceptions.rst similarity index 78% rename from docs/source/v3.exceptions.rst rename to docs/source/exceptions.rst index 261a1f44..e4f725c9 100644 --- a/docs/source/v3.exceptions.rst +++ b/docs/source/exceptions.rst @@ -4,7 +4,7 @@ exceptions module Module contents --------------- -.. automodule:: auth0.v3.exceptions +.. automodule:: auth0.exceptions :members: :undoc-members: :show-inheritance: diff --git a/docs/source/index.rst b/docs/source/index.rst index ceea3bc6..8370e585 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -12,6 +12,6 @@ Auth0-Python documentation :hidden: :caption: API Documentation - v3.authentication - v3.management - v3.exceptions + authentication + management + exceptions diff --git a/docs/source/v3.management.rst b/docs/source/management.rst similarity index 71% rename from docs/source/v3.management.rst rename to docs/source/management.rst index ea87dd33..e928f008 100644 --- a/docs/source/v3.management.rst +++ b/docs/source/management.rst @@ -4,7 +4,7 @@ management package management.auth0 module -------------------------- -.. automodule:: auth0.v3.management.auth0 +.. automodule:: auth0.management.auth0 :members: :undoc-members: :show-inheritance: @@ -12,7 +12,7 @@ management.auth0 module management.blacklists module ------------------------------- -.. automodule:: auth0.v3.management.blacklists +.. automodule:: auth0.management.blacklists :members: :undoc-members: :show-inheritance: @@ -20,7 +20,7 @@ management.blacklists module management.branding module ------------------------------- -.. automodule:: auth0.v3.management.branding +.. automodule:: auth0.management.branding :members: :undoc-members: :show-inheritance: @@ -28,7 +28,7 @@ management.branding module management.client\_grants module ----------------------------------- -.. automodule:: auth0.v3.management.client_grants +.. automodule:: auth0.management.client_grants :members: :undoc-members: :show-inheritance: @@ -36,7 +36,7 @@ management.client\_grants module management.clients module ---------------------------- -.. automodule:: auth0.v3.management.clients +.. automodule:: auth0.management.clients :members: :undoc-members: :show-inheritance: @@ -44,7 +44,7 @@ management.clients module management.connections module -------------------------------- -.. automodule:: auth0.v3.management.connections +.. automodule:: auth0.management.connections :members: :undoc-members: :show-inheritance: @@ -52,7 +52,7 @@ management.connections module management.custom\_domains module ------------------------------------ -.. automodule:: auth0.v3.management.custom_domains +.. automodule:: auth0.management.custom_domains :members: :undoc-members: :show-inheritance: @@ -60,7 +60,7 @@ management.custom\_domains module management.device\_credentials module ---------------------------------------- -.. automodule:: auth0.v3.management.device_credentials +.. automodule:: auth0.management.device_credentials :members: :undoc-members: :show-inheritance: @@ -68,7 +68,7 @@ management.device\_credentials module management.email\_templates module ------------------------------------- -.. automodule:: auth0.v3.management.email_templates +.. automodule:: auth0.management.email_templates :members: :undoc-members: :show-inheritance: @@ -76,7 +76,7 @@ management.email\_templates module management.emails module --------------------------- -.. automodule:: auth0.v3.management.emails +.. automodule:: auth0.management.emails :members: :undoc-members: :show-inheritance: @@ -84,7 +84,7 @@ management.emails module management.grants module --------------------------- -.. automodule:: auth0.v3.management.grants +.. automodule:: auth0.management.grants :members: :undoc-members: :show-inheritance: @@ -92,7 +92,7 @@ management.grants module management.guardian module ----------------------------- -.. automodule:: auth0.v3.management.guardian +.. automodule:: auth0.management.guardian :members: :undoc-members: :show-inheritance: @@ -100,7 +100,7 @@ management.guardian module management.hooks module -------------------------- -.. automodule:: auth0.v3.management.hooks +.. automodule:: auth0.management.hooks :members: :undoc-members: :show-inheritance: @@ -108,7 +108,7 @@ management.hooks module management.jobs module ------------------------- -.. automodule:: auth0.v3.management.jobs +.. automodule:: auth0.management.jobs :members: :undoc-members: :show-inheritance: @@ -116,7 +116,7 @@ management.jobs module management.log\_streams module --------------------------------- -.. automodule:: auth0.v3.management.log_streams +.. automodule:: auth0.management.log_streams :members: :undoc-members: :show-inheritance: @@ -124,7 +124,7 @@ management.log\_streams module management.logs module ------------------------- -.. automodule:: auth0.v3.management.logs +.. automodule:: auth0.management.logs :members: :undoc-members: :show-inheritance: @@ -132,7 +132,7 @@ management.logs module management.organizations module ---------------------------------- -.. automodule:: auth0.v3.management.organizations +.. automodule:: auth0.management.organizations :members: :undoc-members: :show-inheritance: @@ -140,7 +140,7 @@ management.organizations module management.prompts module ---------------------------------- -.. automodule:: auth0.v3.management.prompts +.. automodule:: auth0.management.prompts :members: :undoc-members: :show-inheritance: @@ -148,7 +148,7 @@ management.prompts module management.resource\_servers module -------------------------------------- -.. automodule:: auth0.v3.management.resource_servers +.. automodule:: auth0.management.resource_servers :members: :undoc-members: :show-inheritance: @@ -156,7 +156,7 @@ management.resource\_servers module management.roles module -------------------------- -.. automodule:: auth0.v3.management.roles +.. automodule:: auth0.management.roles :members: :undoc-members: :show-inheritance: @@ -164,7 +164,7 @@ management.roles module management.rules\_configs module ----------------------------------- -.. automodule:: auth0.v3.management.rules_configs +.. automodule:: auth0.management.rules_configs :members: :undoc-members: :show-inheritance: @@ -172,7 +172,7 @@ management.rules\_configs module management.rules module -------------------------- -.. automodule:: auth0.v3.management.rules +.. automodule:: auth0.management.rules :members: :undoc-members: :show-inheritance: @@ -180,7 +180,7 @@ management.rules module management.stats module -------------------------- -.. automodule:: auth0.v3.management.stats +.. automodule:: auth0.management.stats :members: :undoc-members: :show-inheritance: @@ -188,7 +188,7 @@ management.stats module management.tenants module ---------------------------- -.. automodule:: auth0.v3.management.tenants +.. automodule:: auth0.management.tenants :members: :undoc-members: :show-inheritance: @@ -196,7 +196,7 @@ management.tenants module management.tickets module ---------------------------- -.. automodule:: auth0.v3.management.tickets +.. automodule:: auth0.management.tickets :members: :undoc-members: :show-inheritance: @@ -204,7 +204,7 @@ management.tickets module management.user\_blocks module --------------------------------- -.. automodule:: auth0.v3.management.user_blocks +.. automodule:: auth0.management.user_blocks :members: :undoc-members: :show-inheritance: @@ -212,7 +212,7 @@ management.user\_blocks module management.users\_by\_email module ------------------------------------- -.. automodule:: auth0.v3.management.users_by_email +.. automodule:: auth0.management.users_by_email :members: :undoc-members: :show-inheritance: @@ -220,7 +220,7 @@ management.users\_by\_email module management.users module -------------------------- -.. automodule:: auth0.v3.management.users +.. automodule:: auth0.management.users :members: :undoc-members: :show-inheritance: