fastapi-sso 0.18.0__tar.gz → 0.19.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/PKG-INFO +14 -2
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/README.md +10 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/base.py +10 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/pyproject.toml +8 -8
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/LICENSE.md +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/__init__.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/pkce.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/py.typed +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/__init__.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/bitbucket.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/discord.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/facebook.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/fitbit.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/generic.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/github.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/gitlab.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/google.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/kakao.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/line.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/linkedin.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/microsoft.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/naver.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/notion.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/seznam.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/spotify.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/twitter.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/sso/yandex.py +0 -0
- {fastapi_sso-0.18.0 → fastapi_sso-0.19.0}/fastapi_sso/state.py +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-sso
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.19.0
|
|
4
4
|
Summary: FastAPI plugin to enable SSO to most common providers (such as Facebook login, Google login and login via Microsoft Office 365 Account)
|
|
5
5
|
License: MIT
|
|
6
|
+
License-File: LICENSE.md
|
|
6
7
|
Keywords: fastapi,sso,oauth,google,facebook,spotify,linkedin
|
|
7
8
|
Author: Tomas Votava
|
|
8
9
|
Author-email: info@tomasvotava.eu
|
|
@@ -14,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
14
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
19
|
Requires-Dist: fastapi (>=0.80)
|
|
18
20
|
Requires-Dist: httpx (>=0.23.0)
|
|
19
21
|
Requires-Dist: oauthlib (>=3.1.0)
|
|
@@ -73,6 +75,16 @@ by [@parikls](https://github.com/parikls).
|
|
|
73
75
|
This issue was reported in [#186](https://github.com/tomasvotava/fastapi-sso/issues/186) and has been resolved
|
|
74
76
|
in version `0.16.0`.
|
|
75
77
|
|
|
78
|
+
### Version `0.19.0` Update: OAuth `state` Validation Fix
|
|
79
|
+
|
|
80
|
+
A critical OAuth login CSRF vulnerability caused by missing `state` validation was
|
|
81
|
+
reported by [@davidbors-snyk](https://github.com/davidbors-snyk) (Snyk Security Labs)
|
|
82
|
+
in [#266](https://github.com/tomasvotava/fastapi-sso/issues/266) and has been resolved
|
|
83
|
+
in version `0.19.0`.
|
|
84
|
+
|
|
85
|
+
Starting with `fastapi-sso==1.0.0`, OAuth `state` will be backed by a pluggable server-side store
|
|
86
|
+
(in-memory by default, with support for external stores such as `Redis`).
|
|
87
|
+
|
|
76
88
|
**Details of the Fix:**
|
|
77
89
|
|
|
78
90
|
The bug was mitigated by introducing an async lock mechanism that ensures only one user can attempt the login
|
|
@@ -46,6 +46,16 @@ by [@parikls](https://github.com/parikls).
|
|
|
46
46
|
This issue was reported in [#186](https://github.com/tomasvotava/fastapi-sso/issues/186) and has been resolved
|
|
47
47
|
in version `0.16.0`.
|
|
48
48
|
|
|
49
|
+
### Version `0.19.0` Update: OAuth `state` Validation Fix
|
|
50
|
+
|
|
51
|
+
A critical OAuth login CSRF vulnerability caused by missing `state` validation was
|
|
52
|
+
reported by [@davidbors-snyk](https://github.com/davidbors-snyk) (Snyk Security Labs)
|
|
53
|
+
in [#266](https://github.com/tomasvotava/fastapi-sso/issues/266) and has been resolved
|
|
54
|
+
in version `0.19.0`.
|
|
55
|
+
|
|
56
|
+
Starting with `fastapi-sso==1.0.0`, OAuth `state` will be backed by a pluggable server-side store
|
|
57
|
+
(in-memory by default, with support for external stores such as `Redis`).
|
|
58
|
+
|
|
49
59
|
**Details of the Fix:**
|
|
50
60
|
|
|
51
61
|
The bug was mitigated by introducing an async lock mechanism that ensures only one user can attempt the login
|
|
@@ -341,6 +341,8 @@ class SSOBase:
|
|
|
341
341
|
response = RedirectResponse(login_uri, 303)
|
|
342
342
|
if self.uses_pkce:
|
|
343
343
|
response.set_cookie("pkce_code_verifier", str(self._pkce_code_verifier))
|
|
344
|
+
if state is not None:
|
|
345
|
+
response.set_cookie("sso_state", state)
|
|
344
346
|
return response
|
|
345
347
|
|
|
346
348
|
@overload
|
|
@@ -402,6 +404,14 @@ class SSOBase:
|
|
|
402
404
|
)
|
|
403
405
|
raise SSOLoginError(400, "'code' parameter was not found in callback request")
|
|
404
406
|
self._state = request.query_params.get("state")
|
|
407
|
+
if self._state is None and self.requires_state:
|
|
408
|
+
raise SSOLoginError(400, "'state' parameter was not found in callback request")
|
|
409
|
+
if self._state is not None:
|
|
410
|
+
sso_state = request.cookies.get("sso_state")
|
|
411
|
+
if sso_state is None and self.requires_state:
|
|
412
|
+
raise SSOLoginError(401, "State cookie not found")
|
|
413
|
+
if sso_state is not None and sso_state != self._state:
|
|
414
|
+
raise SSOLoginError(401, "Invalid state")
|
|
405
415
|
pkce_code_verifier: Optional[str] = None
|
|
406
416
|
if self.uses_pkce:
|
|
407
417
|
pkce_code_verifier = request.cookies.get("pkce_code_verifier")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "fastapi-sso"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.19.0"
|
|
4
4
|
description = "FastAPI plugin to enable SSO to most common providers (such as Facebook login, Google login and login via Microsoft Office 365 Account)"
|
|
5
5
|
authors = ["Tomas Votava <info@tomasvotava.eu>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -92,18 +92,18 @@ docs = "mkdocs build --clean"
|
|
|
92
92
|
|
|
93
93
|
[tool.poetry.group.dev.dependencies]
|
|
94
94
|
black = ">=23.7.0"
|
|
95
|
-
isort = "
|
|
95
|
+
isort = ">=5,<7"
|
|
96
96
|
markdown-include = "^0.8.1"
|
|
97
97
|
mkdocs-material = { extras = ["imaging"], version = "^9.3.2" }
|
|
98
|
-
mkdocstrings = { extras = ["python"], version = ">=0.23,<0.
|
|
98
|
+
mkdocstrings = { extras = ["python"], version = ">=0.23,<0.31" }
|
|
99
99
|
mypy = "^1"
|
|
100
|
-
poethepoet = ">=0.21.1,<0.
|
|
101
|
-
pre-commit = "
|
|
100
|
+
poethepoet = ">=0.21.1,<0.38.0"
|
|
101
|
+
pre-commit = ">=3,<5"
|
|
102
102
|
pytest = ">=7,<9"
|
|
103
|
-
pytest-asyncio = "
|
|
104
|
-
pytest-cov = ">=4,<
|
|
103
|
+
pytest-asyncio = ">=0.24,<1.3"
|
|
104
|
+
pytest-cov = ">=4,<8"
|
|
105
105
|
uvicorn = ">=0.23.1"
|
|
106
|
-
ruff = ">=0.4.2,<0.
|
|
106
|
+
ruff = ">=0.4.2,<0.15.0"
|
|
107
107
|
|
|
108
108
|
[tool.poetry.dependencies]
|
|
109
109
|
fastapi = ">=0.80"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|