microsoft-agents-hosting-aiohttp 1.2.0.dev20__tar.gz → 1.4.0.dev10__tar.gz
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.
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20/microsoft_agents_hosting_aiohttp.egg-info → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/PKG-INFO +33 -3
- microsoft_agents_hosting_aiohttp-1.4.0.dev10/VERSION.txt +1 -0
- microsoft_agents_hosting_aiohttp-1.4.0.dev10/microsoft_agents/hosting/aiohttp/_aiohttp_request_adapter.py +28 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/microsoft_agents/hosting/aiohttp/_start_agent_process.py +3 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/microsoft_agents/hosting/aiohttp/channel_service_route_table.py +5 -26
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/microsoft_agents/hosting/aiohttp/cloud_adapter.py +11 -29
- microsoft_agents_hosting_aiohttp-1.4.0.dev10/microsoft_agents/hosting/aiohttp/jwt_authorization_middleware.py +79 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10/microsoft_agents_hosting_aiohttp.egg-info}/PKG-INFO +33 -3
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/microsoft_agents_hosting_aiohttp.egg-info/SOURCES.txt +1 -0
- microsoft_agents_hosting_aiohttp-1.4.0.dev10/microsoft_agents_hosting_aiohttp.egg-info/requires.txt +2 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/readme.md +31 -1
- microsoft_agents_hosting_aiohttp-1.2.0.dev20/VERSION.txt +0 -1
- microsoft_agents_hosting_aiohttp-1.2.0.dev20/microsoft_agents/hosting/aiohttp/jwt_authorization_middleware.py +0 -63
- microsoft_agents_hosting_aiohttp-1.2.0.dev20/microsoft_agents_hosting_aiohttp.egg-info/requires.txt +0 -2
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/LICENSE +0 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/MANIFEST.in +0 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/microsoft_agents/hosting/aiohttp/__init__.py +0 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/microsoft_agents/hosting/aiohttp/agent_http_adapter.py +0 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/microsoft_agents_hosting_aiohttp.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/microsoft_agents_hosting_aiohttp.egg-info/top_level.txt +0 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/pyproject.toml +0 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/setup.cfg +0 -0
- {microsoft_agents_hosting_aiohttp-1.2.0.dev20 → microsoft_agents_hosting_aiohttp-1.4.0.dev10}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-aiohttp
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0.dev10
|
|
4
4
|
Summary: Integration library for Microsoft Agents with aiohttp
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: microsoft-agents-hosting-core==1.
|
|
18
|
+
Requires-Dist: microsoft-agents-hosting-core==1.4.0.dev10
|
|
19
19
|
Requires-Dist: aiohttp>=3.11.11
|
|
20
20
|
Dynamic: license-file
|
|
21
21
|
Dynamic: requires-dist
|
|
@@ -39,6 +39,24 @@ This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehe
|
|
|
39
39
|
<th style="width:20%">Date</th>
|
|
40
40
|
<th style="width:60%">Release Notes</th>
|
|
41
41
|
</tr>
|
|
42
|
+
<tr>
|
|
43
|
+
<td>1.3.0</td>
|
|
44
|
+
<td>2026-07-30</td>
|
|
45
|
+
<td>
|
|
46
|
+
<a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v130">
|
|
47
|
+
1.3.0 Release Notes
|
|
48
|
+
</a>
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td>1.2.0</td>
|
|
53
|
+
<td>2026-07-17</td>
|
|
54
|
+
<td>
|
|
55
|
+
<a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v120">
|
|
56
|
+
1.2.0 Release Notes
|
|
57
|
+
</a>
|
|
58
|
+
</td>
|
|
59
|
+
</tr>
|
|
42
60
|
<tr>
|
|
43
61
|
<td>1.1.0</td>
|
|
44
62
|
<td>2026-06-19</td>
|
|
@@ -57,6 +75,15 @@ This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehe
|
|
|
57
75
|
</a>
|
|
58
76
|
</td>
|
|
59
77
|
</tr>
|
|
78
|
+
<tr>
|
|
79
|
+
<td>0.9.1</td>
|
|
80
|
+
<td>2026-05-04</td>
|
|
81
|
+
<td>
|
|
82
|
+
<a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v091">
|
|
83
|
+
0.9.1 Release Notes
|
|
84
|
+
</a>
|
|
85
|
+
</td>
|
|
86
|
+
</tr>
|
|
60
87
|
<tr>
|
|
61
88
|
<td>0.9.0</td>
|
|
62
89
|
<td>2026-04-15</td>
|
|
@@ -122,11 +149,14 @@ We offer the following PyPI packages to create conversational experiences based
|
|
|
122
149
|
| `microsoft-agents-activity` | [](https://pypi.org/project/microsoft-agents-activity/) | Types and validators implementing the Activity protocol spec. |
|
|
123
150
|
| `microsoft-agents-hosting-core` | [](https://pypi.org/project/microsoft-agents-hosting-core/) | Core library for Microsoft Agents hosting. |
|
|
124
151
|
| `microsoft-agents-hosting-aiohttp` | [](https://pypi.org/project/microsoft-agents-hosting-aiohttp/) | Configures aiohttp to run the Agent. |
|
|
125
|
-
| `microsoft-agents-hosting-
|
|
152
|
+
| `microsoft-agents-hosting-fastapi` | [](https://pypi.org/project/microsoft-agents-hosting-fastapi/) | Configures fastapi to run the Agent. |
|
|
153
|
+
| `microsoft-agents-hosting-msteams` | [](https://pypi.org/project/microsoft-agents-hosting-msteams/) | Provides classes to host an Agent for Teams. |
|
|
126
154
|
| `microsoft-agents-hosting-dialogs` | [](https://pypi.org/project/microsoft-agents-hosting-dialogs/) | Dialog system with waterfall dialogs, prompts, and multi-turn conversation management. |
|
|
155
|
+
| `microsoft-agents-hosting-slack` | [](https://pypi.org/project/microsoft-agents-hosting-slack/) | Provides classes to host an Agent for Slack. |
|
|
127
156
|
| `microsoft-agents-storage-blob` | [](https://pypi.org/project/microsoft-agents-storage-blob/) | Extension to use Azure Blob as storage. |
|
|
128
157
|
| `microsoft-agents-storage-cosmos` | [](https://pypi.org/project/microsoft-agents-storage-cosmos/) | Extension to use CosmosDB as storage. |
|
|
129
158
|
| `microsoft-agents-authentication-msal` | [](https://pypi.org/project/microsoft-agents-authentication-msal/) | MSAL-based authentication for Microsoft Agents. |
|
|
159
|
+
| `microsoft-agents-authentication-entra-auth-sidecar` | [](https://pypi.org/project/microsoft-agents-authentication-entra-auth-sidecar/) | Credential-free Entra ID Agent ID authentication via the sidecar. |
|
|
130
160
|
|
|
131
161
|
Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio:
|
|
132
162
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.4.0.dev10
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from aiohttp.web import Request
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class AiohttpRequestAdapter:
|
|
8
|
+
"""Adapter to make aiohttp Request compatible with HttpRequestProtocol."""
|
|
9
|
+
|
|
10
|
+
def __init__(self, request: Request):
|
|
11
|
+
self._request = request
|
|
12
|
+
|
|
13
|
+
@property
|
|
14
|
+
def method(self) -> str:
|
|
15
|
+
return self._request.method
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def headers(self):
|
|
19
|
+
return self._request.headers
|
|
20
|
+
|
|
21
|
+
async def json(self):
|
|
22
|
+
return await self._request.json()
|
|
23
|
+
|
|
24
|
+
def get_claims_identity(self):
|
|
25
|
+
return self._request.get("claims_identity")
|
|
26
|
+
|
|
27
|
+
def get_path_param(self, name: str) -> str:
|
|
28
|
+
return self._request.match_info[name]
|
|
@@ -1,35 +1,12 @@
|
|
|
1
1
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
2
|
# Licensed under the MIT License.
|
|
3
|
-
import json
|
|
4
3
|
|
|
5
4
|
from aiohttp.web import RouteTableDef, Request, Response
|
|
6
5
|
|
|
7
6
|
from microsoft_agents.hosting.core import ChannelApiHandlerProtocol
|
|
8
7
|
from microsoft_agents.hosting.core.http import ChannelServiceRoutes
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
class AiohttpRequestAdapter:
|
|
12
|
-
"""Adapter for aiohttp requests to use with ChannelServiceRoutes."""
|
|
13
|
-
|
|
14
|
-
def __init__(self, request: Request):
|
|
15
|
-
self._request = request
|
|
16
|
-
|
|
17
|
-
@property
|
|
18
|
-
def method(self) -> str:
|
|
19
|
-
return self._request.method
|
|
20
|
-
|
|
21
|
-
@property
|
|
22
|
-
def headers(self):
|
|
23
|
-
return self._request.headers
|
|
24
|
-
|
|
25
|
-
async def json(self):
|
|
26
|
-
return await self._request.json()
|
|
27
|
-
|
|
28
|
-
def get_claims_identity(self):
|
|
29
|
-
return self._request.get("claims_identity")
|
|
30
|
-
|
|
31
|
-
def get_path_param(self, name: str) -> str:
|
|
32
|
-
return self._request.match_info[name]
|
|
9
|
+
from ._aiohttp_request_adapter import AiohttpRequestAdapter
|
|
33
10
|
|
|
34
11
|
|
|
35
12
|
def channel_service_route_table(
|
|
@@ -47,8 +24,10 @@ def channel_service_route_table(
|
|
|
47
24
|
routes = RouteTableDef()
|
|
48
25
|
service_routes = ChannelServiceRoutes(handler, base_url)
|
|
49
26
|
|
|
50
|
-
def json_response(data: dict) -> Response:
|
|
51
|
-
|
|
27
|
+
def json_response(data: dict | list[dict]) -> Response:
|
|
28
|
+
import json
|
|
29
|
+
|
|
30
|
+
return Response(text=json.dumps(data), content_type="application/json")
|
|
52
31
|
|
|
53
32
|
@routes.post(base_url + "/v3/conversations/{conversation_id}/activities")
|
|
54
33
|
async def send_to_conversation(request: Request):
|
|
@@ -1,42 +1,19 @@
|
|
|
1
1
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
2
|
# Licensed under the MIT License.
|
|
3
|
+
|
|
3
4
|
from typing import Optional
|
|
4
5
|
|
|
5
6
|
from aiohttp.web import Request, Response, json_response
|
|
6
7
|
|
|
7
|
-
from microsoft_agents.hosting.core import Agent
|
|
8
|
+
from microsoft_agents.hosting.core import Agent, HttpAdapterBase
|
|
8
9
|
from microsoft_agents.hosting.core.authorization import Connections
|
|
9
10
|
from microsoft_agents.hosting.core.http import (
|
|
10
|
-
HttpAdapterBase,
|
|
11
11
|
HttpResponse,
|
|
12
12
|
)
|
|
13
13
|
from microsoft_agents.hosting.core import ChannelServiceClientFactoryBase
|
|
14
14
|
|
|
15
15
|
from .agent_http_adapter import AgentHttpAdapter
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class AiohttpRequestAdapter:
|
|
19
|
-
"""Adapter to make aiohttp Request compatible with HttpRequestProtocol."""
|
|
20
|
-
|
|
21
|
-
def __init__(self, request: Request):
|
|
22
|
-
self._request = request
|
|
23
|
-
|
|
24
|
-
@property
|
|
25
|
-
def method(self) -> str:
|
|
26
|
-
return self._request.method
|
|
27
|
-
|
|
28
|
-
@property
|
|
29
|
-
def headers(self):
|
|
30
|
-
return self._request.headers
|
|
31
|
-
|
|
32
|
-
async def json(self):
|
|
33
|
-
return await self._request.json()
|
|
34
|
-
|
|
35
|
-
def get_claims_identity(self):
|
|
36
|
-
return self._request.get("claims_identity")
|
|
37
|
-
|
|
38
|
-
def get_path_param(self, name: str) -> str:
|
|
39
|
-
return self._request.match_info[name]
|
|
16
|
+
from ._aiohttp_request_adapter import AiohttpRequestAdapter
|
|
40
17
|
|
|
41
18
|
|
|
42
19
|
class CloudAdapter(HttpAdapterBase, AgentHttpAdapter):
|
|
@@ -45,18 +22,22 @@ class CloudAdapter(HttpAdapterBase, AgentHttpAdapter):
|
|
|
45
22
|
def __init__(
|
|
46
23
|
self,
|
|
47
24
|
*,
|
|
48
|
-
connection_manager: Connections = None,
|
|
49
|
-
channel_service_client_factory: ChannelServiceClientFactoryBase = None,
|
|
25
|
+
connection_manager: Connections | None = None,
|
|
26
|
+
channel_service_client_factory: ChannelServiceClientFactoryBase | None = None,
|
|
27
|
+
channel_service_client_factory_options: dict | None = None,
|
|
50
28
|
):
|
|
51
29
|
"""
|
|
52
30
|
Initializes a new instance of the CloudAdapter class.
|
|
53
31
|
|
|
54
32
|
:param connection_manager: Optional connection manager for OAuth.
|
|
55
|
-
:param channel_service_client_factory:
|
|
33
|
+
:param channel_service_client_factory: Factory for creating channel service clients.
|
|
34
|
+
:param channel_service_client_factory_options: Optional dictionary of options to pass to the channel service client factory
|
|
35
|
+
This is only used if channel_service_client_factory is not provided and connection_manager is provided.
|
|
56
36
|
"""
|
|
57
37
|
super().__init__(
|
|
58
38
|
connection_manager=connection_manager,
|
|
59
39
|
channel_service_client_factory=channel_service_client_factory,
|
|
40
|
+
channel_service_client_factory_options=channel_service_client_factory_options,
|
|
60
41
|
)
|
|
61
42
|
|
|
62
43
|
async def process(self, request: Request, agent: Agent) -> Optional[Response]:
|
|
@@ -91,4 +72,5 @@ class CloudAdapter(HttpAdapterBase, AgentHttpAdapter):
|
|
|
91
72
|
return Response(
|
|
92
73
|
status=http_response.status_code,
|
|
93
74
|
headers=http_response.headers,
|
|
75
|
+
content_type=http_response.content_type,
|
|
94
76
|
)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import functools
|
|
5
|
+
import logging
|
|
6
|
+
from typing import cast
|
|
7
|
+
|
|
8
|
+
from aiohttp.web import Request, middleware, json_response
|
|
9
|
+
|
|
10
|
+
from microsoft_agents.hosting.core.authorization import AgentAuthConfiguration
|
|
11
|
+
from microsoft_agents.hosting.core.authorization.jwt import _authorize_request
|
|
12
|
+
from microsoft_agents.hosting.core.http import HttpResponse
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
_GENERIC_AUTH_ERROR = {"error": "Invalid token or authentication failed."}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _extract_bearer_token(auth_header: str) -> str | None:
|
|
20
|
+
"""Extracts the bearer token from a raw Authorization header value.
|
|
21
|
+
|
|
22
|
+
Surrounding whitespace on the token is ignored for backward compatibility.
|
|
23
|
+
Returns None for anything malformed so callers can respond with a
|
|
24
|
+
consistent 401 instead of raising.
|
|
25
|
+
"""
|
|
26
|
+
parts = auth_header.split(maxsplit=1)
|
|
27
|
+
if len(parts) != 2 or parts[0].lower() != "bearer":
|
|
28
|
+
return None
|
|
29
|
+
|
|
30
|
+
token = parts[1].strip()
|
|
31
|
+
return token if token and not any(char.isspace() for char in token) else None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
async def _jwt_authorization_middleware(request: Request, handler):
|
|
35
|
+
"""
|
|
36
|
+
JWT Authorization Middleware for aiohttp endpoints.
|
|
37
|
+
"""
|
|
38
|
+
auth_config = cast(
|
|
39
|
+
AgentAuthConfiguration | None, request.app.get("agent_configuration", None)
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
auth_header = request.headers.get("Authorization")
|
|
43
|
+
if auth_header is not None:
|
|
44
|
+
# aiohttp-specific tolerance: trailing whitespace (spaces/tabs) after
|
|
45
|
+
# the bearer token is ignored for backward compatibility, but internal
|
|
46
|
+
# or extra non-whitespace content is rejected. Normalizing here keeps
|
|
47
|
+
# the shared `_authorize_request` parsing (used identically by the
|
|
48
|
+
# FastAPI adapter) strict and unchanged.
|
|
49
|
+
token = _extract_bearer_token(auth_header)
|
|
50
|
+
if token is None:
|
|
51
|
+
logger.warning("Malformed authorization header.")
|
|
52
|
+
return json_response(_GENERIC_AUTH_ERROR, status=401)
|
|
53
|
+
auth_header = f"Bearer {token}"
|
|
54
|
+
|
|
55
|
+
res = await _authorize_request(auth_header, auth_config)
|
|
56
|
+
|
|
57
|
+
if isinstance(res, HttpResponse):
|
|
58
|
+
return json_response(res.body, status=res.status_code)
|
|
59
|
+
|
|
60
|
+
request["claims_identity"] = res
|
|
61
|
+
return await handler(request)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
jwt_authorization_middleware = middleware(_jwt_authorization_middleware)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def jwt_authorization_decorator(func):
|
|
68
|
+
"""
|
|
69
|
+
Decorator for aiohttp route handlers to enforce JWT validation using the Microsoft Agents SDK's JwtTokenValidator.
|
|
70
|
+
|
|
71
|
+
:param func: The aiohttp route handler function to be decorated.
|
|
72
|
+
:return: The decorated aiohttp route handler function.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
@functools.wraps(func)
|
|
76
|
+
async def wrapper(request):
|
|
77
|
+
return await _jwt_authorization_middleware(request, func)
|
|
78
|
+
|
|
79
|
+
return wrapper
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-aiohttp
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0.dev10
|
|
4
4
|
Summary: Integration library for Microsoft Agents with aiohttp
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: microsoft-agents-hosting-core==1.
|
|
18
|
+
Requires-Dist: microsoft-agents-hosting-core==1.4.0.dev10
|
|
19
19
|
Requires-Dist: aiohttp>=3.11.11
|
|
20
20
|
Dynamic: license-file
|
|
21
21
|
Dynamic: requires-dist
|
|
@@ -39,6 +39,24 @@ This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehe
|
|
|
39
39
|
<th style="width:20%">Date</th>
|
|
40
40
|
<th style="width:60%">Release Notes</th>
|
|
41
41
|
</tr>
|
|
42
|
+
<tr>
|
|
43
|
+
<td>1.3.0</td>
|
|
44
|
+
<td>2026-07-30</td>
|
|
45
|
+
<td>
|
|
46
|
+
<a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v130">
|
|
47
|
+
1.3.0 Release Notes
|
|
48
|
+
</a>
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td>1.2.0</td>
|
|
53
|
+
<td>2026-07-17</td>
|
|
54
|
+
<td>
|
|
55
|
+
<a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v120">
|
|
56
|
+
1.2.0 Release Notes
|
|
57
|
+
</a>
|
|
58
|
+
</td>
|
|
59
|
+
</tr>
|
|
42
60
|
<tr>
|
|
43
61
|
<td>1.1.0</td>
|
|
44
62
|
<td>2026-06-19</td>
|
|
@@ -57,6 +75,15 @@ This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehe
|
|
|
57
75
|
</a>
|
|
58
76
|
</td>
|
|
59
77
|
</tr>
|
|
78
|
+
<tr>
|
|
79
|
+
<td>0.9.1</td>
|
|
80
|
+
<td>2026-05-04</td>
|
|
81
|
+
<td>
|
|
82
|
+
<a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v091">
|
|
83
|
+
0.9.1 Release Notes
|
|
84
|
+
</a>
|
|
85
|
+
</td>
|
|
86
|
+
</tr>
|
|
60
87
|
<tr>
|
|
61
88
|
<td>0.9.0</td>
|
|
62
89
|
<td>2026-04-15</td>
|
|
@@ -122,11 +149,14 @@ We offer the following PyPI packages to create conversational experiences based
|
|
|
122
149
|
| `microsoft-agents-activity` | [](https://pypi.org/project/microsoft-agents-activity/) | Types and validators implementing the Activity protocol spec. |
|
|
123
150
|
| `microsoft-agents-hosting-core` | [](https://pypi.org/project/microsoft-agents-hosting-core/) | Core library for Microsoft Agents hosting. |
|
|
124
151
|
| `microsoft-agents-hosting-aiohttp` | [](https://pypi.org/project/microsoft-agents-hosting-aiohttp/) | Configures aiohttp to run the Agent. |
|
|
125
|
-
| `microsoft-agents-hosting-
|
|
152
|
+
| `microsoft-agents-hosting-fastapi` | [](https://pypi.org/project/microsoft-agents-hosting-fastapi/) | Configures fastapi to run the Agent. |
|
|
153
|
+
| `microsoft-agents-hosting-msteams` | [](https://pypi.org/project/microsoft-agents-hosting-msteams/) | Provides classes to host an Agent for Teams. |
|
|
126
154
|
| `microsoft-agents-hosting-dialogs` | [](https://pypi.org/project/microsoft-agents-hosting-dialogs/) | Dialog system with waterfall dialogs, prompts, and multi-turn conversation management. |
|
|
155
|
+
| `microsoft-agents-hosting-slack` | [](https://pypi.org/project/microsoft-agents-hosting-slack/) | Provides classes to host an Agent for Slack. |
|
|
127
156
|
| `microsoft-agents-storage-blob` | [](https://pypi.org/project/microsoft-agents-storage-blob/) | Extension to use Azure Blob as storage. |
|
|
128
157
|
| `microsoft-agents-storage-cosmos` | [](https://pypi.org/project/microsoft-agents-storage-cosmos/) | Extension to use CosmosDB as storage. |
|
|
129
158
|
| `microsoft-agents-authentication-msal` | [](https://pypi.org/project/microsoft-agents-authentication-msal/) | MSAL-based authentication for Microsoft Agents. |
|
|
159
|
+
| `microsoft-agents-authentication-entra-auth-sidecar` | [](https://pypi.org/project/microsoft-agents-authentication-entra-auth-sidecar/) | Credential-free Entra ID Agent ID authentication via the sidecar. |
|
|
130
160
|
|
|
131
161
|
Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio:
|
|
132
162
|
|
|
@@ -5,6 +5,7 @@ pyproject.toml
|
|
|
5
5
|
readme.md
|
|
6
6
|
setup.py
|
|
7
7
|
microsoft_agents/hosting/aiohttp/__init__.py
|
|
8
|
+
microsoft_agents/hosting/aiohttp/_aiohttp_request_adapter.py
|
|
8
9
|
microsoft_agents/hosting/aiohttp/_start_agent_process.py
|
|
9
10
|
microsoft_agents/hosting/aiohttp/agent_http_adapter.py
|
|
10
11
|
microsoft_agents/hosting/aiohttp/channel_service_route_table.py
|
|
@@ -17,6 +17,24 @@ This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehe
|
|
|
17
17
|
<th style="width:20%">Date</th>
|
|
18
18
|
<th style="width:60%">Release Notes</th>
|
|
19
19
|
</tr>
|
|
20
|
+
<tr>
|
|
21
|
+
<td>1.3.0</td>
|
|
22
|
+
<td>2026-07-30</td>
|
|
23
|
+
<td>
|
|
24
|
+
<a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v130">
|
|
25
|
+
1.3.0 Release Notes
|
|
26
|
+
</a>
|
|
27
|
+
</td>
|
|
28
|
+
</tr>
|
|
29
|
+
<tr>
|
|
30
|
+
<td>1.2.0</td>
|
|
31
|
+
<td>2026-07-17</td>
|
|
32
|
+
<td>
|
|
33
|
+
<a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v120">
|
|
34
|
+
1.2.0 Release Notes
|
|
35
|
+
</a>
|
|
36
|
+
</td>
|
|
37
|
+
</tr>
|
|
20
38
|
<tr>
|
|
21
39
|
<td>1.1.0</td>
|
|
22
40
|
<td>2026-06-19</td>
|
|
@@ -35,6 +53,15 @@ This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehe
|
|
|
35
53
|
</a>
|
|
36
54
|
</td>
|
|
37
55
|
</tr>
|
|
56
|
+
<tr>
|
|
57
|
+
<td>0.9.1</td>
|
|
58
|
+
<td>2026-05-04</td>
|
|
59
|
+
<td>
|
|
60
|
+
<a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v091">
|
|
61
|
+
0.9.1 Release Notes
|
|
62
|
+
</a>
|
|
63
|
+
</td>
|
|
64
|
+
</tr>
|
|
38
65
|
<tr>
|
|
39
66
|
<td>0.9.0</td>
|
|
40
67
|
<td>2026-04-15</td>
|
|
@@ -100,11 +127,14 @@ We offer the following PyPI packages to create conversational experiences based
|
|
|
100
127
|
| `microsoft-agents-activity` | [](https://pypi.org/project/microsoft-agents-activity/) | Types and validators implementing the Activity protocol spec. |
|
|
101
128
|
| `microsoft-agents-hosting-core` | [](https://pypi.org/project/microsoft-agents-hosting-core/) | Core library for Microsoft Agents hosting. |
|
|
102
129
|
| `microsoft-agents-hosting-aiohttp` | [](https://pypi.org/project/microsoft-agents-hosting-aiohttp/) | Configures aiohttp to run the Agent. |
|
|
103
|
-
| `microsoft-agents-hosting-
|
|
130
|
+
| `microsoft-agents-hosting-fastapi` | [](https://pypi.org/project/microsoft-agents-hosting-fastapi/) | Configures fastapi to run the Agent. |
|
|
131
|
+
| `microsoft-agents-hosting-msteams` | [](https://pypi.org/project/microsoft-agents-hosting-msteams/) | Provides classes to host an Agent for Teams. |
|
|
104
132
|
| `microsoft-agents-hosting-dialogs` | [](https://pypi.org/project/microsoft-agents-hosting-dialogs/) | Dialog system with waterfall dialogs, prompts, and multi-turn conversation management. |
|
|
133
|
+
| `microsoft-agents-hosting-slack` | [](https://pypi.org/project/microsoft-agents-hosting-slack/) | Provides classes to host an Agent for Slack. |
|
|
105
134
|
| `microsoft-agents-storage-blob` | [](https://pypi.org/project/microsoft-agents-storage-blob/) | Extension to use Azure Blob as storage. |
|
|
106
135
|
| `microsoft-agents-storage-cosmos` | [](https://pypi.org/project/microsoft-agents-storage-cosmos/) | Extension to use CosmosDB as storage. |
|
|
107
136
|
| `microsoft-agents-authentication-msal` | [](https://pypi.org/project/microsoft-agents-authentication-msal/) | MSAL-based authentication for Microsoft Agents. |
|
|
137
|
+
| `microsoft-agents-authentication-entra-auth-sidecar` | [](https://pypi.org/project/microsoft-agents-authentication-entra-auth-sidecar/) | Credential-free Entra ID Agent ID authentication via the sidecar. |
|
|
108
138
|
|
|
109
139
|
Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio:
|
|
110
140
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.2.0.dev20
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import functools
|
|
2
|
-
from aiohttp.web import Request, middleware, json_response
|
|
3
|
-
|
|
4
|
-
from microsoft_agents.hosting.core.authorization import (
|
|
5
|
-
AgentAuthConfiguration,
|
|
6
|
-
JwtTokenValidator,
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@middleware
|
|
11
|
-
async def jwt_authorization_middleware(request: Request, handler):
|
|
12
|
-
|
|
13
|
-
auth_config: AgentAuthConfiguration = request.app["agent_configuration"]
|
|
14
|
-
token_validator = JwtTokenValidator(auth_config)
|
|
15
|
-
auth_header = request.headers.get("Authorization")
|
|
16
|
-
|
|
17
|
-
if auth_header:
|
|
18
|
-
# Extract the token from the Authorization header
|
|
19
|
-
token = auth_header.split(" ")[1]
|
|
20
|
-
try:
|
|
21
|
-
claims = await token_validator.validate_token(token)
|
|
22
|
-
request["claims_identity"] = claims
|
|
23
|
-
except ValueError as e:
|
|
24
|
-
print(f"JWT validation error: {e}")
|
|
25
|
-
return json_response({"error": str(e)}, status=401)
|
|
26
|
-
else:
|
|
27
|
-
if auth_config.ANONYMOUS_ALLOWED:
|
|
28
|
-
request["claims_identity"] = token_validator.get_anonymous_claims()
|
|
29
|
-
else:
|
|
30
|
-
return json_response(
|
|
31
|
-
{"error": "Authorization header not found"}, status=401
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
return await handler(request)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def jwt_authorization_decorator(func):
|
|
38
|
-
@functools.wraps(func)
|
|
39
|
-
async def wrapper(request):
|
|
40
|
-
auth_config: AgentAuthConfiguration = request.app["agent_configuration"]
|
|
41
|
-
token_validator = JwtTokenValidator(auth_config)
|
|
42
|
-
auth_header = request.headers.get("Authorization")
|
|
43
|
-
if auth_header:
|
|
44
|
-
# Extract the token from the Authorization header
|
|
45
|
-
token = auth_header.split(" ")[1]
|
|
46
|
-
try:
|
|
47
|
-
claims = await token_validator.validate_token(token)
|
|
48
|
-
request["claims_identity"] = claims
|
|
49
|
-
except ValueError as e:
|
|
50
|
-
print(f"JWT validation error: {e}")
|
|
51
|
-
return json_response({"error": str(e)}, status=401)
|
|
52
|
-
else:
|
|
53
|
-
if not auth_config.CLIENT_ID:
|
|
54
|
-
# TODO: Refine anonymous strategy
|
|
55
|
-
request["claims_identity"] = token_validator.get_anonymous_claims()
|
|
56
|
-
else:
|
|
57
|
-
return json_response(
|
|
58
|
-
{"error": "Authorization header not found"}, status=401
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
return await func(request)
|
|
62
|
-
|
|
63
|
-
return wrapper
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|