aixtools 0.3.1__py3-none-any.whl → 0.3.2__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 aixtools might be problematic. Click here for more details.
- aixtools/_version.py +2 -2
- aixtools/auth/auth.py +16 -0
- {aixtools-0.3.1.dist-info → aixtools-0.3.2.dist-info}/METADATA +1 -1
- {aixtools-0.3.1.dist-info → aixtools-0.3.2.dist-info}/RECORD +7 -7
- {aixtools-0.3.1.dist-info → aixtools-0.3.2.dist-info}/WHEEL +0 -0
- {aixtools-0.3.1.dist-info → aixtools-0.3.2.dist-info}/entry_points.txt +0 -0
- {aixtools-0.3.1.dist-info → aixtools-0.3.2.dist-info}/top_level.txt +0 -0
aixtools/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.3.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 3,
|
|
31
|
+
__version__ = version = '0.3.2'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 3, 2)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
aixtools/auth/auth.py
CHANGED
|
@@ -30,6 +30,7 @@ class AuthTokenErrorCode(str, enum.Enum):
|
|
|
30
30
|
JWT_ERROR = "Generic JWT error"
|
|
31
31
|
MISSING_GROUPS_ERROR = "Missing authorized groups"
|
|
32
32
|
INVALID_TOKEN_SCOPE = "Token scope does not match configured scope"
|
|
33
|
+
TOKEN_MISSING = "Token missing"
|
|
33
34
|
|
|
34
35
|
|
|
35
36
|
class AuthTokenError(Exception):
|
|
@@ -185,3 +186,18 @@ class AccessTokenAuthProvider(AuthProvider):
|
|
|
185
186
|
return AccessToken(
|
|
186
187
|
token=token, client_id=self.token_verifier.api_id, scopes=scopes_arr, expires_at=claims.get("exp", None)
|
|
187
188
|
)
|
|
189
|
+
|
|
190
|
+
async def verify_auth_header(self, auth_header: str | None) -> AccessToken:
|
|
191
|
+
"""
|
|
192
|
+
Splits the authorization header and looks for bearer type token,
|
|
193
|
+
then verifies the extracted bearer token and returns an AccessToken object.
|
|
194
|
+
"""
|
|
195
|
+
|
|
196
|
+
if auth_header and auth_header.lower().startswith("bearer "):
|
|
197
|
+
auth_token = auth_header.split(" ", 1)[1].strip()
|
|
198
|
+
return await self.verify_token(auth_token)
|
|
199
|
+
|
|
200
|
+
raise AuthTokenError(
|
|
201
|
+
AuthTokenErrorCode.TOKEN_MISSING,
|
|
202
|
+
f"Could not find bearer token in authorization header: {auth_header}",
|
|
203
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
aixtools/__init__.py,sha256=9NGHm7LjsQmsvjTZvw6QFJexSvAU4bCoN_KBk9SCa00,260
|
|
2
|
-
aixtools/_version.py,sha256=
|
|
2
|
+
aixtools/_version.py,sha256=e8NqPtZ8fggRgk3GPrqZ_U_BDV8aSULw1u_Gn9NNbnk,704
|
|
3
3
|
aixtools/app.py,sha256=JzQ0nrv_bjDQokllIlGHOV0HEb-V8N6k_nGQH-TEsVU,5227
|
|
4
4
|
aixtools/chainlit.md,sha256=yC37Ly57vjKyiIvK4oUvf4DYxZCwH7iocTlx7bLeGLU,761
|
|
5
5
|
aixtools/context.py,sha256=I_MD40ZnvRm5WPKAKqBUAdXIf8YaurkYUUHSVVy-QvU,598
|
|
@@ -33,7 +33,7 @@ aixtools/agents/nodes_to_str.py,sha256=UkOu5Nry827J4H_ohQU3tPBfJxtr3p6FfCfWoUy5u
|
|
|
33
33
|
aixtools/agents/print_nodes.py,sha256=wVTngNfqM0As845WTRz6G3Rei_Gr3HuBlvu-G_eXuig,1665
|
|
34
34
|
aixtools/agents/prompt.py,sha256=oZl6_3SelyoSysLpF6AAmLHLHhwyPYCtX8hJ2pRUnhw,7396
|
|
35
35
|
aixtools/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
|
-
aixtools/auth/auth.py,sha256=
|
|
36
|
+
aixtools/auth/auth.py,sha256=rCvkcZCDNo-f3lsuMkLlcfpTO5GlRsHY9qhCnB7ayhU,8123
|
|
37
37
|
aixtools/compliance/__init__.py,sha256=vnw0zEdySIJWvDAJ8DCRRaWmY_agEOz1qlpAdhmtiuo,191
|
|
38
38
|
aixtools/compliance/private_data.py,sha256=OOM9mIp3_w0fNgj3VAEWBl7-jrPc19_Ls1pC5dfF5UY,5323
|
|
39
39
|
aixtools/db/__init__.py,sha256=b8vRhme3egV-aUZbAntnOaDkSXB8UT0Xy5oqQhU_z0Q,399
|
|
@@ -95,8 +95,8 @@ aixtools/utils/chainlit/cl_agent_show.py,sha256=vaRuowp4BRvhxEr5hw0zHEJ7iaSF_5bo
|
|
|
95
95
|
aixtools/utils/chainlit/cl_utils.py,sha256=fxaxdkcZg6uHdM8uztxdPowg3a2f7VR7B26VPY4t-3c,5738
|
|
96
96
|
aixtools/vault/__init__.py,sha256=fsr_NuX3GZ9WZ7dGfe0gp_5-z3URxAfwVRXw7Xyc0dU,141
|
|
97
97
|
aixtools/vault/vault.py,sha256=9dZLWdZQk9qN_Q9Djkofw9LUKnJqnrX5H0fGusVLBhA,6037
|
|
98
|
-
aixtools-0.3.
|
|
99
|
-
aixtools-0.3.
|
|
100
|
-
aixtools-0.3.
|
|
101
|
-
aixtools-0.3.
|
|
102
|
-
aixtools-0.3.
|
|
98
|
+
aixtools-0.3.2.dist-info/METADATA,sha256=FnBXFfGny-BUh1L6fkR_JUZy7OjZPbjRhhoDIgfg5jM,28014
|
|
99
|
+
aixtools-0.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
100
|
+
aixtools-0.3.2.dist-info/entry_points.txt,sha256=q8412TG4T0S8K0SKeWp2vkVPIDYQs0jNoHqcQ7qxOiA,155
|
|
101
|
+
aixtools-0.3.2.dist-info/top_level.txt,sha256=wBn-rw9bCtxrR4AYEYgjilNCUVmKY0LWby9Zan2PRJM,9
|
|
102
|
+
aixtools-0.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|