arpakitlib 1.7.74__py3-none-any.whl → 1.7.76__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.
- arpakitlib/_arpakit_project_template/src/api/auth.py +2 -2
- arpakitlib/ar_fastapi_util.py +9 -12
- {arpakitlib-1.7.74.dist-info → arpakitlib-1.7.76.dist-info}/METADATA +1 -1
- {arpakitlib-1.7.74.dist-info → arpakitlib-1.7.76.dist-info}/RECORD +8 -8
- {arpakitlib-1.7.74.dist-info → arpakitlib-1.7.76.dist-info}/LICENSE +0 -0
- {arpakitlib-1.7.74.dist-info → arpakitlib-1.7.76.dist-info}/NOTICE +0 -0
- {arpakitlib-1.7.74.dist-info → arpakitlib-1.7.76.dist-info}/WHEEL +0 -0
- {arpakitlib-1.7.74.dist-info → arpakitlib-1.7.76.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
from arpakitlib.ar_fastapi_util import
|
1
|
+
from arpakitlib.ar_fastapi_util import api_key_api_auth
|
2
2
|
from src.core.settings import get_cached_settings
|
3
3
|
|
4
|
-
|
4
|
+
check_with_settings_api_key_api_auth = api_key_api_auth(
|
5
5
|
correct_api_key=get_cached_settings().api_correct_api_key
|
6
6
|
)
|
arpakitlib/ar_fastapi_util.py
CHANGED
@@ -560,7 +560,7 @@ class CheckAPIKeyAPIAuthData(BaseAPIAuthData):
|
|
560
560
|
is_api_key_correct: bool | None = None
|
561
561
|
|
562
562
|
|
563
|
-
def
|
563
|
+
def api_key_api_auth(
|
564
564
|
*,
|
565
565
|
validate_api_key_func: Callable | None = None,
|
566
566
|
correct_api_key: str | None = None
|
@@ -647,7 +647,7 @@ def create_fastapi_app(
|
|
647
647
|
title: str = "arpakitlib FastAPI",
|
648
648
|
description: str | None = "arpakitlib FastAPI",
|
649
649
|
log_filepath: str | None = "./story.log",
|
650
|
-
handle_exception_: Callable | None =
|
650
|
+
handle_exception_: Callable | None = None,
|
651
651
|
startup_api_events: list[BaseStartupAPIEvent | None] | None = None,
|
652
652
|
shutdown_api_events: list[BaseShutdownAPIEvent | None] | None = None,
|
653
653
|
transmitted_api_data: BaseTransmittedAPIData = BaseTransmittedAPIData(),
|
@@ -660,6 +660,9 @@ def create_fastapi_app(
|
|
660
660
|
|
661
661
|
setup_normal_logging(log_filepath=log_filepath)
|
662
662
|
|
663
|
+
if handle_exception_ is None:
|
664
|
+
handle_exception_ = create_handle_exception()
|
665
|
+
|
663
666
|
if contact is None:
|
664
667
|
contact = DEFAULT_CONTACT
|
665
668
|
|
@@ -698,16 +701,10 @@ def create_fastapi_app(
|
|
698
701
|
|
699
702
|
add_swagger_to_app(app=app)
|
700
703
|
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
)
|
706
|
-
else:
|
707
|
-
add_exception_handler_to_app(
|
708
|
-
app=app,
|
709
|
-
handle_exception=create_handle_exception()
|
710
|
-
)
|
704
|
+
add_exception_handler_to_app(
|
705
|
+
app=app,
|
706
|
+
handle_exception=handle_exception_
|
707
|
+
)
|
711
708
|
|
712
709
|
add_needed_api_router_to_app(app=app)
|
713
710
|
|
@@ -73,7 +73,7 @@ arpakitlib/_arpakit_project_template/src/additional_model/__init__.py,sha256=47D
|
|
73
73
|
arpakitlib/_arpakit_project_template/src/additional_model/additional_model.py,sha256=4KCOvto9Hj5eMYpvfaJChghhR9bkCvKluGGPWrTezoY,134
|
74
74
|
arpakitlib/_arpakit_project_template/src/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
75
75
|
arpakitlib/_arpakit_project_template/src/api/asgi.py,sha256=a5UBxOyNC8NG3E0ayhiDo3t5tPoB3WtOf2gbZJFWBAA,74
|
76
|
-
arpakitlib/_arpakit_project_template/src/api/auth.py,sha256=
|
76
|
+
arpakitlib/_arpakit_project_template/src/api/auth.py,sha256=onnmSwjtc0aX7y6X2GCqayKcZ85Besz0KoElctv-H-w,228
|
77
77
|
arpakitlib/_arpakit_project_template/src/api/const.py,sha256=7d4qD5hedqr7QxVzbfsA7E1bNZn2Pm2U8joXGtpANu0,287
|
78
78
|
arpakitlib/_arpakit_project_template/src/api/create_api_app.py,sha256=lDE77W6WkeAeRB_vJY3TXRTa3HeiO-t26eTtG7v8j6U,4594
|
79
79
|
arpakitlib/_arpakit_project_template/src/api/event.py,sha256=58wCVyVSIe_kydWi44M0Wvp7bTnV8xvO30gMXzjbFYc,750
|
@@ -148,7 +148,7 @@ arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css,sha256=jzPZlgJTFwSdSphk9C
|
|
148
148
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.css.map,sha256=5wq8eXMLU6Zxb45orZPL1zAsBFJReFw6GjYqGpUX3hg,262650
|
149
149
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js,sha256=ffrLZHHEQ_g84A-ul3yWa10Kk09waOAxHcQXPuZuavg,339292
|
150
150
|
arpakitlib/ar_fastapi_static/swagger-ui/swagger-ui.js.map,sha256=9UhIW7MqCOZPAz1Sl1IKfZUuhWU0p-LJqrnjjJD9Xhc,1159454
|
151
|
-
arpakitlib/ar_fastapi_util.py,sha256=
|
151
|
+
arpakitlib/ar_fastapi_util.py,sha256=9gUzWhtqBV8stxPmWQ76Btw8rzWGFoBjRwMofGWdyhQ,25258
|
152
152
|
arpakitlib/ar_file_storage_in_dir_util.py,sha256=D3e3rGuHoI6xqAA5mVvEpVVpOWY1jyjNsjj2UhyHRbE,3674
|
153
153
|
arpakitlib/ar_file_util.py,sha256=GUdJYm1tUZnYpY-SIPRHAZBHGra8NKy1eYEI0D5AfhY,489
|
154
154
|
arpakitlib/ar_hash_util.py,sha256=Iqy6KBAOLBQMFLWv676boI5sV7atT2B-fb7aCdHOmIQ,340
|
@@ -177,9 +177,9 @@ arpakitlib/ar_str_util.py,sha256=tFoGSDYoGpfdVHWor5Li9pEOFmDFlHkX-Z8iOy1LK7Y,353
|
|
177
177
|
arpakitlib/ar_type_util.py,sha256=46ZMuWls3uN0Re5T0sfEAmyNUDnxn9yvj6dHivSDZKs,3915
|
178
178
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=sh4fcUkAkdOetFn9JYoTvjcSXP-M1wU04KEY-ECLfLg,5137
|
179
179
|
arpakitlib/ar_zabbix_api_client_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
|
180
|
-
arpakitlib-1.7.
|
181
|
-
arpakitlib-1.7.
|
182
|
-
arpakitlib-1.7.
|
183
|
-
arpakitlib-1.7.
|
184
|
-
arpakitlib-1.7.
|
185
|
-
arpakitlib-1.7.
|
180
|
+
arpakitlib-1.7.76.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
181
|
+
arpakitlib-1.7.76.dist-info/METADATA,sha256=sat8Sj_1M9alTRio_zyVPE5uwkUufovTjH-aubogASI,2824
|
182
|
+
arpakitlib-1.7.76.dist-info/NOTICE,sha256=95aUzaPJjVpDsGAsNzVnq7tHTxAl0s5UFznCTkVCau4,763
|
183
|
+
arpakitlib-1.7.76.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
184
|
+
arpakitlib-1.7.76.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
185
|
+
arpakitlib-1.7.76.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|