From 3f0cc0cafddb5688b047b0f657c40d41bca8a3e5 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Tue, 14 Jun 2022 13:56:05 -0700 Subject: [PATCH 1/5] [stubsabot] Bump oauthlib to 3.2.* --- stubs/oauthlib/METADATA.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/oauthlib/METADATA.toml b/stubs/oauthlib/METADATA.toml index 84307529a94b..38c94680a9a8 100644 --- a/stubs/oauthlib/METADATA.toml +++ b/stubs/oauthlib/METADATA.toml @@ -1 +1 @@ -version = "3.1.*" +version = "3.2.*" From 0e0e2074a384fa6b8e259a8ed54518dda41b20d6 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Fri, 17 Jun 2022 22:03:51 -0700 Subject: [PATCH 2/5] add parameters to Client.__init__ --- stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi index 1000f338ff7e..7a9b825fd0df 100644 --- a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi +++ b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi @@ -21,6 +21,9 @@ class Client: redirect_url: Any code: Any expires_in: Any + code_verifier: str + code_challenge: str + code_challenge_method: str def __init__( self, client_id, @@ -35,6 +38,9 @@ class Client: state: Any | None = ..., redirect_url: Any | None = ..., state_generator=..., + code_verifier: str | None = ..., + code_challenge: str | None = ..., + code_challenge_method: str | None = ..., **kwargs, ) -> None: ... @property From 9328a9b4d2b52b0d1dcd7c05eeaf2683c3fbbc74 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Fri, 17 Jun 2022 22:09:05 -0700 Subject: [PATCH 3/5] more params --- .../oauth2/rfc6749/clients/web_application.pyi | 17 +++++++++++++++-- .../oauthlib/oauth2/rfc6749/parameters.pyi | 14 ++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/web_application.pyi b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/web_application.pyi index 054ab27c311b..68bf975ac3cc 100644 --- a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/web_application.pyi +++ b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/web_application.pyi @@ -7,9 +7,22 @@ class WebApplicationClient(Client): code: Any def __init__(self, client_id, code: Any | None = ..., **kwargs) -> None: ... def prepare_request_uri( # type: ignore[override] - self, uri, redirect_uri: Any | None = ..., scope: Any | None = ..., state: Any | None = ..., **kwargs + self, + uri, + redirect_uri: Any | None = ..., + scope: Any | None = ..., + state: Any | None = ..., + code_challenge: str | None = ..., + code_challenge_method: str | None = ..., + **kwargs, ): ... def prepare_request_body( # type: ignore[override] - self, code: Any | None = ..., redirect_uri: Any | None = ..., body: str = ..., include_client_id: bool = ..., **kwargs + self, + code: Any | None = ..., + redirect_uri: Any | None = ..., + body: str = ..., + include_client_id: bool = ..., + code_verifier: str | None = ..., + **kwargs, ): ... def parse_request_uri_response(self, uri, state: Any | None = ...): ... # type: ignore[override] diff --git a/stubs/oauthlib/oauthlib/oauth2/rfc6749/parameters.pyi b/stubs/oauthlib/oauthlib/oauth2/rfc6749/parameters.pyi index 2bc064f027a0..ddbec107edb3 100644 --- a/stubs/oauthlib/oauthlib/oauth2/rfc6749/parameters.pyi +++ b/stubs/oauthlib/oauthlib/oauth2/rfc6749/parameters.pyi @@ -1,9 +1,19 @@ from typing import Any def prepare_grant_uri( - uri, client_id, response_type, redirect_uri: Any | None = ..., scope: Any | None = ..., state: Any | None = ..., **kwargs + uri, + client_id, + response_type, + redirect_uri: Any | None = ..., + scope: Any | None = ..., + state: Any | None = ..., + code_challenge: str | None = ..., + code_challenge_method: str | None = ..., + **kwargs, +): ... +def prepare_token_request( + grant_type, body: str = ..., include_client_id: bool = ..., code_verifier: str | None = ..., **kwargs ): ... -def prepare_token_request(grant_type, body: str = ..., include_client_id: bool = ..., **kwargs): ... def prepare_token_revocation_request( url, token, token_type_hint: str = ..., callback: Any | None = ..., body: str = ..., **kwargs ): ... From f159061960b024aa80165cb932270553a7207415 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 18 Jun 2022 12:54:17 +0100 Subject: [PATCH 4/5] Add two new methods --- stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi index 7a9b825fd0df..3e2442592faa 100644 --- a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi +++ b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi @@ -77,5 +77,7 @@ class Client: ): ... def parse_request_body_response(self, body, scope: Any | None = ..., **kwargs): ... def prepare_refresh_body(self, body: str = ..., refresh_token: Any | None = ..., scope: Any | None = ..., **kwargs): ... + def create_code_verifier(self, length: int) -> str: ... + def create_code_challenge(self, code_verifier: str, code_challenge_method: str | None = ...) -> str: def populate_code_attributes(self, response) -> None: ... def populate_token_attributes(self, response) -> None: ... From 76215d9a3f14a931c4ca71273141e34d1ee17a2e Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 18 Jun 2022 12:55:56 +0100 Subject: [PATCH 5/5] oops --- stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi index 3e2442592faa..7ccbc66bfa17 100644 --- a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi +++ b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/base.pyi @@ -78,6 +78,6 @@ class Client: def parse_request_body_response(self, body, scope: Any | None = ..., **kwargs): ... def prepare_refresh_body(self, body: str = ..., refresh_token: Any | None = ..., scope: Any | None = ..., **kwargs): ... def create_code_verifier(self, length: int) -> str: ... - def create_code_challenge(self, code_verifier: str, code_challenge_method: str | None = ...) -> str: + def create_code_challenge(self, code_verifier: str, code_challenge_method: str | None = ...) -> str: ... def populate_code_attributes(self, response) -> None: ... def populate_token_attributes(self, response) -> None: ...