Skip to content

Commit 893eabe

Browse files
authored
auth0-python solve stubtest_allowlist entries (#13827)
1 parent 53811d3 commit 893eabe

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Omit tests
22
auth0\.test.*
33

4-
# Omit _async functions because they aren't present in the code
4+
# Omit _async functions because they aren't present at runtime
5+
# The way these stubs are currently implemented is that we pretend all classes have async methods
6+
# Even though in reality, users need to call `auth0.asyncify.asyncify` to generate async subclasses
57
auth0\..*_async
68

79
# Inconsistently implemented, ommitted
8-
auth0.management.Auth0\..*
9-
auth0.rest_async.AsyncRestClient.file_post
10-
auth0.authentication.async_token_verifier.AsyncTokenVerifier.verify
10+
auth0\.management\.Auth0\..*

stubs/auth0-python/auth0/authentication/async_token_verifier.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from _typeshed import Incomplete
2+
13
from .token_verifier import AsymmetricSignatureVerifier, JwksFetcher, TokenVerifier
24

35
class AsyncAsymmetricSignatureVerifier(AsymmetricSignatureVerifier):
@@ -17,3 +19,6 @@ class AsyncTokenVerifier(TokenVerifier):
1719
self, signature_verifier: AsyncAsymmetricSignatureVerifier, issuer: str, audience: str, leeway: int = 0
1820
) -> None: ...
1921
def set_session(self, session) -> None: ...
22+
async def verify( # type: ignore[override] # Differs from supertype
23+
self, token: str, nonce: str | None = None, max_age: int | None = None, organization: str | None = None
24+
) -> dict[str, Incomplete]: ...

stubs/auth0-python/auth0/rest_async.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ class AsyncRestClient(RestClient):
99
def set_session(self, session) -> None: ...
1010
async def get(self, url: str, params: dict[str, Incomplete] | None = None, headers: dict[str, str] | None = None): ...
1111
async def post(self, url: str, data: RequestData | None = None, headers: dict[str, str] | None = None): ...
12-
async def file_post(self, *args, **kwargs): ...
12+
async def file_post( # type: ignore[override] # Differs from supertype
13+
self, url: str, data: dict[str, Incomplete], files: dict[str, Incomplete]
14+
): ...
1315
async def patch(self, url: str, data: RequestData | None = None): ...
1416
async def put(self, url: str, data: RequestData | None = None): ...
1517
async def delete(self, url: str, params: dict[str, Incomplete] | None = None, data: RequestData | None = None): ...

0 commit comments

Comments
 (0)