From 6610620881fb52d0052c67d0fed8769011ce4ff9 Mon Sep 17 00:00:00 2001 From: David Gilman Date: Fri, 4 Apr 2025 17:26:35 -0700 Subject: [PATCH 1/3] [auth0-python] Add async functions to AsyncAuth0 Update AsyncAuth0 type hints --- .../@tests/stubtest_allowlist.txt | 1 + .../auth0/management/async_auth0.pyi | 64 +++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/stubs/auth0-python/@tests/stubtest_allowlist.txt b/stubs/auth0-python/@tests/stubtest_allowlist.txt index 374bc1d561b6..5ed0ed78acd4 100644 --- a/stubs/auth0-python/@tests/stubtest_allowlist.txt +++ b/stubs/auth0-python/@tests/stubtest_allowlist.txt @@ -5,6 +5,7 @@ auth0\.test.* # The way these stubs are currently implemented is that we pretend all classes have async methods # Even though in reality, users need to call `auth0.asyncify.asyncify` to generate async subclasses auth0\..*_async +auth0\.management\.async_auth0\..* # Inconsistently implemented, ommitted auth0\.management\.Auth0\..* diff --git a/stubs/auth0-python/auth0/management/async_auth0.pyi b/stubs/auth0-python/auth0/management/async_auth0.pyi index 5af87901a440..d6c7228b0790 100644 --- a/stubs/auth0-python/auth0/management/async_auth0.pyi +++ b/stubs/auth0-python/auth0/management/async_auth0.pyi @@ -3,6 +3,37 @@ from typing_extensions import Self from auth0.rest import RestClientOptions +from .actions import Actions +from .attack_protection import AttackProtection +from .blacklists import Blacklists +from .branding import Branding +from .client_credentials import ClientCredentials +from .client_grants import ClientGrants +from .clients import Clients +from .connections import Connections +from .custom_domains import CustomDomains +from .device_credentials import DeviceCredentials +from .email_templates import EmailTemplates +from .emails import Emails +from .grants import Grants +from .guardian import Guardian +from .hooks import Hooks +from .jobs import Jobs +from .log_streams import LogStreams +from .logs import Logs +from .organizations import Organizations +from .prompts import Prompts +from .resource_servers import ResourceServers +from .roles import Roles +from .rules import Rules +from .rules_configs import RulesConfigs +from .stats import Stats +from .tenants import Tenants +from .tickets import Tickets +from .user_blocks import UserBlocks +from .users import Users +from .users_by_email import UsersByEmail + class AsyncAuth0: def __init__(self, domain: str, token: str, rest_options: RestClientOptions | None = None) -> None: ... def set_session(self, session) -> None: ... @@ -10,3 +41,36 @@ class AsyncAuth0: async def __aexit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... + + # Same attributes as Auth0 + # See note in stubs/auth0-python/@tests/stubtest_allowlist.txt about _async methods + actions: Actions + attack_protection: AttackProtection + blacklists: Blacklists + branding: Branding + client_credentials: ClientCredentials + client_grants: ClientGrants + clients: Clients + connections: Connections + custom_domains: CustomDomains + device_credentials: DeviceCredentials + email_templates: EmailTemplates + emails: Emails + grants: Grants + guardian: Guardian + hooks: Hooks + jobs: Jobs + log_streams: LogStreams + logs: Logs + organizations: Organizations + prompts: Prompts + resource_servers: ResourceServers + roles: Roles + rules_configs: RulesConfigs + rules: Rules + stats: Stats + tenants: Tenants + tickets: Tickets + user_blocks: UserBlocks + users_by_email: UsersByEmail + users: Users From e5256b1cae37dd125a42e2a3ff0d8bcc2737f847 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 23:15:56 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/auth0-python/auth0/management/async_auth0.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/auth0-python/auth0/management/async_auth0.pyi b/stubs/auth0-python/auth0/management/async_auth0.pyi index d6c7228b0790..f73b2a97fbd7 100644 --- a/stubs/auth0-python/auth0/management/async_auth0.pyi +++ b/stubs/auth0-python/auth0/management/async_auth0.pyi @@ -42,7 +42,7 @@ class AsyncAuth0: self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... - # Same attributes as Auth0 + # Same attributes as Auth0 # See note in stubs/auth0-python/@tests/stubtest_allowlist.txt about _async methods actions: Actions attack_protection: AttackProtection From 82cb924f220597914214b3cd0e2b8d00ea68e54d Mon Sep 17 00:00:00 2001 From: David Gilman Date: Thu, 17 Apr 2025 16:17:46 -0700 Subject: [PATCH 3/3] Cleanup stubtest_allowlist.txt --- stubs/auth0-python/@tests/stubtest_allowlist.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/stubs/auth0-python/@tests/stubtest_allowlist.txt b/stubs/auth0-python/@tests/stubtest_allowlist.txt index 5ed0ed78acd4..374bc1d561b6 100644 --- a/stubs/auth0-python/@tests/stubtest_allowlist.txt +++ b/stubs/auth0-python/@tests/stubtest_allowlist.txt @@ -5,7 +5,6 @@ auth0\.test.* # The way these stubs are currently implemented is that we pretend all classes have async methods # Even though in reality, users need to call `auth0.asyncify.asyncify` to generate async subclasses auth0\..*_async -auth0\.management\.async_auth0\..* # Inconsistently implemented, ommitted auth0\.management\.Auth0\..*