Skip to content

Commit 4abd604

Browse files
Upgrade Python and FastAPI versions (GH-55)
2 parents 79e0455 + d7fd942 commit 4abd604

File tree

7 files changed

+19
-5
lines changed

7 files changed

+19
-5
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ jobs:
3939
- python: "3.11"
4040
env: py311-fastapi100
4141

42+
- python: "3.10"
43+
env: py310-fastapi130
44+
- python: "3.11"
45+
env: py311-fastapi130
46+
- python: "3.12"
47+
env: py312-fastapi130
48+
- python: "3.13"
49+
env: py313-fastapi130
50+
4251
steps:
4352
- uses: actions/checkout@v2
4453
- name: Set up Python ${{ matrix.python }}

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ classifiers =
3636
Programming Language :: Python :: 3.9
3737
Programming Language :: Python :: 3.10
3838
Programming Language :: Python :: 3.11
39+
Programming Language :: Python :: 3.12
40+
Programming Language :: Python :: 3.13
3941
License :: OSI Approved :: MIT License
4042

4143
[options]

src/fastapi_oauth2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.3.0"
1+
__version__ = "1.4.0"

tests/test_backends.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ async def test_core_init_with_all_backends(backends):
1919
client_secret="test_client_secret",
2020
))
2121
except (NotImplementedError, Exception):
22-
assert False
22+
from social_core.backends.auth0_openidconnect import Auth0OpenIdConnectAuth
23+
assert backend is Auth0OpenIdConnectAuth # oidctest.wsweet.org doesn't support auth0

tests/test_middleware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
async def test_middleware_on_authentication(get_app):
99
async with AsyncClient(app=get_app(), base_url="http://test") as client:
1010
response = await client.get("/user")
11-
assert response.status_code == 403 # Forbidden
11+
assert response.status_code in (401, 403) # Unauthorized or Forbidden
1212

1313
await client.get("/auth") # Simulate login
1414

@@ -27,7 +27,7 @@ async def test_middleware_on_logout(get_app):
2727
await client.get("/oauth2/logout") # Perform logout
2828

2929
response = await client.get("/user")
30-
assert response.status_code == 403 # Forbidden
30+
assert response.status_code in (401, 403) # Unauthorized or Forbidden
3131

3232

3333
@pytest.mark.anyio

tests/test_oauth2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
async def oauth2_workflow(get_app, idp=False, ssr=True, authorize_query="", token_query="", use_header=False):
1212
async with AsyncClient(app=get_app(with_idp=idp, with_ssr=ssr), base_url="http://test") as client:
1313
response = await client.get("/user")
14-
assert response.status_code == 403 # Forbidden
14+
assert response.status_code in (401, 403) # Unauthorized or Forbidden
1515

1616
response = await client.get("/oauth2/test/authorize" + authorize_query) # Get authorization endpoint
1717
authorization_endpoint = response.headers.get("location") if ssr else response.json().get("url")

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
envlist =
33
py{37,38,310,311}-fastapi68
44
py{37,39,310,311}-fastapi{84,100}
5+
py{310,311,312,313}-fastapi130
56

67
[testenv]
78
deps =
9+
fastapi130: fastapi>=0.130.0
810
fastapi100: fastapi>=0.100.0
911
fastapi84: fastapi<=0.84.0
1012
fastapi68: fastapi<=0.68.1

0 commit comments

Comments
 (0)