kiba-core 0.5.3.dev46__tar.gz → 0.5.3.dev47__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.
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/PKG-INFO +1 -1
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/middleware/exception_handling_middleware.py +8 -2
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/kiba_core.egg-info/PKG-INFO +1 -1
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/pyproject.toml +1 -1
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/.github/pull_request_template.md +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/.github/workflows/deploy.yml +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/.github/workflows/pull-request.yml +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/.github/workflows/release.yml +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/.gitignore +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/CHANGELOG.md +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/Dockerfile +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/README.md +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/api_request.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/api_response.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/authorizer.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/default_routes.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/health.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/json_route.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/middleware/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/middleware/database_connection_middleware.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/middleware/logging_middleware.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/middleware/server_headers_middleware.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/streaming_json_route.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/aws_requester.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/caching/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/caching/cache.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/caching/dict_cache.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/caching/file_cache.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/exceptions.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/http/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/http/basic_authentication.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/http/jwt.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/http/rest_method.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/logging.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/notifications/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/notifications/discord_client.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/notifications/notification_client.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/notifications/slack_client.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/py.typed +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/queues/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/queues/aqs.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/queues/message_queue.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/queues/message_queue_processor.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/queues/model.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/queues/sqs.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/requester/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/requester/requester.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/s3_manager.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/service_client.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/store/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/store/database.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/store/retriever.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/store/saver.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/async_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/chain_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/date_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/dict_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/file_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/hashing_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/http_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/json_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/list_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/string_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/typing_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/url_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/util/value_holder.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/web3/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/web3/eth_client.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/web3/multicall3.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/kiba_core.egg-info/SOURCES.txt +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/kiba_core.egg-info/dependency_links.txt +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/kiba_core.egg-info/requires.txt +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/kiba_core.egg-info/top_level.txt +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/makefile +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/setup.cfg +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/api/test_json_route.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/api/test_streaming_json_route.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/caching/test_dict_cache.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/caching/test_file_cache.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/util/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/util/test_async_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/util/test_chain_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/util/test_date_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/util/test_dict_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/util/test_file_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/util/test_json_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/util/test_list_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/util/test_string_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/util/test_url_util.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/web3/__init__.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/tests/web3/test_rest_eth_client.py +0 -0
- {kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/uv.lock +0 -0
{kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/middleware/exception_handling_middleware.py
RENAMED
|
@@ -12,9 +12,10 @@ from core.exceptions import RedirectException
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class ExceptionHandlingMiddleware(BaseHTTPMiddleware):
|
|
15
|
-
def __init__(self, app: ASGIApp, shouldSquashClientExceptions: bool = True) -> None:
|
|
15
|
+
def __init__(self, app: ASGIApp, shouldSquashClientExceptions: bool = True, shouldHideInternalErrors: bool = True) -> None:
|
|
16
16
|
super().__init__(app=app)
|
|
17
17
|
self.shouldSquashClientExceptions = shouldSquashClientExceptions
|
|
18
|
+
self.shouldHideInternalErrors = shouldHideInternalErrors
|
|
18
19
|
|
|
19
20
|
@staticmethod
|
|
20
21
|
def _convert_exception(exception: KibaException) -> Response:
|
|
@@ -38,8 +39,13 @@ class ExceptionHandlingMiddleware(BaseHTTPMiddleware):
|
|
|
38
39
|
response = self._convert_exception(exception=exception)
|
|
39
40
|
except KibaException as exception:
|
|
40
41
|
logging.exception(exception)
|
|
42
|
+
if self.shouldHideInternalErrors:
|
|
43
|
+
exception = KibaException(message='Internal Server Error', statusCode=exception.statusCode, exceptionType=exception.exceptionType)
|
|
41
44
|
response = self._convert_exception(exception=exception)
|
|
42
45
|
except Exception as exception: # noqa: BLE001
|
|
43
46
|
logging.exception(exception)
|
|
44
|
-
|
|
47
|
+
kibaException = KibaException.from_exception(exception=exception)
|
|
48
|
+
if self.shouldHideInternalErrors:
|
|
49
|
+
kibaException = KibaException(message='Internal Server Error', statusCode=kibaException.statusCode)
|
|
50
|
+
response = self._convert_exception(exception=kibaException)
|
|
45
51
|
return response
|
|
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
|
{kiba_core-0.5.3.dev46 → kiba_core-0.5.3.dev47}/core/api/middleware/server_headers_middleware.py
RENAMED
|
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
|
|
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
|
|
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
|
|
File without changes
|