microsoft-agents-hosting-core 0.9.0.dev1__tar.gz → 0.9.0.dev2__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.
Files changed (122) hide show
  1. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/PKG-INFO +2 -2
  2. microsoft_agents_hosting_core-0.9.0.dev2/VERSION.txt +1 -0
  3. microsoft_agents_hosting_core-0.9.0.dev2/microsoft_agents/hosting/core/authorization/jwt_token_validator.py +116 -0
  4. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents_hosting_core.egg-info/PKG-INFO +2 -2
  5. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents_hosting_core.egg-info/requires.txt +1 -1
  6. microsoft_agents_hosting_core-0.9.0.dev1/VERSION.txt +0 -1
  7. microsoft_agents_hosting_core-0.9.0.dev1/microsoft_agents/hosting/core/authorization/jwt_token_validator.py +0 -56
  8. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/LICENSE +0 -0
  9. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/MANIFEST.in +0 -0
  10. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/__init__.py +0 -0
  11. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/_oauth/__init__.py +0 -0
  12. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
  13. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
  14. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +0 -0
  15. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/activity_handler.py +0 -0
  16. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/agent.py +0 -0
  17. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/__init__.py +0 -0
  18. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/_routes/__init__.py +0 -0
  19. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/_routes/_route.py +0 -0
  20. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/_routes/_route_list.py +0 -0
  21. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/_routes/route_rank.py +0 -0
  22. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/_type_defs.py +0 -0
  23. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/agent_application.py +0 -0
  24. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/app_error.py +0 -0
  25. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/app_options.py +0 -0
  26. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/input_file.py +0 -0
  27. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/oauth/__init__.py +0 -0
  28. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +0 -0
  29. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +0 -0
  30. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +0 -0
  31. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +0 -0
  32. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/oauth/_handlers/connector_user_authorization.py +0 -0
  33. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +0 -0
  34. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +0 -0
  35. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +0 -0
  36. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/oauth/authorization.py +0 -0
  37. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/query.py +0 -0
  38. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
  39. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
  40. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/state/state.py +0 -0
  41. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
  42. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -0
  43. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/streaming/__init__.py +0 -0
  44. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/streaming/citation.py +0 -0
  45. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/streaming/citation_util.py +0 -0
  46. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/streaming/streaming_response.py +0 -0
  47. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/app/typing_indicator.py +0 -0
  48. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/authorization/__init__.py +0 -0
  49. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +0 -0
  50. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +0 -0
  51. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +0 -0
  52. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/authorization/auth_types.py +0 -0
  53. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/authorization/authentication_constants.py +0 -0
  54. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/authorization/claims_identity.py +0 -0
  55. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/authorization/connections.py +0 -0
  56. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/card_factory.py +0 -0
  57. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/channel_adapter.py +0 -0
  58. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +0 -0
  59. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/channel_service_adapter.py +0 -0
  60. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +0 -0
  61. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/__init__.py +0 -0
  62. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +0 -0
  63. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +0 -0
  64. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/channel_host_protocol.py +0 -0
  65. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/channel_info_protocol.py +0 -0
  66. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/channel_protocol.py +0 -0
  67. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/channels_configuration.py +0 -0
  68. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/configuration_channel_host.py +0 -0
  69. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/conversation_constants.py +0 -0
  70. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/conversation_id_factory.py +0 -0
  71. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +0 -0
  72. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +0 -0
  73. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/http_agent_channel.py +0 -0
  74. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +0 -0
  75. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/__init__.py +0 -0
  76. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
  77. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
  78. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/client/__init__.py +0 -0
  79. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/client/connector_client.py +0 -0
  80. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/client/user_token_client.py +0 -0
  81. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/connector_client_base.py +0 -0
  82. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
  83. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
  84. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/mcs/__init__.py +0 -0
  85. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/mcs/mcs_connector_client.py +0 -0
  86. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
  87. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
  88. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
  89. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -0
  90. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/errors/__init__.py +0 -0
  91. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/errors/error_resources.py +0 -0
  92. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/http/__init__.py +0 -0
  93. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/http/_channel_service_routes.py +0 -0
  94. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/http/_http_adapter_base.py +0 -0
  95. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/http/_http_request_protocol.py +0 -0
  96. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/http/_http_response.py +0 -0
  97. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/message_factory.py +0 -0
  98. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/middleware_set.py +0 -0
  99. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +0 -0
  100. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/state/__init__.py +0 -0
  101. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
  102. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
  103. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/state/user_state.py +0 -0
  104. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/storage/__init__.py +0 -0
  105. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -0
  106. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/storage/error_handling.py +0 -0
  107. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/storage/memory_storage.py +0 -0
  108. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/storage/storage.py +0 -0
  109. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/storage/store_item.py +0 -0
  110. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/storage/transcript_file_store.py +0 -0
  111. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/storage/transcript_info.py +0 -0
  112. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/storage/transcript_logger.py +0 -0
  113. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/storage/transcript_memory_store.py +0 -0
  114. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/storage/transcript_store.py +0 -0
  115. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents/hosting/core/turn_context.py +0 -0
  116. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +0 -0
  117. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
  118. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
  119. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/pyproject.toml +0 -0
  120. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/readme.md +0 -0
  121. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/setup.cfg +0 -0
  122. {microsoft_agents_hosting_core-0.9.0.dev1 → microsoft_agents_hosting_core-0.9.0.dev2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 0.9.0.dev1
3
+ Version: 0.9.0.dev2
4
4
  Summary: Core library for Microsoft Agents
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-activity==0.9.0.dev1
18
+ Requires-Dist: microsoft-agents-activity==0.9.0.dev2
19
19
  Requires-Dist: pyjwt>=2.10.1
20
20
  Requires-Dist: isodate>=0.6.1
21
21
  Requires-Dist: azure-core>=1.30.0
@@ -0,0 +1 @@
1
+ 0.9.0.dev2
@@ -0,0 +1,116 @@
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License.
3
+
4
+ import asyncio
5
+ import logging
6
+ import threading
7
+ from typing import Any
8
+ from dataclasses import dataclass
9
+
10
+ from jwt import PyJWKClient, PyJWK, decode, get_unverified_header
11
+
12
+ from .agent_auth_configuration import AgentAuthConfiguration
13
+ from .claims_identity import ClaimsIdentity
14
+
15
+ logger = logging.getLogger(__name__)
16
+
17
+
18
+ @dataclass
19
+ class _JwkClientCacheEntry:
20
+
21
+ jwk_client: PyJWKClient
22
+ lock: threading.Lock
23
+
24
+
25
+ class _JwkClientManager:
26
+ """Helper class to manage PyJWKClient instances for different JWKS URIs, with caching and async-safety"""
27
+
28
+ _cache: dict[str, _JwkClientCacheEntry]
29
+
30
+ def __init__(self):
31
+ self._cache = {}
32
+
33
+ def _get_jwk_client(self, jwks_uri: str) -> _JwkClientCacheEntry:
34
+ """Retrieves a PyJWKClient for the given JWKS URI, using a cache to avoid creating multiple clients for the same URI."""
35
+ if jwks_uri not in self._cache:
36
+ self._cache[jwks_uri] = _JwkClientCacheEntry(
37
+ PyJWKClient(jwks_uri), threading.Lock()
38
+ )
39
+ return self._cache[jwks_uri]
40
+
41
+ async def get_signing_key(self, jwks_uri: str, header: dict[str, Any]) -> PyJWK:
42
+ """Retrieves the signing key from the JWK client for the given token header."""
43
+
44
+ jwk_cache_entry = self._get_jwk_client(jwks_uri)
45
+
46
+ # locking and creating a new thread seems strange,
47
+ # but PyJWKClient.get_signing_key is synchronous, so we spawn another thread
48
+ # to make the call non-blocking, allowing other queued coroutines to run in the meantime.
49
+ # Meanwhile, the lock ensures safety for the PyJWKClient's underlying cache and
50
+ # prevents duplicate calls to the JWKS endpoint for the same URI when multiple
51
+ # coroutines are trying to get signing keys concurrently.
52
+
53
+ def _helper():
54
+ with jwk_cache_entry.lock:
55
+ return jwk_cache_entry.jwk_client.get_signing_key(header["kid"])
56
+
57
+ key = await asyncio.to_thread(_helper)
58
+ return key
59
+
60
+
61
+ class JwtTokenValidator:
62
+ """Utility class for validating JWT tokens using the PyJWT library and JWKs from a specified URI."""
63
+
64
+ _jwk_client_manager = _JwkClientManager()
65
+
66
+ def __init__(self, configuration: AgentAuthConfiguration):
67
+ """Initializes the JwtTokenValidator with the given configuration.
68
+
69
+ :param configuration: An instance of AgentAuthConfiguration containing the necessary settings for token validation.
70
+ """
71
+ self.configuration = configuration
72
+
73
+ async def validate_token(self, token: str) -> ClaimsIdentity:
74
+ """Validates a JWT token.
75
+
76
+ :param token: The JWT token to validate.
77
+ :return: A ClaimsIdentity object containing the token's claims if validation is successful.
78
+ :raises ValueError: If the token is invalid or if the audience claim is not valid
79
+ """
80
+
81
+ logger.debug("Validating JWT token.")
82
+ key = await self._get_public_key_or_secret(token)
83
+ decoded_token = decode(
84
+ token,
85
+ key=key,
86
+ algorithms=["RS256"],
87
+ leeway=300.0,
88
+ options={"verify_aud": False},
89
+ )
90
+ if not self.configuration._jwt_patch_is_valid_aud(decoded_token["aud"]):
91
+ logger.error(f"Invalid audience: {decoded_token['aud']}", stack_info=True)
92
+ raise ValueError("Invalid audience.")
93
+
94
+ # This probably should return a ClaimsIdentity
95
+ logger.debug("JWT token validated successfully.")
96
+ return ClaimsIdentity(decoded_token, True, security_token=token)
97
+
98
+ def get_anonymous_claims(self) -> ClaimsIdentity:
99
+ """Returns a ClaimsIdentity for an anonymous user."""
100
+ logger.debug("Returning anonymous claims identity.")
101
+ return ClaimsIdentity({}, False, authentication_type="Anonymous")
102
+
103
+ async def _get_public_key_or_secret(self, token: str) -> PyJWK:
104
+ """Retrieves the public key or secret for validating the JWT token."""
105
+ header = get_unverified_header(token)
106
+ unverified_payload: dict = decode(token, options={"verify_signature": False})
107
+
108
+ jwks_uri = (
109
+ "https://login.botframework.com/v1/.well-known/keys"
110
+ if unverified_payload.get("iss") == "https://api.botframework.com"
111
+ else f"https://login.microsoftonline.com/{self.configuration.TENANT_ID}/discovery/v2.0/keys"
112
+ )
113
+
114
+ key = await self._jwk_client_manager.get_signing_key(jwks_uri, header)
115
+
116
+ return key
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 0.9.0.dev1
3
+ Version: 0.9.0.dev2
4
4
  Summary: Core library for Microsoft Agents
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-activity==0.9.0.dev1
18
+ Requires-Dist: microsoft-agents-activity==0.9.0.dev2
19
19
  Requires-Dist: pyjwt>=2.10.1
20
20
  Requires-Dist: isodate>=0.6.1
21
21
  Requires-Dist: azure-core>=1.30.0
@@ -1,4 +1,4 @@
1
- microsoft-agents-activity==0.9.0.dev1
1
+ microsoft-agents-activity==0.9.0.dev2
2
2
  pyjwt>=2.10.1
3
3
  isodate>=0.6.1
4
4
  azure-core>=1.30.0
@@ -1 +0,0 @@
1
- 0.9.0.dev1
@@ -1,56 +0,0 @@
1
- # Copyright (c) Microsoft Corporation. All rights reserved.
2
- # Licensed under the MIT License.
3
-
4
- import asyncio
5
- import logging
6
- import jwt
7
-
8
- from jwt import PyJWKClient, PyJWK, decode, get_unverified_header
9
-
10
- from .agent_auth_configuration import AgentAuthConfiguration
11
- from .claims_identity import ClaimsIdentity
12
-
13
- logger = logging.getLogger(__name__)
14
-
15
-
16
- class JwtTokenValidator:
17
- def __init__(self, configuration: AgentAuthConfiguration):
18
- self.configuration = configuration
19
-
20
- async def validate_token(self, token: str) -> ClaimsIdentity:
21
-
22
- logger.debug("Validating JWT token.")
23
- key = await self._get_public_key_or_secret(token)
24
- decoded_token = jwt.decode(
25
- token,
26
- key=key,
27
- algorithms=["RS256"],
28
- leeway=300.0,
29
- options={"verify_aud": False},
30
- )
31
- if not self.configuration._jwt_patch_is_valid_aud(decoded_token["aud"]):
32
- logger.error(f"Invalid audience: {decoded_token['aud']}", stack_info=True)
33
- raise ValueError("Invalid audience.")
34
-
35
- # This probably should return a ClaimsIdentity
36
- logger.debug("JWT token validated successfully.")
37
- return ClaimsIdentity(decoded_token, True, security_token=token)
38
-
39
- def get_anonymous_claims(self) -> ClaimsIdentity:
40
- logger.debug("Returning anonymous claims identity.")
41
- return ClaimsIdentity({}, False, authentication_type="Anonymous")
42
-
43
- async def _get_public_key_or_secret(self, token: str) -> PyJWK:
44
- header = get_unverified_header(token)
45
- unverified_payload: dict = decode(token, options={"verify_signature": False})
46
-
47
- jwksUri = (
48
- "https://login.botframework.com/v1/.well-known/keys"
49
- if unverified_payload.get("iss") == "https://api.botframework.com"
50
- else f"https://login.microsoftonline.com/{self.configuration.TENANT_ID}/discovery/v2.0/keys"
51
- )
52
- jwks_client = PyJWKClient(jwksUri)
53
-
54
- key = await asyncio.to_thread(jwks_client.get_signing_key, header["kid"])
55
-
56
- return key