maleo-foundation 0.1.69__py3-none-any.whl → 0.1.70__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.
@@ -1,7 +1,5 @@
1
- from starlette.authentication import (
2
- AuthCredentials,
3
- BaseUser
4
- )
1
+ from pydantic import BaseModel, Field
2
+ from starlette.authentication import AuthCredentials, BaseUser
5
3
  from typing import Optional, Sequence
6
4
  from maleo_foundation.models.transfers.general.token import BaseTokenGeneralTransfers
7
5
  from maleo_foundation.types import BaseTypes
@@ -46,4 +44,11 @@ class User(BaseUser):
46
44
 
47
45
  @property
48
46
  def identity(self) -> str:
49
- return self._email
47
+ return self._email
48
+
49
+ class Authentication(BaseModel):
50
+ credentials:Credentials = Field(..., description="Credentials's information")
51
+ user:User = Field(..., description="User's information")
52
+
53
+ class Config:
54
+ arbitrary_types_allowed=True
@@ -148,8 +148,8 @@ class BaseMiddleware(BaseHTTPMiddleware):
148
148
  response = self._add_response_headers(request, response, request_timestamp, response_timestamp, process_time)
149
149
  log_func = getattr(self._logger, log_level)
150
150
  log_func(
151
- f"Request {authentication_info} | IP: {client_ip} | Method: {request.method} | URL: {request.url.path} | "
152
- f"Headers: {dict(request.headers)} - Response | Status: {response.status_code} | "
151
+ f"Request {authentication_info} | IP: {client_ip} | Host: {request.client.host} | Port: {request.client.port} | Method: {request.method} | URL: {request.url.path} | "
152
+ f"Headers: {dict(request.headers)} - Response | Status: {response.status_code}"
153
153
  )
154
154
  return response
155
155
 
@@ -179,7 +179,7 @@ class BaseMiddleware(BaseHTTPMiddleware):
179
179
  )
180
180
 
181
181
  self._logger.error(
182
- f"Request {authentication_info} | IP: {client_ip} | Method: {request.method} | URL: {request.url.path} | "
182
+ f"Request {authentication_info} | IP: {client_ip} | Host: {request.client.host} | Port: {request.client.port} | Method: {request.method} | URL: {request.url.path} | "
183
183
  f"Headers: {dict(request.headers)} - Response | Status: 500 | Exception:\n{json.dumps(error_details, indent=4)}"
184
184
  )
185
185
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.1.69
3
+ Version: 0.1.70
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -1,5 +1,5 @@
1
1
  maleo_foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- maleo_foundation/authentication.py,sha256=Hk0jGsay8Tk57e7J-8Fgz_J64o3a2eB8QmP5YW1x6sw,1302
2
+ maleo_foundation/authentication.py,sha256=3UfkKQf-NdJDG6TbELTvYc8nCblGbmIJBQAAOYKM4d0,1561
3
3
  maleo_foundation/constants.py,sha256=aBmEfWlBqZxi0k-n6h2NM1YRLOjMnheEiLyQcjP-zCQ,1164
4
4
  maleo_foundation/enums.py,sha256=uvwl3dl2r6BoJMEbtSETiLoyJubHup9Lc7VOg7w7zQo,2943
5
5
  maleo_foundation/extended_types.py,sha256=pIKt-_9tby4rmune3fmWcCW_mohaNRh_1lywBmdc-L4,301
@@ -28,7 +28,7 @@ maleo_foundation/managers/client/google/base.py,sha256=j3W18Pmcu9jJ5wK12bbWBI6r8
28
28
  maleo_foundation/managers/client/google/secret.py,sha256=Uh01RoOp8QOIvu8X4AGJzOJRlrfAeXHO8ZFvmKo7A-E,3114
29
29
  maleo_foundation/managers/client/google/storage.py,sha256=MPuVpLTl0QJhlBOqpxv5UtD3ANO1WCCE1sRrfHnlCZM,2355
30
30
  maleo_foundation/middlewares/authentication.py,sha256=zIq4zeQnrogSURqQDtOMAx7D1cMCcG6ZScYyaFw7onM,3173
31
- maleo_foundation/middlewares/base.py,sha256=0ntvQ5G7sFIYKPRItSODs9-zqneQ_Reg2WtHGsziRwc,13164
31
+ maleo_foundation/middlewares/base.py,sha256=8quBiHK4gYARmxnlmcADoNWhv0eGxGaGOFQs2bofbbU,13281
32
32
  maleo_foundation/middlewares/cors.py,sha256=9uvBvY2N6Vxa9RP_YtESxcWo6Doi6uS0lzAG9iLY7Uc,2288
33
33
  maleo_foundation/models/__init__.py,sha256=AaKehO7c1HyKhoTGRmNHDddSeBXkW-_YNrpOGBu8Ms8,246
34
34
  maleo_foundation/models/responses.py,sha256=yKK_5p0dYCnUx-09mRKHkBv485bcngaCp9lwTSp_y4A,4846
@@ -74,7 +74,7 @@ maleo_foundation/utils/loaders/__init__.py,sha256=Dnuv7BWyglSddnbsFb96s-b3KaW7UK
74
74
  maleo_foundation/utils/loaders/json.py,sha256=NsXLq3VZSgzmEf99tV1VtrmiudWdQ8Pzh_hI4Rm0cM8,397
75
75
  maleo_foundation/utils/loaders/key.py,sha256=GZ4h1ONfp6Xx8-E8AWoGP4ajAZrwPhZRtidjn_u82Qg,2562
76
76
  maleo_foundation/utils/loaders/yaml.py,sha256=jr8v3BlgmRCMTzdNgKhIYt1tnubaJXcDSSGkKVR8pbw,362
77
- maleo_foundation-0.1.69.dist-info/METADATA,sha256=zP9UT6LTPNd2Pi64NaL5L3p0YWrZFsm8T2tJr75DTdI,3390
78
- maleo_foundation-0.1.69.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
79
- maleo_foundation-0.1.69.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
80
- maleo_foundation-0.1.69.dist-info/RECORD,,
77
+ maleo_foundation-0.1.70.dist-info/METADATA,sha256=jU0ANA5E3Lo0a6t3-DFOP6VIEyRqfz68iMETK5Ew-uU,3390
78
+ maleo_foundation-0.1.70.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
79
+ maleo_foundation-0.1.70.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
80
+ maleo_foundation-0.1.70.dist-info/RECORD,,