Skip to content

Commit

Permalink
Resolve typo and change to Literal
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Talpey authored and frankie567 committed Feb 6, 2024
1 parent 3ae5c65 commit 33d9ec7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/oauth2.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Returns the authorization URL where you should redirect the user to ask for thei
* `state: str = None`: Optional string that will be returned back in the callback parameters to allow you to retrieve state information.
* `scope: Optional[List[str]] = None`: Optional list of scopes to ask for.
* `code_challenge: Optional[str] = None`: Optional code_challenge in a [PKCE context](https://datatracker.ietf.org/doc/html/rfc7636).
* `code_challenge_method: ptional[str] = None`: Optional code_challenge_method in a [PKCE context](https://datatracker.ietf.org/doc/html/rfc7636).
* `code_challenge_method: Optional[Literal["plain", "S256"]] = None`: Optional code_challenge_method in a [PKCE context](https://datatracker.ietf.org/doc/html/rfc7636).
* `extras_params: Optional[Dict[str, Any]] = None`: Optional dictionary containing parameters specific to the service.

!!! example
Expand Down
4 changes: 3 additions & 1 deletion httpx_oauth/clients/franceconnect.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import secrets
from typing import Any, Dict, List, Optional, Tuple, TypedDict
from typing import Any, Dict, List, Literal, Optional, Tuple, TypedDict

from httpx_oauth.errors import GetIdEmailError
from httpx_oauth.oauth2 import BaseOAuth2
Expand Down Expand Up @@ -58,6 +58,8 @@ async def get_authorization_url(
redirect_uri: str,
state: Optional[str] = None,
scope: Optional[List[str]] = None,
code_challenge: Optional[str] = None,
code_challenge_method: Optional[Literal["plain", "S256"]] = None,
extras_params: Optional[FranceConnectOAuth2AuthorizeParams] = None,
) -> str:
_extras_params = extras_params or {}
Expand Down
3 changes: 2 additions & 1 deletion httpx_oauth/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Dict,
Generic,
List,
Literal,
Optional,
Tuple,
TypeVar,
Expand Down Expand Up @@ -101,7 +102,7 @@ async def get_authorization_url(
state: Optional[str] = None,
scope: Optional[List[str]] = None,
code_challenge: Optional[str] = None,
code_challenge_method: Optional[str] = None,
code_challenge_method: Optional[Literal["plain", "S256"]] = None,
extras_params: Optional[T] = None,
) -> str:
params = {
Expand Down

0 comments on commit 33d9ec7

Please sign in to comment.