Skip to content

Commit 1425262

Browse files
authored
Prepare for the release (#15)
1 parent df2fe67 commit 1425262

File tree

5 files changed

+12
-39
lines changed

5 files changed

+12
-39
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repos:
66
- id: check-toml
77

88
- repo: https://github.com/charliermarsh/ruff-pre-commit
9-
rev: v0.9.9
9+
rev: v0.11.4
1010
hooks:
1111
- id: ruff
1212
args:
@@ -15,6 +15,6 @@ repos:
1515
- id: ruff-format
1616

1717
- repo: https://github.com/pdm-project/pdm
18-
rev: 2.22.3
18+
rev: 2.23.0
1919
hooks:
2020
- id: pdm-lock-check

fastapi_oauth20/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
from .clients.oschina import OSChinaOAuth20 as OSChinaOAuth20
99
from .integrations.fastapi import FastAPIOAuth20 as FastAPIOAuth20
1010

11-
__version__ = '0.0.1a2'
11+
__version__ = '0.0.1'

fastapi_oauth20/integrations/fastapi.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,23 @@ class FastAPIOAuth20:
2828
def __init__(
2929
self,
3030
client: OAuth20Base,
31+
*,
3132
redirect_uri: str | None = None,
32-
oauth2_callback_route_name: str | None = None,
33+
redirect_route_name: str | None = None,
3334
):
3435
"""
3536
OAuth2 authorization callback dependency injection
3637
3738
:param client: A client base on OAuth20Base.
3839
:param redirect_uri: OAuth2 callback full URL.
39-
:param oauth2_callback_route_name: OAuth2 callback route name, as defined by the route decorator 'name' parameter.
40+
:param redirect_route_name: OAuth2 callback route name, as defined by the route decorator 'name' parameter.
4041
"""
41-
assert (redirect_uri is None and oauth2_callback_route_name is not None) or (
42-
redirect_uri is not None and oauth2_callback_route_name is None
42+
assert (redirect_uri is None and redirect_route_name is not None) or (
43+
redirect_uri is not None and redirect_route_name is None
4344
), 'FastAPIOAuth20 redirect_uri and oauth2_callback_route_name cannot be defined at the same time.'
4445
self.client = client
4546
self.redirect_uri = redirect_uri
46-
self.oauth2_callback_route_name = oauth2_callback_route_name
47+
self.redirect_route_name = redirect_route_name
4748

4849
async def __call__(
4950
self,
@@ -59,8 +60,8 @@ async def __call__(
5960
detail=error if error is not None else None,
6061
)
6162

62-
if self.oauth2_callback_route_name:
63-
redirect_url = str(request.url_for(self.oauth2_callback_route_name))
63+
if self.redirect_route_name:
64+
redirect_url = str(request.url_for(self.redirect_route_name))
6465
else:
6566
redirect_url = self.redirect_uri
6667

pdm.lock

Lines changed: 1 addition & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ dev = [
3737
"respx>=0.22.0",
3838
]
3939
lint = [
40-
"ruff>=0.9.9",
4140
"pre-commit>=4.1.0",
4241
]
4342

0 commit comments

Comments
 (0)