Skip to content

Commit 21ff792

Browse files
committed
[oauthlib] Annotate client keyword arguments
1 parent 866b546 commit 21ff792

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from typing_extensions import assert_type
2+
3+
from oauthlib.oauth2 import LegacyApplicationClient, OAuth2Token
4+
5+
client = LegacyApplicationClient("client-id")
6+
7+
assert_type(
8+
client.prepare_request_body(
9+
username="username", password="password", scope="read write", include_client_id=True, response_type="token"
10+
),
11+
str,
12+
)
13+
assert_type(client.parse_request_body_response('{"access_token": "token"}'), OAuth2Token)

stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class Client:
106106
**kwargs,
107107
): ...
108108
def parse_request_body_response(
109-
self, body: str, scope: str | set[object] | tuple[object] | list[object] | None = None, **kwargs
109+
self, body: str, scope: str | set[object] | tuple[object] | list[object] | None = None, **kwargs: object
110110
) -> OAuth2Token: ...
111111
def prepare_refresh_body(
112112
self,

stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/legacy_application.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ class LegacyApplicationClient(Client):
3838
client_secret: str | None = None,
3939
code: str | None = None,
4040
redirect_uri: str | None = None,
41-
**kwargs,
41+
**kwargs: object,
4242
) -> str: ...

0 commit comments

Comments
 (0)