fastapi 0.115.6__py3-none-any.whl → 0.115.8__py3-none-any.whl

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.

Potentially problematic release.


This version of fastapi might be problematic. Click here for more details.

fastapi/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
2
2
 
3
- __version__ = "0.115.6"
3
+ __version__ = "0.115.8"
4
4
 
5
5
  from starlette import status as status
6
6
 
@@ -9,7 +9,15 @@ from typing_extensions import Annotated, Doc
9
9
 
10
10
 
11
11
  class APIKeyBase(SecurityBase):
12
- pass
12
+ @staticmethod
13
+ def check_api_key(api_key: Optional[str], auto_error: bool) -> Optional[str]:
14
+ if not api_key:
15
+ if auto_error:
16
+ raise HTTPException(
17
+ status_code=HTTP_403_FORBIDDEN, detail="Not authenticated"
18
+ )
19
+ return None
20
+ return api_key
13
21
 
14
22
 
15
23
  class APIKeyQuery(APIKeyBase):
@@ -101,14 +109,7 @@ class APIKeyQuery(APIKeyBase):
101
109
 
102
110
  async def __call__(self, request: Request) -> Optional[str]:
103
111
  api_key = request.query_params.get(self.model.name)
104
- if not api_key:
105
- if self.auto_error:
106
- raise HTTPException(
107
- status_code=HTTP_403_FORBIDDEN, detail="Not authenticated"
108
- )
109
- else:
110
- return None
111
- return api_key
112
+ return self.check_api_key(api_key, self.auto_error)
112
113
 
113
114
 
114
115
  class APIKeyHeader(APIKeyBase):
@@ -196,14 +197,7 @@ class APIKeyHeader(APIKeyBase):
196
197
 
197
198
  async def __call__(self, request: Request) -> Optional[str]:
198
199
  api_key = request.headers.get(self.model.name)
199
- if not api_key:
200
- if self.auto_error:
201
- raise HTTPException(
202
- status_code=HTTP_403_FORBIDDEN, detail="Not authenticated"
203
- )
204
- else:
205
- return None
206
- return api_key
200
+ return self.check_api_key(api_key, self.auto_error)
207
201
 
208
202
 
209
203
  class APIKeyCookie(APIKeyBase):
@@ -291,11 +285,4 @@ class APIKeyCookie(APIKeyBase):
291
285
 
292
286
  async def __call__(self, request: Request) -> Optional[str]:
293
287
  api_key = request.cookies.get(self.model.name)
294
- if not api_key:
295
- if self.auto_error:
296
- raise HTTPException(
297
- status_code=HTTP_403_FORBIDDEN, detail="Not authenticated"
298
- )
299
- else:
300
- return None
301
- return api_key
288
+ return self.check_api_key(api_key, self.auto_error)
@@ -63,7 +63,7 @@ class OAuth2PasswordRequestForm:
63
63
  *,
64
64
  grant_type: Annotated[
65
65
  Union[str, None],
66
- Form(pattern="password"),
66
+ Form(pattern="^password$"),
67
67
  Doc(
68
68
  """
69
69
  The OAuth2 spec says it is required and MUST be the fixed string
@@ -217,7 +217,7 @@ class OAuth2PasswordRequestFormStrict(OAuth2PasswordRequestForm):
217
217
  self,
218
218
  grant_type: Annotated[
219
219
  str,
220
- Form(pattern="password"),
220
+ Form(pattern="^password$"),
221
221
  Doc(
222
222
  """
223
223
  The OAuth2 spec says it is required and MUST be the fixed string
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastapi
3
- Version: 0.115.6
3
+ Version: 0.115.8
4
4
  Summary: FastAPI framework, high performance, easy to learn, fast to code, ready for production
5
5
  Author-Email: =?utf-8?q?Sebasti=C3=A1n_Ram=C3=ADrez?= <tiangolo@gmail.com>
6
6
  Classifier: Intended Audience :: Information Technology
@@ -20,6 +20,7 @@ Classifier: Framework :: AsyncIO
20
20
  Classifier: Framework :: FastAPI
21
21
  Classifier: Framework :: Pydantic
22
22
  Classifier: Framework :: Pydantic :: 1
23
+ Classifier: Framework :: Pydantic :: 2
23
24
  Classifier: Intended Audience :: Developers
24
25
  Classifier: License :: OSI Approved :: MIT License
25
26
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -28,6 +29,7 @@ Classifier: Programming Language :: Python :: 3.9
28
29
  Classifier: Programming Language :: Python :: 3.10
29
30
  Classifier: Programming Language :: Python :: 3.11
30
31
  Classifier: Programming Language :: Python :: 3.12
32
+ Classifier: Programming Language :: Python :: 3.13
31
33
  Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
32
34
  Classifier: Topic :: Internet :: WWW/HTTP
33
35
  Project-URL: Homepage, https://github.com/fastapi/fastapi
@@ -36,21 +38,21 @@ Project-URL: Repository, https://github.com/fastapi/fastapi
36
38
  Project-URL: Issues, https://github.com/fastapi/fastapi/issues
37
39
  Project-URL: Changelog, https://fastapi.tiangolo.com/release-notes/
38
40
  Requires-Python: >=3.8
39
- Requires-Dist: starlette<0.42.0,>=0.40.0
41
+ Requires-Dist: starlette<0.46.0,>=0.40.0
40
42
  Requires-Dist: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4
41
43
  Requires-Dist: typing-extensions>=4.8.0
42
44
  Provides-Extra: standard
43
45
  Requires-Dist: fastapi-cli[standard]>=0.0.5; extra == "standard"
44
46
  Requires-Dist: httpx>=0.23.0; extra == "standard"
45
- Requires-Dist: jinja2>=2.11.2; extra == "standard"
46
- Requires-Dist: python-multipart>=0.0.7; extra == "standard"
47
+ Requires-Dist: jinja2>=3.1.5; extra == "standard"
48
+ Requires-Dist: python-multipart>=0.0.18; extra == "standard"
47
49
  Requires-Dist: email-validator>=2.0.0; extra == "standard"
48
50
  Requires-Dist: uvicorn[standard]>=0.12.0; extra == "standard"
49
51
  Provides-Extra: all
50
52
  Requires-Dist: fastapi-cli[standard]>=0.0.5; extra == "all"
51
53
  Requires-Dist: httpx>=0.23.0; extra == "all"
52
- Requires-Dist: jinja2>=2.11.2; extra == "all"
53
- Requires-Dist: python-multipart>=0.0.7; extra == "all"
54
+ Requires-Dist: jinja2>=3.1.5; extra == "all"
55
+ Requires-Dist: python-multipart>=0.0.18; extra == "all"
54
56
  Requires-Dist: itsdangerous>=1.1.0; extra == "all"
55
57
  Requires-Dist: pyyaml>=5.3.1; extra == "all"
56
58
  Requires-Dist: ujson!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,>=4.0.1; extra == "all"
@@ -109,7 +111,7 @@ The key features are:
109
111
 
110
112
  <!-- sponsors -->
111
113
 
112
- <a href="https://cryptapi.io/" target="_blank" title="CryptAPI: Your easy to use, secure and privacy oriented payment gateway."><img src="https://fastapi.tiangolo.com/img/sponsors/cryptapi.svg"></a>
114
+ <a href="https://blockbee.io?ref=fastapi" target="_blank" title="BlockBee Cryptocurrency Payment Gateway"><img src="https://fastapi.tiangolo.com/img/sponsors/blockbee.png"></a>
113
115
  <a href="https://platform.sh/try-it-now/?utm_source=fastapi-signup&utm_medium=banner&utm_campaign=FastAPI-signup-June-2023" target="_blank" title="Build, run and scale your apps on a modern, reliable, and secure PaaS."><img src="https://fastapi.tiangolo.com/img/sponsors/platform-sh.png"></a>
114
116
  <a href="https://www.porter.run" target="_blank" title="Deploy FastAPI on AWS with a few clicks"><img src="https://fastapi.tiangolo.com/img/sponsors/porter.png"></a>
115
117
  <a href="https://bump.sh/fastapi?utm_source=fastapi&utm_medium=referral&utm_campaign=sponsor" target="_blank" title="Automate FastAPI documentation generation with Bump.sh"><img src="https://fastapi.tiangolo.com/img/sponsors/bump-sh.svg"></a>
@@ -124,7 +126,6 @@ The key features are:
124
126
  <a href="https://databento.com/" target="_blank" title="Pay as you go for market data"><img src="https://fastapi.tiangolo.com/img/sponsors/databento.svg"></a>
125
127
  <a href="https://speakeasy.com?utm_source=fastapi+repo&utm_medium=github+sponsorship" target="_blank" title="SDKs for your API | Speakeasy"><img src="https://fastapi.tiangolo.com/img/sponsors/speakeasy.png"></a>
126
128
  <a href="https://www.svix.com/" target="_blank" title="Svix - Webhooks as a service"><img src="https://fastapi.tiangolo.com/img/sponsors/svix.svg"></a>
127
- <a href="https://www.codacy.com/?utm_source=github&utm_medium=sponsors&utm_id=pioneers" target="_blank" title="Take code reviews from hours to minutes"><img src="https://fastapi.tiangolo.com/img/sponsors/codacy.png"></a>
128
129
  <a href="https://www.stainlessapi.com/?utm_source=fastapi&utm_medium=referral" target="_blank" title="Stainless | Generate best-in-class SDKs"><img src="https://fastapi.tiangolo.com/img/sponsors/stainless.png"></a>
129
130
 
130
131
  <!-- /sponsors -->
@@ -522,7 +523,7 @@ FastAPI depends on Pydantic and Starlette.
522
523
 
523
524
  ### `standard` Dependencies
524
525
 
525
- When you install FastAPI with `pip install "fastapi[standard]"` it comes the `standard` group of optional dependencies:
526
+ When you install FastAPI with `pip install "fastapi[standard]"` it comes with the `standard` group of optional dependencies:
526
527
 
527
528
  Used by Pydantic:
528
529
 
@@ -1,8 +1,8 @@
1
- fastapi-0.115.6.dist-info/METADATA,sha256=hkiGasWTGPXPzJYtw94H6jEmzovXW1eQtyrAl3mLy18,27300
2
- fastapi-0.115.6.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- fastapi-0.115.6.dist-info/entry_points.txt,sha256=GCf-WbIZxyGT4MUmrPGj1cOHYZoGsNPHAvNkT6hnGeA,61
4
- fastapi-0.115.6.dist-info/licenses/LICENSE,sha256=Tsif_IFIW5f-xYSy1KlhAy7v_oNEU4lP2cEnSQbMdE4,1086
5
- fastapi/__init__.py,sha256=uCwGoex-Lb7tS-9FjZ8q035mrHVcjn_0yfCMPlq6BRI,1081
1
+ fastapi-0.115.8.dist-info/METADATA,sha256=4srjIseFlbNIV_5S9uJbfMX9VvUk21nJ_Hu0HnXMqe4,27152
2
+ fastapi-0.115.8.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ fastapi-0.115.8.dist-info/entry_points.txt,sha256=GCf-WbIZxyGT4MUmrPGj1cOHYZoGsNPHAvNkT6hnGeA,61
4
+ fastapi-0.115.8.dist-info/licenses/LICENSE,sha256=Tsif_IFIW5f-xYSy1KlhAy7v_oNEU4lP2cEnSQbMdE4,1086
5
+ fastapi/__init__.py,sha256=_MYtqtXdcIyUpF2BUpb8Y-6UGaviGakeY05sV25X5DE,1081
6
6
  fastapi/__main__.py,sha256=bKePXLdO4SsVSM6r9SVoLickJDcR2c0cTOxZRKq26YQ,37
7
7
  fastapi/_compat.py,sha256=Rg7kA7uue4Z6yr8T7hf8b7G6PeC_06mK004Nnykijfk,23953
8
8
  fastapi/applications.py,sha256=Ix-o9pQAWhEDf9J0Q1hZ0nBB1uP72c-Y3oiYzvrwqiM,176316
@@ -35,10 +35,10 @@ fastapi/requests.py,sha256=zayepKFcienBllv3snmWI20Gk0oHNVLU4DDhqXBb4LU,142
35
35
  fastapi/responses.py,sha256=QNQQlwpKhQoIPZTTWkpc9d_QGeGZ_aVQPaDV3nQ8m7c,1761
36
36
  fastapi/routing.py,sha256=WK06IwZeyRwxkdB4uHZ7JXinxtVOxM8Ke0tqHaDOvYA,176208
37
37
  fastapi/security/__init__.py,sha256=bO8pNmxqVRXUjfl2mOKiVZLn0FpBQ61VUYVjmppnbJw,881
38
- fastapi/security/api_key.py,sha256=_OqUUjEHG5_MT1IPAhXIGJRCPldTBdSww_DegFy_W8Y,9368
38
+ fastapi/security/api_key.py,sha256=cBI5Z4zWVjL1uJrsjTeLy7MafHPAO2HQPzTrpyoIYWA,9094
39
39
  fastapi/security/base.py,sha256=dl4pvbC-RxjfbWgPtCWd8MVU-7CB2SZ22rJDXVCXO6c,141
40
40
  fastapi/security/http.py,sha256=223bAV_d7NjI57Pzhbd_KlQTYlMyr5MoN1TW80rbxF8,13512
41
- fastapi/security/oauth2.py,sha256=BbXdQ_W2Pm5NIcpHGBSBa1u3t0EBLCgiYdOLfid1t4A,21585
41
+ fastapi/security/oauth2.py,sha256=xCo5j1qpze6CvEuJHIneOI0v2fodGVMpHHVnHpiLfoM,21589
42
42
  fastapi/security/open_id_connect_url.py,sha256=8vizZ2tGqEp1ur8SwtVgyHJhGAJ5AqahgcvSpaIioDI,2722
43
43
  fastapi/security/utils.py,sha256=bd8T0YM7UQD5ATKucr1bNtAvz_Y3__dVNAv5UebiPvc,293
44
44
  fastapi/staticfiles.py,sha256=iirGIt3sdY2QZXd36ijs3Cj-T0FuGFda3cd90kM9Ikw,69
@@ -47,4 +47,4 @@ fastapi/testclient.py,sha256=nBvaAmX66YldReJNZXPOk1sfuo2Q6hs8bOvIaCep6LQ,66
47
47
  fastapi/types.py,sha256=nFb36sK3DSoqoyo7Miwy3meKK5UdFBgkAgLSzQlUVyI,383
48
48
  fastapi/utils.py,sha256=y8Bj5ttMaI9tS4D60OUgXqKnktBr99NdYUnHHV9LgoY,7948
49
49
  fastapi/websockets.py,sha256=419uncYObEKZG0YcrXscfQQYLSWoE10jqxVMetGdR98,222
50
- fastapi-0.115.6.dist-info/RECORD,,
50
+ fastapi-0.115.8.dist-info/RECORD,,