maleo-foundation 0.1.71__py3-none-any.whl → 0.1.72__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,10 +1,21 @@
1
1
  import httpx
2
2
  from contextlib import asynccontextmanager
3
3
  from pydantic import BaseModel, Field
4
- from typing import AsyncGenerator
4
+ from typing import AsyncGenerator, Generator
5
5
  from maleo_foundation.types import BaseTypes
6
6
  from maleo_foundation.utils.logging import ClientLogger, SimpleConfig
7
7
 
8
+ class BearerAuth(httpx.Auth):
9
+ def __init__(self, token:str) -> None:
10
+ self._auth_header = self._build_auth_header(token)
11
+
12
+ def auth_flow(self, request:httpx.Request) -> Generator[httpx.Request, httpx.Response, None]:
13
+ request.headers["Authorization"] = self._auth_header
14
+ yield request
15
+
16
+ def _build_auth_header(self, token:str) -> str:
17
+ return f"Bearer {token}"
18
+
8
19
  class URL(BaseModel):
9
20
  base:str = Field(..., description="Base URL")
10
21
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.1.71
3
+ Version: 0.1.72
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -21,7 +21,7 @@ maleo_foundation/managers/db.py,sha256=Pn5EZ-c1Hy6-BihN7KokHJWmBIt3Ty96fZ0zF-srt
21
21
  maleo_foundation/managers/middleware.py,sha256=ODIQU1Hpu-Xempjjo_VRbVtxiD5oi74mNuoWuDawRh0,4250
22
22
  maleo_foundation/managers/service.py,sha256=X2NgK5yVRkO5HSVGhN6PgoN-1sGn9w-_PDx1lFVGj2c,16844
23
23
  maleo_foundation/managers/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- maleo_foundation/managers/client/base.py,sha256=qfWu_wxoPSSzgZwuTEwRiXERg60diAkz65Qk3fnQej4,3972
24
+ maleo_foundation/managers/client/base.py,sha256=5z9l2GN4QASF0-Lft8o5QQ3SRPXqeNZNT1S1CgaE764,4384
25
25
  maleo_foundation/managers/client/maleo.py,sha256=iCM47TLL-RSQ2FkTmHVPdsb2JCd1LebMx6OJvIr4vCQ,2035
26
26
  maleo_foundation/managers/client/google/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  maleo_foundation/managers/client/google/base.py,sha256=j3W18Pmcu9jJ5wK12bbWBI6r8cVt5f7QmGU9uIJgKrU,1249
@@ -75,7 +75,7 @@ maleo_foundation/utils/loaders/json.py,sha256=NsXLq3VZSgzmEf99tV1VtrmiudWdQ8Pzh_
75
75
  maleo_foundation/utils/loaders/yaml.py,sha256=jr8v3BlgmRCMTzdNgKhIYt1tnubaJXcDSSGkKVR8pbw,362
76
76
  maleo_foundation/utils/loaders/key/__init__.py,sha256=G03cA_Oxu02uDsg0WBPfPkIM2uUsxnjwOPgtBKe02kc,110
77
77
  maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
78
- maleo_foundation-0.1.71.dist-info/METADATA,sha256=I3c0eeekPEnXLCV-y93Bii0bvW39tXQkALb2o3Znsgk,3390
79
- maleo_foundation-0.1.71.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
80
- maleo_foundation-0.1.71.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
81
- maleo_foundation-0.1.71.dist-info/RECORD,,
78
+ maleo_foundation-0.1.72.dist-info/METADATA,sha256=2DYADDD2buTe4fJtuusJSZD62BwOcda2IZvrAMal-CM,3390
79
+ maleo_foundation-0.1.72.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
80
+ maleo_foundation-0.1.72.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
81
+ maleo_foundation-0.1.72.dist-info/RECORD,,