maleo-foundation 0.2.33__py3-none-any.whl → 0.2.35__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.
@@ -16,7 +16,7 @@ class GeneralMiddlewareConfigurations(BaseModel):
16
16
  allow_origins:List[str] = Field(default_factory=list, description="Allowed origins")
17
17
  allow_methods:List[str] = Field(_ALLOW_METHODS, description="Allowed methods")
18
18
  allow_headers:list[str] = Field(_ALLOW_HEADERS, description="Allowed headers")
19
- allow_credentials:bool = Field(False, description="Allowed credentials")
19
+ allow_credentials:bool = Field(True, description="Allowed credentials")
20
20
 
21
21
  class CORSMiddlewareConfigurations(BaseModel):
22
22
  expose_headers:List[str] = Field(_EXPOSE_HEADERS, description="Exposed headers")
@@ -115,21 +115,6 @@ class BaseMiddleware(BaseHTTPMiddleware):
115
115
  self._requests[client_ip].append(now)
116
116
  return False
117
117
 
118
- def _append_cors_headers(
119
- self,
120
- request:Request,
121
- response:Response
122
- ) -> Response:
123
- origin = request.headers.get("Origin")
124
-
125
- if origin in self._allow_origins:
126
- response.headers["Access-Control-Allow-Origin"] = origin
127
- response.headers["Access-Control-Allow-Methods"] = ", ".join(self._allow_methods)
128
- response.headers["Access-Control-Allow-Headers"] = ", ".join(self._allow_headers)
129
- response.headers["Access-Control-Allow-Credentials"] = "true" if self._allow_credentials else "false"
130
-
131
- return response
132
-
133
118
  def _add_response_headers(
134
119
  self,
135
120
  request:Request,
@@ -151,7 +136,6 @@ class BaseMiddleware(BaseHTTPMiddleware):
151
136
  sign_result = self._maleo_foundation.services.signature.sign(parameters=sign_parameters)
152
137
  if sign_result.success:
153
138
  response.headers["X-Signature"] = sign_result.data.signature
154
- response = self._append_cors_headers(request=request, response=response) #* Re-append CORS headers
155
139
  if (authentication.user.is_authenticated
156
140
  and authentication.credentials.token_type == BaseEnums.TokenType.REFRESH
157
141
  and authentication.credentials.payload is not None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.2.33
3
+ Version: 0.2.35
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -32,7 +32,7 @@ maleo_foundation/expanded_types/encryption/aes.py,sha256=1rj43qjIO0TePpr1mErT_NJ
32
32
  maleo_foundation/expanded_types/encryption/rsa.py,sha256=Esf_H8nMz2kOLAWa3M7dlD-sFdFIZylNjB_qB20Yaww,488
33
33
  maleo_foundation/managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  maleo_foundation/managers/db.py,sha256=cpY1IOiUytT9XXYtzS0E9OSYOuB7jBKo0XHe__uI1Jg,5340
35
- maleo_foundation/managers/middleware.py,sha256=ODIQU1Hpu-Xempjjo_VRbVtxiD5oi74mNuoWuDawRh0,4250
35
+ maleo_foundation/managers/middleware.py,sha256=77wRCC_CWc22nSDL-UJanO3rXmSB7wLzaAIXEFjXq6M,4249
36
36
  maleo_foundation/managers/service.py,sha256=i__-ISJ9YQi08nMRl6_j8jOVJB--A-tpGwWPF3FvoqM,18991
37
37
  maleo_foundation/managers/cache/__init__.py,sha256=CeY0oof2bVl_v5WS-FKXNwn2gf3xrEMfUsHK9cHo59s,471
38
38
  maleo_foundation/managers/cache/base.py,sha256=YyPjde4KTsp2IHV6NdFMysa0ev-1GX1rtX-0jQPuIBU,837
@@ -46,7 +46,7 @@ maleo_foundation/managers/client/google/parameter.py,sha256=Lnj7mQgxWQpsQwbmDRK5
46
46
  maleo_foundation/managers/client/google/secret.py,sha256=Ski1CHYeA8vjSk2Oc2Pf4CfFrzT_RcA6NEZwza7gM7Y,4464
47
47
  maleo_foundation/managers/client/google/storage.py,sha256=ECyEBgEvvbTDVfqXey-meGnoU4qvIRU32BxbCuzcaHU,2576
48
48
  maleo_foundation/middlewares/authentication.py,sha256=y3FEvcB8I8piCQIvvDRl2F2tCmspOVJx3jrSGI6HPn4,4702
49
- maleo_foundation/middlewares/base.py,sha256=fVuSAcO6QgFbh7-bbZLx1cKEFfCBXZ4K3s1_aWpJuG0,15262
49
+ maleo_foundation/middlewares/base.py,sha256=8_ENtyB2iKejCOQofESzlAaq_zxDWtHNaq3f10dA020,14554
50
50
  maleo_foundation/middlewares/cors.py,sha256=9uvBvY2N6Vxa9RP_YtESxcWo6Doi6uS0lzAG9iLY7Uc,2288
51
51
  maleo_foundation/models/__init__.py,sha256=AaKehO7c1HyKhoTGRmNHDddSeBXkW-_YNrpOGBu8Ms8,246
52
52
  maleo_foundation/models/responses.py,sha256=iKJs9EFemCuUOc-IxEUwjX9RgNnPf-mw7yGheCGyVDA,4896
@@ -116,7 +116,7 @@ maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg
116
116
  maleo_foundation/utils/loaders/credential/google.py,sha256=SKsqPuFnAiCcYLf24CxKnMybhVHpgqnq1gGSlThqjts,994
117
117
  maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
118
118
  maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
119
- maleo_foundation-0.2.33.dist-info/METADATA,sha256=cL-9jt1Irq1fQvImogjOFtTGFbvPvSbydujkW7j31u4,3598
120
- maleo_foundation-0.2.33.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
121
- maleo_foundation-0.2.33.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
122
- maleo_foundation-0.2.33.dist-info/RECORD,,
119
+ maleo_foundation-0.2.35.dist-info/METADATA,sha256=MgmHVupYy2wkBVXWM5qPW4Bm6LoRUJeZLpzr38xD404,3598
120
+ maleo_foundation-0.2.35.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
121
+ maleo_foundation-0.2.35.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
122
+ maleo_foundation-0.2.35.dist-info/RECORD,,