From 19b93e35d7849f7e0cd82dc2d1e39c9c2777de4f Mon Sep 17 00:00:00 2001 From: Levi Roth Date: Sat, 13 Feb 2021 13:57:15 -0600 Subject: [PATCH 1/2] Add note about valid authorize_url.state param Per RFC6749, this parameter must be in the ASCII range 0x20-0x7E.[^1] Empirically, Reddit's response will not be usable if this rule is not followed. [1]: https://tools.ietf.org/html/rfc6749#appendix-A.5 (cherry picked from commit 35f9c9de777e53b0cddfc507414d3981b7c03fef) --- asyncprawcore/auth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/asyncprawcore/auth.py b/asyncprawcore/auth.py index d13eaa9..dc50746 100644 --- a/asyncprawcore/auth.py +++ b/asyncprawcore/auth.py @@ -51,7 +51,8 @@ def authorize_url(self, duration, scopes, state, implicit=False): is set to ``True``. :param scopes: A list of OAuth scopes to request authorization for. :param state: A string that will be reflected in the callback to - ``redirect_uri``. This value should be temporarily unique to the + ``redirect_uri``. Elements must be printable ASCII characters in the range + 0x20 through 0x7E inclusive. This value should be temporarily unique to the client for whom the URL was generated for. :param implicit: (optional) Use the implicit grant flow (default: False). This flow is only available for UntrustedAuthenticators. From 96fe4be3ad918d17661975a1a5ec1c910d9d2374 Mon Sep 17 00:00:00 2001 From: Levi Roth Date: Sun, 14 Feb 2021 12:08:23 -0600 Subject: [PATCH 2/2] Tiny doc grammar fix: remove redundant "for" (cherry picked from commit 6faeb3f943b44296418c7b38072fa655114043f0) --- asyncprawcore/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncprawcore/auth.py b/asyncprawcore/auth.py index dc50746..70d23f3 100644 --- a/asyncprawcore/auth.py +++ b/asyncprawcore/auth.py @@ -53,7 +53,7 @@ def authorize_url(self, duration, scopes, state, implicit=False): :param state: A string that will be reflected in the callback to ``redirect_uri``. Elements must be printable ASCII characters in the range 0x20 through 0x7E inclusive. This value should be temporarily unique to the - client for whom the URL was generated for. + client for whom the URL was generated. :param implicit: (optional) Use the implicit grant flow (default: False). This flow is only available for UntrustedAuthenticators.