internal 1.0.113__py3-none-any.whl → 1.0.115__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 internal might be problematic. Click here for more details.

internal/base_factory.py CHANGED
@@ -15,7 +15,7 @@ from fastapi.exceptions import RequestValidationError
15
15
  from fastapi.middleware.cors import CORSMiddleware
16
16
 
17
17
  from . import database, cache_redis
18
- from .const import LOG_FMT, LOG_FMT_NO_DT, LOG_DT_FMT, DEFAULT_LOGGER_NAME
18
+ from .const import LOG_FMT, LOG_FMT_NO_DT, LOG_DT_FMT, DEFAULT_LOGGER_NAME, CORRELATION_ID_HEADER_KEY_NAME
19
19
  from .exception.base_exception import InternalBaseException
20
20
  from .exception.internal_exception import BadGatewayException, GatewayTimeoutException
21
21
  from .ext.amazon import aws
@@ -116,12 +116,12 @@ class BaseFactory(metaclass=ABCMeta):
116
116
  allow_credentials=True,
117
117
  allow_methods=["*"],
118
118
  allow_headers=["*"],
119
- expose_headers=['X-Request-ID']
119
+ expose_headers=[CORRELATION_ID_HEADER_KEY_NAME]
120
120
  )
121
121
 
122
122
  app.add_middleware(
123
123
  CorrelationIdMiddleware,
124
- header_name='X-Request-ID',
124
+ header_name=CORRELATION_ID_HEADER_KEY_NAME,
125
125
  update_request_header=True
126
126
  )
127
127
 
internal/const.py CHANGED
@@ -41,3 +41,5 @@ DEF_PAGE_SIZE = 15
41
41
  DEF_ORDER_BY = "_id"
42
42
 
43
43
  REDIS_LPR_DATA_LIST_PREFIX = "lpr_data_list"
44
+
45
+ CORRELATION_ID_HEADER_KEY_NAME="X-Request-ID"
internal/http/requests.py CHANGED
@@ -4,6 +4,7 @@ from fastapi import FastAPI
4
4
  from fastapi.encoders import jsonable_encoder
5
5
  from asgi_correlation_id import correlation_id
6
6
 
7
+ from ..const import CORRELATION_ID_HEADER_KEY_NAME
7
8
  from ..exception.internal_exception import GatewayTimeoutException, BadGatewayException
8
9
 
9
10
 
@@ -24,10 +25,10 @@ async def async_request(app: FastAPI, method, url, current_user: dict = None,
24
25
  write=request_write_timeout, pool=request_conn_pool_timeout)
25
26
 
26
27
  if "headers" in kwargs.keys():
27
- kwargs.get("headers")["X-Request-ID"] = correlation_id.get() or ""
28
+ kwargs.get("headers")[CORRELATION_ID_HEADER_KEY_NAME] = correlation_id.get() or ""
28
29
  else:
29
30
  kwargs["headers"] = {
30
- "X-Request-ID": correlation_id.get() or ""
31
+ CORRELATION_ID_HEADER_KEY_NAME: correlation_id.get() or ""
31
32
  }
32
33
 
33
34
  if current_user and "access_token" in current_user:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: internal
3
- Version: 1.0.113
3
+ Version: 1.0.115
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -1,6 +1,6 @@
1
1
  internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  internal/base_config.py,sha256=CtGIJhMSYsJQxvfkr5rZxuuXpGUY9RYyAf-p8MDv2pM,2142
3
- internal/base_factory.py,sha256=C6GUZO50OSVaXZwrs2Ok7UMgy8jGnlU95S8AelXBwK0,11244
3
+ internal/base_factory.py,sha256=ibTrlHhFXU_G4wAFWemgbXtrDqsoJFKA4kwxfU-RMyQ,11308
4
4
  internal/cache_redis.py,sha256=YMsrUXHd-wKjsjsboD79Y-ciBBowzT6aAjdJZ36-yEY,697
5
5
  internal/common_enum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  internal/common_enum/contact_type.py,sha256=7QkTQ71UxpaT1YHI40FpjmLz3r-UbRU-sd0m5ajH1as,142
@@ -10,7 +10,7 @@ internal/common_enum/event_code.py,sha256=L-1Q14pPTXkmE6XgpRQouB6cmat6sTyPGS3zI5
10
10
  internal/common_enum/lpr_direction.py,sha256=glCGSkcXHUB6_p2jO_7IdEHycyFVhu0vHDDDXbFJ174,113
11
11
  internal/common_enum/operator_type.py,sha256=XfHwGDsuOG6-ajitDoRuLFLT1LhHKoXXzFRW4e5vmJ8,173
12
12
  internal/common_enum/order_type.py,sha256=XwAl5JaZgFLahBQhBKG4VuMJ39Si9KZEhcSS0-DKKzQ,90
13
- internal/const.py,sha256=gcUn6kINa7PqxmL05agLp5FFd8Nl8jcZrPPsdXM5tKI,1126
13
+ internal/const.py,sha256=d-F_tJ8GvxR1GwhEsqAt92XBwU53RAq8sZSGwWenb7o,1173
14
14
  internal/database.py,sha256=1u53JnFJ0jvP7H4HPY2faA2ABdPQ8SlsZigYmQAPktI,2470
15
15
  internal/exception/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  internal/exception/app_exception.py,sha256=z7BGD0iw0VW5rczQb-sjnfxk1O_E6CPWMnBUfddU-0g,3467
@@ -21,7 +21,7 @@ internal/ext/amazon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
21
21
  internal/ext/amazon/aws/__init__.py,sha256=2YFjb-rHG1JaZGZiZffYDesgTAJjDshOqQbswOYzhP8,834
22
22
  internal/ext/amazon/aws/const.py,sha256=l4WMg5bKWujwOKABBkCO2zclNg3abnYOfbhD7DG8GsA,109
23
23
  internal/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- internal/http/requests.py,sha256=Yh0jro4fXWZjwso8EKiJ3XwLtBwg9hFuOEnJs7IC5FI,3045
24
+ internal/http/requests.py,sha256=erKQYj6WjHLojhVQNJsGiB4i-2k9jhLw4dKkwLrpdGM,3128
25
25
  internal/http/responses.py,sha256=zvU0iRQ9-qxeEZfKmuvTi8lv9DFcaNAsHlQKOTCpVzw,2945
26
26
  internal/interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  internal/interface/base_interface.py,sha256=3YaVjIgLi_pZpLk5SEIk8WVkuICM8qPavT8rB0MdB5U,1536
@@ -32,6 +32,6 @@ internal/model/base_model.py,sha256=NWjysNOp2MfXvAHGFqaQA_l8ZfTFvJbXQPUPuOXN_2g,
32
32
  internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
33
33
  internal/utils.py,sha256=i6YZdiXsiWnOjRdlJ6afNCGpyMe3Uo9mhm3xlQBy3Ls,2824
34
34
  internal/validator_utils.py,sha256=5ZLcNIgw1hvkYOj1f6gS9AYxe7Y3ufW9FyDxUS7FsMQ,1226
35
- internal-1.0.113.dist-info/METADATA,sha256=_tNewvF6vihn1qapSfpTF-AmARNDGkedzdUK0qvRPqw,809
36
- internal-1.0.113.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
37
- internal-1.0.113.dist-info/RECORD,,
35
+ internal-1.0.115.dist-info/METADATA,sha256=oiNV3pJANzB7Kqk-m5Tp1fsrTkrILcKpCkqVhMh5CXo,809
36
+ internal-1.0.115.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
37
+ internal-1.0.115.dist-info/RECORD,,