aixtools 0.3.5__py3-none-any.whl → 0.3.7__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 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.5'
32
- __version_tuple__ = version_tuple = (0, 3, 5)
31
+ __version__ = version = '0.3.7'
32
+ __version_tuple__ = version_tuple = (0, 3, 7)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -1,14 +1,13 @@
1
1
  "Auth module managing user authentication for A2A server"
2
2
 
3
- from logging import getLogger
4
-
5
3
  from starlette.middleware.base import BaseHTTPMiddleware
6
4
  from starlette.requests import Request
7
5
 
8
6
  from aixtools.auth.auth import AccessTokenAuthProvider, AuthTokenError
7
+ from aixtools.logging.logging_config import get_logger
9
8
  from aixtools.utils import config
10
9
 
11
- logger = getLogger(__name__)
10
+ logger = get_logger(__name__)
12
11
 
13
12
 
14
13
  class AuthMiddleware(BaseHTTPMiddleware): # pylint: disable=too-few-public-methods
aixtools/auth/auth.py CHANGED
@@ -3,7 +3,6 @@ Module that manages OAuth2 functions for authentication
3
3
  """
4
4
 
5
5
  import enum
6
- import logging
7
6
 
8
7
  import jwt
9
8
  from fastapi import HTTPException
@@ -13,9 +12,11 @@ from mcp.server.auth.provider import (
13
12
  AccessToken,
14
13
  )
15
14
 
15
+ from aixtools.context import user_id_var
16
+ from aixtools.logging.logging_config import get_logger
16
17
  from aixtools.utils import config
17
18
 
18
- logger = logging.getLogger(__name__)
19
+ logger = get_logger(__name__)
19
20
  TEST_CLIENT = "test-client"
20
21
 
21
22
 
@@ -108,6 +109,11 @@ class AccessTokenVerifier:
108
109
  # ensure audience verification is carried out
109
110
  options={"verify_aud": True},
110
111
  )
112
+ # set user_id for logging context.
113
+ user_id = claims.get("email")
114
+ if user_id:
115
+ user_id_var.set(user_id)
116
+
111
117
  logger.info("Verified JWT token")
112
118
  return claims
113
119
 
aixtools/server/path.py CHANGED
@@ -36,6 +36,7 @@ def get_workspace_path(ctx: Context | tuple | None = None) -> Path:
36
36
  Returns: The workspace path as a Path object.
37
37
  """
38
38
  user_id, session_id = ctx if isinstance(ctx, tuple) else get_session_id_tuple(ctx)
39
+ user_id = user_id.lower() # to handle tuple passed directly
39
40
  return WORKSPACES_ROOT_DIR / user_id / session_id
40
41
 
41
42
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aixtools
3
- Version: 0.3.5
3
+ Version: 0.3.7
4
4
  Summary: Tools for AI exploration and debugging
5
5
  Requires-Python: >=3.11.2
6
6
  Description-Content-Type: text/markdown
@@ -1,5 +1,5 @@
1
1
  aixtools/__init__.py,sha256=9NGHm7LjsQmsvjTZvw6QFJexSvAU4bCoN_KBk9SCa00,260
2
- aixtools/_version.py,sha256=UAb2Toi6SAdScDfq1uKRRv5QpMUuRtJqqwNxTMGe5Q4,704
2
+ aixtools/_version.py,sha256=CszCydqJjxQ_CbTrTy0L1k2j2gCfwJlahui0bCcdNp4,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
@@ -18,7 +18,7 @@ aixtools/.chainlit/translations/ta.json,sha256=pxa2uLEEDjiGiT6MFcCJ_kNh5KoFViHFp
18
18
  aixtools/.chainlit/translations/te.json,sha256=0qGj-ODEHVOcxfVVX5IszS1QBCKSXuU1okANP_EbvBQ,16885
19
19
  aixtools/.chainlit/translations/zh-CN.json,sha256=EWxhT2_6CW9z0F6SI2llr3RsaL2omH1QZWHVG2n5POA,8664
20
20
  aixtools/a2a/app.py,sha256=ugx9FR8QadpEIgy79V6vx1zoamm6ldds6PYKePPQ3sA,5809
21
- aixtools/a2a/auth_middleware.py,sha256=Q9JmM0JZyJinQBm_BbSizhKpUgIvyWXEegCUmm204AI,1635
21
+ aixtools/a2a/auth_middleware.py,sha256=TdVaUn4qhV0_QTCfavx8hmWJVPzCGsPtiQmH4icxC2Y,1660
22
22
  aixtools/a2a/utils.py,sha256=EHr3IyyBJn23ni-JcfAf6i3VpQmPs0g1TSnAZazvY_8,4039
23
23
  aixtools/a2a/google_sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  aixtools/a2a/google_sdk/remote_agent_connection.py,sha256=wJXIHD76yL3nlI4b9IA7FQlpKRxrFDsSh78TIm1Fy4E,3329
@@ -34,7 +34,7 @@ aixtools/agents/nodes_to_str.py,sha256=UkOu5Nry827J4H_ohQU3tPBfJxtr3p6FfCfWoUy5u
34
34
  aixtools/agents/print_nodes.py,sha256=wVTngNfqM0As845WTRz6G3Rei_Gr3HuBlvu-G_eXuig,1665
35
35
  aixtools/agents/prompt.py,sha256=oZl6_3SelyoSysLpF6AAmLHLHhwyPYCtX8hJ2pRUnhw,7396
36
36
  aixtools/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
- aixtools/auth/auth.py,sha256=0GAelLK6MaLq-iHm4jE76UPvLplEfodlxb0VYRttLNk,8258
37
+ aixtools/auth/auth.py,sha256=AUc9Kw8ZrjiIxsp7Vg1bexg8mIuMbRv8XNU3pynfMdU,8487
38
38
  aixtools/compliance/__init__.py,sha256=vnw0zEdySIJWvDAJ8DCRRaWmY_agEOz1qlpAdhmtiuo,191
39
39
  aixtools/compliance/private_data.py,sha256=OOM9mIp3_w0fNgj3VAEWBl7-jrPc19_Ls1pC5dfF5UY,5323
40
40
  aixtools/db/__init__.py,sha256=b8vRhme3egV-aUZbAntnOaDkSXB8UT0Xy5oqQhU_z0Q,399
@@ -74,7 +74,7 @@ aixtools/mcp/server.py,sha256=wpN7tJmUZqGsb_rOVfXbyTFJ9VPnQl7nG5wa1JAz-No,2566
74
74
  aixtools/model_patch/model_patch.py,sha256=JT-oHubIn2LeoSwWbzEQ5vLH7crJmFUecHyQfaAFHa0,1813
75
75
  aixtools/server/__init__.py,sha256=rwPx020YpOzCnrxA80Lc4yLLcIp-Mpe9hNqVO9wDPv0,448
76
76
  aixtools/server/app_mounter.py,sha256=0tJ0tC140ezAjnYdlhpLJQjY-TO8NVw7D8LseYCCVY8,3336
77
- aixtools/server/path.py,sha256=nI4yRQcE6gjKx5GG3PmHf7iT1FelT6Q8Xhw4ol9O1e0,5219
77
+ aixtools/server/path.py,sha256=fvJUmggiOQiIewflYMKZwy5nEJLFGeZHrnRY3xPqHQ0,5284
78
78
  aixtools/server/utils.py,sha256=jIRgFT_tdgwuyI8vjc9iQJyDvC0CAoi09Gc5of6I1dg,3554
79
79
  aixtools/testing/__init__.py,sha256=mlmaAR2gmS4SbsYNCxnIprmFpFp-syjgVUkpUszo3mE,166
80
80
  aixtools/testing/agent_mock.py,sha256=D4DrRGaeKuWEhq8hdB5s9PdfLAXHMKiC3JA7M8yN13o,4244
@@ -96,8 +96,8 @@ aixtools/utils/chainlit/cl_agent_show.py,sha256=vaRuowp4BRvhxEr5hw0zHEJ7iaSF_5bo
96
96
  aixtools/utils/chainlit/cl_utils.py,sha256=fxaxdkcZg6uHdM8uztxdPowg3a2f7VR7B26VPY4t-3c,5738
97
97
  aixtools/vault/__init__.py,sha256=fsr_NuX3GZ9WZ7dGfe0gp_5-z3URxAfwVRXw7Xyc0dU,141
98
98
  aixtools/vault/vault.py,sha256=9dZLWdZQk9qN_Q9Djkofw9LUKnJqnrX5H0fGusVLBhA,6037
99
- aixtools-0.3.5.dist-info/METADATA,sha256=k1_-0YKmcLSeY36KVz-rxDYY1fwiB2iS_ncE9j8UozI,28014
100
- aixtools-0.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
101
- aixtools-0.3.5.dist-info/entry_points.txt,sha256=q8412TG4T0S8K0SKeWp2vkVPIDYQs0jNoHqcQ7qxOiA,155
102
- aixtools-0.3.5.dist-info/top_level.txt,sha256=wBn-rw9bCtxrR4AYEYgjilNCUVmKY0LWby9Zan2PRJM,9
103
- aixtools-0.3.5.dist-info/RECORD,,
99
+ aixtools-0.3.7.dist-info/METADATA,sha256=YAAB9h7I10KSNbxjUsIkryI5H50DeUEtq-xJYTZzFvc,28014
100
+ aixtools-0.3.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
101
+ aixtools-0.3.7.dist-info/entry_points.txt,sha256=q8412TG4T0S8K0SKeWp2vkVPIDYQs0jNoHqcQ7qxOiA,155
102
+ aixtools-0.3.7.dist-info/top_level.txt,sha256=wBn-rw9bCtxrR4AYEYgjilNCUVmKY0LWby9Zan2PRJM,9
103
+ aixtools-0.3.7.dist-info/RECORD,,