microsoft-agents-hosting-core 1.9.0.dev1__tar.gz → 1.9.0.dev5__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_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/PKG-INFO +3 -3
- microsoft_agents_hosting_core-1.9.0.dev5/VERSION.txt +1 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/__init__.py +3 -1
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/_http_adapter_base.py +3 -3
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/_utils/__init__.py +1 -3
- microsoft_agents_hosting_core-1.9.0.dev5/microsoft_agents/hosting/core/_utils/_turn_context_wrapper.py +149 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/__init__.py +1 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/attachment_downloader.py +43 -19
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/m365_attachment_downloader.py +48 -21
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/streaming/streaming_response.py +44 -18
- microsoft_agents_hosting_core-1.9.0.dev5/microsoft_agents/hosting/core/security/__init__.py +14 -0
- microsoft_agents_hosting_core-1.9.0.dev5/microsoft_agents/hosting/core/security/_connector.py +58 -0
- microsoft_agents_hosting_core-1.9.0.dev5/microsoft_agents/hosting/core/security/_middleware.py +31 -0
- microsoft_agents_hosting_core-1.9.0.dev5/microsoft_agents/hosting/core/security/_utils.py +76 -0
- microsoft_agents_hosting_core-1.9.0.dev5/microsoft_agents/hosting/core/security/_validator.py +35 -0
- microsoft_agents_hosting_core-1.9.0.dev5/microsoft_agents/hosting/core/security/outbound_host_validator.py +242 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents_hosting_core.egg-info/PKG-INFO +3 -3
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +7 -1
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents_hosting_core.egg-info/requires.txt +2 -2
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/setup.py +1 -1
- microsoft_agents_hosting_core-1.9.0.dev1/VERSION.txt +0 -1
- microsoft_agents_hosting_core-1.9.0.dev1/microsoft_agents/hosting/core/outbound_host_validator.py +0 -117
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/LICENSE +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/MANIFEST.in +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/_oauth/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/_utils/_service_set.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/activity_handler.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/agent.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/_routes/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/_routes/_route.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/_routes/_route_list.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/_routes/route_rank.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/_type_defs.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/_utils.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/adaptive_card/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/adaptive_card/_type_defs.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/adaptive_card/adaptive_card.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/adaptive_card/factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/adaptive_card/models.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/agent_application.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/app_error.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/app_options.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/input_file.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/_handlers/connector_user_authorization.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/authorization.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/oauth/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/proactive/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/proactive/conversation.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/proactive/conversation_builder.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/proactive/conversation_reference_builder.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/proactive/create_conversation_options.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/proactive/proactive.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/proactive/proactive_options.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/proactive/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/proactive/telemetry/_utils.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/proactive/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/proactive/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/query.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/state/state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/streaming/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/streaming/citation.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/streaming/citation_util.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/app/typing_indicator.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/_entra_issuers.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/_helpers.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/_log_config.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/auth_types.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/authentication_constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/claims_identity.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/connection_manager.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/connection_settings_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/connections.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/jwt/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/jwt/_authorize_request.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/jwt/jwt_token_validator.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/authorization/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/card_factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/channel_adapter.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/channel_service_adapter.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/channel_host_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/channel_info_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/channel_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/channels_configuration.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/configuration_channel_host.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/conversation_constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/conversation_id_factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/http_agent_channel.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/_utils.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/client/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/client/_base_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/client/agent_sign_in.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/client/connector_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/client/user_token.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/client/user_token_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/connector_client_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/mcs/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/mcs/mcs_connector_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/_request_span_wrapper.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/connector_spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/user_token_client_spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/errors/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/errors/error_resources.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/header_propagation/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/header_propagation/agentic_header_provider.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/header_propagation/header_propagation_context.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/header_propagation/header_value_provider.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/http/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/http/_channel_service_routes.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/http/_http_request_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/http/_http_response.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/message_factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/middleware_set.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/py.typed +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/state/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/state/user_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/error_handling.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/memory_storage.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/storage.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/store_item.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/transcript/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/transcript/transcript_file_store.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/transcript/transcript_info.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/transcript/transcript_logger.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/transcript/transcript_memory_store.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/storage/transcript/transcript_store.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/adapter/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/adapter/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/adapter/metrics.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/adapter/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/attributes.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/core/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/core/_agents_telemetry.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/core/base_span_wrapper.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/core/resource.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/core/simple_span_wrapper.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/core/type_defs.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/turn_context/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/turn_context/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/turn_context/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/telemetry/utils.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents/hosting/core/turn_context.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/pyproject.toml +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/readme.md +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/setup.cfg +0 -0
{microsoft_agents_hosting_core-1.9.0.dev1 → microsoft_agents_hosting_core-1.9.0.dev5}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-core
|
|
3
|
-
Version: 1.9.0.
|
|
3
|
+
Version: 1.9.0.dev5
|
|
4
4
|
Summary: Core library for Microsoft Agents
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -15,13 +15,13 @@ 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==1.9.0.
|
|
18
|
+
Requires-Dist: microsoft-agents-activity==1.9.0.dev5
|
|
19
19
|
Requires-Dist: pyjwt>=2.10.1
|
|
20
20
|
Requires-Dist: isodate>=0.6.1
|
|
21
21
|
Requires-Dist: python-dotenv>=1.1.1
|
|
22
22
|
Requires-Dist: opentelemetry-api>=1.27.0
|
|
23
23
|
Requires-Dist: opentelemetry-sdk>=1.27.0
|
|
24
|
-
Requires-Dist: aiohttp>=3.
|
|
24
|
+
Requires-Dist: aiohttp>=3.12
|
|
25
25
|
Requires-Dist: yarl<2.0,>=1.17.0
|
|
26
26
|
Requires-Dist: azure-core
|
|
27
27
|
Dynamic: license-file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.9.0.dev5
|
|
@@ -9,7 +9,9 @@ from .message_factory import MessageFactory
|
|
|
9
9
|
from .middleware_set import Middleware, MiddlewareSet
|
|
10
10
|
from .rest_channel_service_client_factory import RestChannelServiceClientFactory
|
|
11
11
|
from .turn_context import TurnContext
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
# Security
|
|
14
|
+
from .security import OutboundHostValidator
|
|
13
15
|
|
|
14
16
|
# HTTP abstractions
|
|
15
17
|
from .http import (
|
|
@@ -23,7 +23,7 @@ from .http._http_response import HttpResponse, HttpResponseFactory
|
|
|
23
23
|
from .message_factory import MessageFactory
|
|
24
24
|
from .rest_channel_service_client_factory import RestChannelServiceClientFactory
|
|
25
25
|
from .turn_context import TurnContext
|
|
26
|
-
from .
|
|
26
|
+
from .security import OutboundHostValidator, _try_create_url
|
|
27
27
|
|
|
28
28
|
logger = logging.getLogger(__name__)
|
|
29
29
|
|
|
@@ -80,7 +80,7 @@ class HttpAdapterBase(ChannelServiceAdapter, ABC):
|
|
|
80
80
|
connection_manager,
|
|
81
81
|
**(channel_service_client_factory_options or {}),
|
|
82
82
|
)
|
|
83
|
-
self._host_validator = host_validator or OutboundHostValidator()
|
|
83
|
+
self._host_validator = host_validator or OutboundHostValidator(enabled=False)
|
|
84
84
|
|
|
85
85
|
super().__init__(factory)
|
|
86
86
|
|
|
@@ -205,7 +205,7 @@ class HttpAdapterBase(ChannelServiceAdapter, ABC):
|
|
|
205
205
|
or not activity_url
|
|
206
206
|
or claim_url_host.casefold() != activity_url_host.casefold()
|
|
207
207
|
):
|
|
208
|
-
if self._host_validator
|
|
208
|
+
if self._host_validator.enabled:
|
|
209
209
|
logger.warning(
|
|
210
210
|
"Service URL host mismatch: %s vs %s",
|
|
211
211
|
claim_url_host,
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from abc import ABC
|
|
5
|
+
|
|
6
|
+
from typing import Awaitable, Callable
|
|
7
|
+
|
|
8
|
+
from microsoft_agents.activity import (
|
|
9
|
+
Activity,
|
|
10
|
+
ResourceResponse,
|
|
11
|
+
ConversationReference,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
from microsoft_agents.hosting.core.turn_context import (
|
|
15
|
+
TurnContext,
|
|
16
|
+
OnSendActivitiesHandler,
|
|
17
|
+
OnUpdateActivityHandler,
|
|
18
|
+
OnDeleteActivityHandler,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class _TurnContextWrapper(TurnContext, ABC):
|
|
23
|
+
"""A base class for wrapping a TurnContext with additional functionality."""
|
|
24
|
+
|
|
25
|
+
def __init__(self, context: TurnContext) -> None:
|
|
26
|
+
"""Initialise the turn context from a plain turn context.
|
|
27
|
+
|
|
28
|
+
:param context: The base turn context provided by the core runtime.
|
|
29
|
+
"""
|
|
30
|
+
super().__init__(context)
|
|
31
|
+
|
|
32
|
+
self._original = context
|
|
33
|
+
self._turn_state = context.turn_state
|
|
34
|
+
self.buffered_reply_activities = context.buffered_reply_activities
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def responded(self) -> bool:
|
|
38
|
+
return self._original.responded
|
|
39
|
+
|
|
40
|
+
@responded.setter
|
|
41
|
+
def responded(self, value: bool):
|
|
42
|
+
self._original.responded = value
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def streaming_response(self):
|
|
46
|
+
return self._original.streaming_response
|
|
47
|
+
|
|
48
|
+
async def send_activity(
|
|
49
|
+
self,
|
|
50
|
+
activity_or_text: Activity | str,
|
|
51
|
+
speak: str | None = None,
|
|
52
|
+
input_hint: str | None = None,
|
|
53
|
+
) -> ResourceResponse:
|
|
54
|
+
"""
|
|
55
|
+
Send an activity to the conversation.
|
|
56
|
+
|
|
57
|
+
:param activity_or_text: The activity to send or a string representing the text of the activity.
|
|
58
|
+
:param speak: Optional speech text for the activity.
|
|
59
|
+
:param input_hint: Optional input hint for the activity.
|
|
60
|
+
:return: A ResourceResponse representing the result of the send operation.
|
|
61
|
+
"""
|
|
62
|
+
return await self._original.send_activity(
|
|
63
|
+
activity_or_text, speak=speak, input_hint=input_hint
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
async def send_activities(
|
|
67
|
+
self, activities: list[Activity]
|
|
68
|
+
) -> list[ResourceResponse]:
|
|
69
|
+
"""
|
|
70
|
+
Send multiple activities to the conversation.
|
|
71
|
+
|
|
72
|
+
:param activities: A list of activities to send.
|
|
73
|
+
:return: A list of ResourceResponse objects representing the result of each send operation.
|
|
74
|
+
"""
|
|
75
|
+
return await self._original.send_activities(activities)
|
|
76
|
+
|
|
77
|
+
async def update_activity(self, activity: Activity):
|
|
78
|
+
"""
|
|
79
|
+
Replaces an existing activity.
|
|
80
|
+
:param activity:
|
|
81
|
+
:return:
|
|
82
|
+
"""
|
|
83
|
+
return await self._original.update_activity(activity)
|
|
84
|
+
|
|
85
|
+
async def delete_activity(self, id_or_reference: str | ConversationReference):
|
|
86
|
+
"""
|
|
87
|
+
Deletes an existing activity.
|
|
88
|
+
:param id_or_reference:
|
|
89
|
+
:return:
|
|
90
|
+
"""
|
|
91
|
+
return await self._original.delete_activity(id_or_reference)
|
|
92
|
+
|
|
93
|
+
def on_send_activities(self, handler: OnSendActivitiesHandler) -> TurnContext:
|
|
94
|
+
"""
|
|
95
|
+
Registers a handler to be notified of and potentially intercept the sending of activities.
|
|
96
|
+
:param handler: the handler to register
|
|
97
|
+
:type handler: OnSendActivitiesHandler
|
|
98
|
+
:return:
|
|
99
|
+
"""
|
|
100
|
+
self._original.on_send_activities(handler)
|
|
101
|
+
return self
|
|
102
|
+
|
|
103
|
+
def on_update_activity(self, handler: OnUpdateActivityHandler) -> TurnContext:
|
|
104
|
+
"""
|
|
105
|
+
Registers a handler to be notified of and potentially intercept an activity being updated.
|
|
106
|
+
:param handler: the handler to register
|
|
107
|
+
:type handler: OnUpdateActivityHandler
|
|
108
|
+
:return:
|
|
109
|
+
"""
|
|
110
|
+
self._original.on_update_activity(handler)
|
|
111
|
+
return self
|
|
112
|
+
|
|
113
|
+
def on_delete_activity(self, handler: OnDeleteActivityHandler) -> TurnContext:
|
|
114
|
+
"""
|
|
115
|
+
Registers a handler to be notified of and potentially intercept an activity being deleted.
|
|
116
|
+
:param handler: the handler to register
|
|
117
|
+
:type handler: OnDeleteActivityHandler
|
|
118
|
+
:return:
|
|
119
|
+
"""
|
|
120
|
+
self._original.on_delete_activity(handler)
|
|
121
|
+
return self
|
|
122
|
+
|
|
123
|
+
async def send_trace_activity(
|
|
124
|
+
self,
|
|
125
|
+
name: str,
|
|
126
|
+
value: object = None,
|
|
127
|
+
value_type: str | None = None,
|
|
128
|
+
label: str | None = None,
|
|
129
|
+
) -> ResourceResponse:
|
|
130
|
+
return await self._original.send_trace_activity(
|
|
131
|
+
name=name, value=value, value_type=value_type, label=label
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
async def _aclose(self) -> None:
|
|
135
|
+
"""
|
|
136
|
+
Asynchronously close any resources associated with the turn context.
|
|
137
|
+
|
|
138
|
+
:return: None
|
|
139
|
+
"""
|
|
140
|
+
await self._original._aclose()
|
|
141
|
+
|
|
142
|
+
def _on_aclose(self, handler: Callable[[TurnContext], Awaitable[None]]) -> None:
|
|
143
|
+
"""
|
|
144
|
+
Register a handler to be called when the turn context is asynchronously closed.
|
|
145
|
+
|
|
146
|
+
:param handler: A callable that takes the turn context and returns an awaitable.
|
|
147
|
+
:return: None
|
|
148
|
+
"""
|
|
149
|
+
self._original._on_aclose(handler)
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
# Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
import json
|
|
5
|
-
|
|
5
|
+
import logging
|
|
6
|
+
from typing import Any, Callable
|
|
6
7
|
|
|
7
8
|
import aiohttp
|
|
8
9
|
|
|
@@ -13,27 +14,40 @@ from microsoft_agents.activity import (
|
|
|
13
14
|
)
|
|
14
15
|
|
|
15
16
|
from microsoft_agents.hosting.core.turn_context import TurnContext
|
|
16
|
-
from microsoft_agents.hosting.core.
|
|
17
|
+
from microsoft_agents.hosting.core.security import (
|
|
18
|
+
OutboundHostValidator,
|
|
19
|
+
_SSRFError,
|
|
20
|
+
)
|
|
17
21
|
|
|
18
22
|
from .input_file import InputFileDownloader, InputFile
|
|
19
23
|
from ._utils import _parse_content_type, _basic_url_check
|
|
20
24
|
|
|
25
|
+
logger = logging.getLogger(__name__)
|
|
26
|
+
|
|
21
27
|
|
|
22
28
|
class AttachmentDownloader(InputFileDownloader):
|
|
23
29
|
"""Downloads attachments from a given turn context."""
|
|
24
30
|
|
|
25
31
|
def __init__(
|
|
26
32
|
self,
|
|
27
|
-
client_factory: Callable[[], aiohttp.ClientSession] | None = None,
|
|
28
33
|
host_validator: OutboundHostValidator | None = None,
|
|
34
|
+
*,
|
|
35
|
+
client_session_kwargs: dict | None = None,
|
|
36
|
+
client_factory: Any = None,
|
|
29
37
|
):
|
|
30
38
|
"""Constructor for AttachmentDownloader.
|
|
31
39
|
|
|
32
|
-
:param client_factory: A callable that returns an aiohttp.ClientSession instance.
|
|
33
40
|
:param host_validator: An optional OutboundHostValidator instance.
|
|
41
|
+
:param client_session_kwargs: Optional keyword arguments for the aiohttp.ClientSession.
|
|
42
|
+
:param client_factory: (deprecated) A custom client factory, if any.
|
|
34
43
|
"""
|
|
35
44
|
|
|
36
|
-
|
|
45
|
+
if client_factory is not None:
|
|
46
|
+
logger.warning(
|
|
47
|
+
"The 'client_factory' parameter is deprecated and will be ignored."
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
self._client_session_kwargs = client_session_kwargs or {}
|
|
37
51
|
self._host_validator = host_validator
|
|
38
52
|
|
|
39
53
|
async def download_files(self, context: TurnContext) -> list[InputFile]:
|
|
@@ -48,31 +62,36 @@ class AttachmentDownloader(InputFileDownloader):
|
|
|
48
62
|
if not context.activity.attachments:
|
|
49
63
|
return []
|
|
50
64
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
client_factory: Callable[[], aiohttp.ClientSession]
|
|
66
|
+
if self._host_validator is not None:
|
|
67
|
+
host_validator = self._host_validator # to capture in lambda
|
|
68
|
+
client_factory = lambda: host_validator.client(self._client_session_kwargs)
|
|
69
|
+
else:
|
|
70
|
+
client_factory = lambda: aiohttp.ClientSession(
|
|
71
|
+
**self._client_session_kwargs
|
|
72
|
+
)
|
|
56
73
|
|
|
74
|
+
async with client_factory() as client:
|
|
75
|
+
files: list[InputFile] = []
|
|
76
|
+
for attachment in context.activity.attachments:
|
|
77
|
+
file = await self._download_file(client, attachment)
|
|
78
|
+
if file:
|
|
79
|
+
files.append(file)
|
|
57
80
|
return files
|
|
58
81
|
|
|
59
|
-
async def _download_file(
|
|
82
|
+
async def _download_file(
|
|
83
|
+
self, client: aiohttp.ClientSession, attachment: Attachment
|
|
84
|
+
) -> InputFile | None:
|
|
60
85
|
"""Downloads a single file from the given attachment.
|
|
61
86
|
|
|
87
|
+
:param client: The aiohttp.ClientSession instance to use for downloading the file.
|
|
62
88
|
:param attachment: The attachment to download.
|
|
63
89
|
:return: An InputFile instance if the download is successful, None otherwise.
|
|
64
90
|
"""
|
|
65
91
|
if attachment.content_url and _basic_url_check(attachment.content_url):
|
|
66
92
|
remote_file_url = attachment.content_url
|
|
67
93
|
|
|
68
|
-
|
|
69
|
-
self._host_validator
|
|
70
|
-
and self._host_validator.enabled
|
|
71
|
-
and not self._host_validator.is_allowed(remote_file_url)
|
|
72
|
-
):
|
|
73
|
-
return None
|
|
74
|
-
|
|
75
|
-
async with self._client_factory() as client:
|
|
94
|
+
try:
|
|
76
95
|
async with client.get(remote_file_url) as response:
|
|
77
96
|
|
|
78
97
|
if not (200 <= response.status < 300):
|
|
@@ -94,6 +113,11 @@ class AttachmentDownloader(InputFileDownloader):
|
|
|
94
113
|
content_url=attachment.content_url,
|
|
95
114
|
filename=attachment.name,
|
|
96
115
|
)
|
|
116
|
+
except _SSRFError:
|
|
117
|
+
logger.warning(
|
|
118
|
+
"Outbound host validation failed for an attachment download URL."
|
|
119
|
+
)
|
|
120
|
+
return None
|
|
97
121
|
else:
|
|
98
122
|
content = bytes(json.dumps(attachment.content), "utf-8")
|
|
99
123
|
return InputFile(
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
# Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
import json
|
|
5
|
+
import logging
|
|
6
|
+
import warnings
|
|
7
|
+
|
|
5
8
|
from typing import Callable, cast, Any
|
|
6
9
|
|
|
7
10
|
import aiohttp
|
|
@@ -9,7 +12,6 @@ import aiohttp
|
|
|
9
12
|
from microsoft_agents.activity import (
|
|
10
13
|
Attachment,
|
|
11
14
|
Channels,
|
|
12
|
-
ChannelId,
|
|
13
15
|
)
|
|
14
16
|
|
|
15
17
|
from microsoft_agents.hosting.core.authorization import (
|
|
@@ -17,11 +19,16 @@ from microsoft_agents.hosting.core.authorization import (
|
|
|
17
19
|
Connections,
|
|
18
20
|
)
|
|
19
21
|
from microsoft_agents.hosting.core.turn_context import TurnContext
|
|
20
|
-
from microsoft_agents.hosting.core.
|
|
22
|
+
from microsoft_agents.hosting.core.security import (
|
|
23
|
+
OutboundHostValidator,
|
|
24
|
+
_SSRFError,
|
|
25
|
+
)
|
|
21
26
|
|
|
22
27
|
from .input_file import InputFileDownloader, InputFile
|
|
23
28
|
from ._utils import _parse_content_type, _basic_url_check
|
|
24
29
|
|
|
30
|
+
logger = logging.getLogger(__name__)
|
|
31
|
+
|
|
25
32
|
|
|
26
33
|
class M365AttachmentDownloader(InputFileDownloader):
|
|
27
34
|
"""Downloads attachments from M365/Teams using the configured Token Provider (from Connections)."""
|
|
@@ -29,27 +36,35 @@ class M365AttachmentDownloader(InputFileDownloader):
|
|
|
29
36
|
def __init__(
|
|
30
37
|
self,
|
|
31
38
|
connections: Connections,
|
|
32
|
-
client_factory: Callable[[], aiohttp.ClientSession] | None = None,
|
|
33
39
|
host_validator: OutboundHostValidator | None = None,
|
|
34
40
|
*,
|
|
41
|
+
client_session_kwargs: dict[str, Any] | None = None,
|
|
35
42
|
token_provider_name: str = "",
|
|
36
43
|
use_anonymous: bool = False,
|
|
37
44
|
scopes: list[str] | None = None,
|
|
45
|
+
client_factory: Any = None,
|
|
38
46
|
):
|
|
39
47
|
"""Constructor for M365AttachmentDownloader.
|
|
40
48
|
|
|
41
49
|
:param connections: A Connections instance.
|
|
42
|
-
:param client_factory: A callable that returns an aiohttp.ClientSession instance.
|
|
43
50
|
:param host_validator: An optional OutboundHostValidator instance.
|
|
51
|
+
:param client_session_kwargs: Optional keyword arguments to pass to the aiohttp ClientSession constructor.
|
|
44
52
|
:param token_provider_name: The name of the token provider.
|
|
45
53
|
:param use_anonymous: Whether to use anonymous access.
|
|
46
54
|
:param scopes: A list of scopes for the access token.
|
|
47
|
-
:param
|
|
55
|
+
:param client_factory: (deprecated) A custom client factory, if any.
|
|
48
56
|
"""
|
|
49
57
|
|
|
58
|
+
if client_factory is not None:
|
|
59
|
+
warnings.warn(
|
|
60
|
+
"The 'client_factory' parameter is deprecated and will be ignored.",
|
|
61
|
+
DeprecationWarning,
|
|
62
|
+
stacklevel=2,
|
|
63
|
+
)
|
|
64
|
+
|
|
50
65
|
self._connections = connections
|
|
51
|
-
self._client_factory = client_factory or aiohttp.ClientSession
|
|
52
66
|
self._host_validator = host_validator
|
|
67
|
+
self._client_session_kwargs = client_session_kwargs or {}
|
|
53
68
|
|
|
54
69
|
self._token_provider_name = token_provider_name
|
|
55
70
|
self._use_anonymous = use_anonymous
|
|
@@ -109,19 +124,32 @@ class M365AttachmentDownloader(InputFileDownloader):
|
|
|
109
124
|
outgoing_audience_claim, self._scopes
|
|
110
125
|
)
|
|
111
126
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
127
|
+
client_factory: Callable[[], aiohttp.ClientSession]
|
|
128
|
+
if self._host_validator is not None:
|
|
129
|
+
host_validator = self._host_validator # to
|
|
130
|
+
client_factory = lambda: host_validator.client(self._client_session_kwargs)
|
|
131
|
+
else:
|
|
132
|
+
client_factory = lambda: aiohttp.ClientSession(
|
|
133
|
+
**self._client_session_kwargs
|
|
134
|
+
)
|
|
117
135
|
|
|
136
|
+
async with client_factory() as client:
|
|
137
|
+
files: list[InputFile] = []
|
|
138
|
+
for att in attachments:
|
|
139
|
+
file = await self._download_file(client, att, access_token)
|
|
140
|
+
if file:
|
|
141
|
+
files.append(file)
|
|
118
142
|
return files
|
|
119
143
|
|
|
120
144
|
async def _download_file(
|
|
121
|
-
self,
|
|
145
|
+
self,
|
|
146
|
+
client: aiohttp.ClientSession,
|
|
147
|
+
attachment: Attachment,
|
|
148
|
+
access_token: str,
|
|
122
149
|
) -> InputFile | None:
|
|
123
150
|
"""Download a single file from the given attachment.
|
|
124
151
|
|
|
152
|
+
:param client: The aiohttp.ClientSession instance to use for downloading the file.
|
|
125
153
|
:param attachment: The Attachment instance.
|
|
126
154
|
:param access_token: The access token for authentication.
|
|
127
155
|
:return: An InputFile instance or None if the download fails.
|
|
@@ -136,16 +164,10 @@ class M365AttachmentDownloader(InputFileDownloader):
|
|
|
136
164
|
download_url = attachment.content_url
|
|
137
165
|
|
|
138
166
|
if download_url and _basic_url_check(download_url):
|
|
139
|
-
|
|
140
|
-
self._host_validator is not None
|
|
141
|
-
and self._host_validator.enabled
|
|
142
|
-
and not self._host_validator.is_allowed(download_url)
|
|
143
|
-
):
|
|
144
|
-
return None
|
|
145
|
-
|
|
146
|
-
async with self._client_factory() as client:
|
|
167
|
+
try:
|
|
147
168
|
async with client.get(
|
|
148
|
-
download_url,
|
|
169
|
+
download_url,
|
|
170
|
+
headers={"Authorization": f"Bearer {access_token}"},
|
|
149
171
|
) as response:
|
|
150
172
|
if not (200 <= response.status < 300):
|
|
151
173
|
return None
|
|
@@ -165,6 +187,11 @@ class M365AttachmentDownloader(InputFileDownloader):
|
|
|
165
187
|
content_url=attachment.content_url,
|
|
166
188
|
filename=name,
|
|
167
189
|
)
|
|
190
|
+
except _SSRFError:
|
|
191
|
+
logger.warning(
|
|
192
|
+
"Outbound host validation failed for an attachment download URL."
|
|
193
|
+
)
|
|
194
|
+
return None
|
|
168
195
|
else:
|
|
169
196
|
content = bytes(json.dumps(attachment.content), "utf-8")
|
|
170
197
|
return InputFile(
|
|
@@ -6,6 +6,7 @@ from __future__ import annotations
|
|
|
6
6
|
import uuid
|
|
7
7
|
import asyncio
|
|
8
8
|
import logging
|
|
9
|
+
from collections.abc import Mapping
|
|
9
10
|
from typing import Optional, Callable, Literal, cast, TYPE_CHECKING
|
|
10
11
|
|
|
11
12
|
from microsoft_agents.activity import (
|
|
@@ -499,6 +500,12 @@ class StreamingResponse:
|
|
|
499
500
|
)
|
|
500
501
|
if self._should_update_final_activity() and self._stream_id:
|
|
501
502
|
activity.id = self._stream_id
|
|
503
|
+
|
|
504
|
+
if self._enable_feedback_loop and self._is_teams_channel():
|
|
505
|
+
self._add_feedback_loop_to_channel_data(activity)
|
|
506
|
+
|
|
507
|
+
self._add_generated_by_ai_metadata(activity)
|
|
508
|
+
|
|
502
509
|
return activity
|
|
503
510
|
|
|
504
511
|
def _create_stream_stopped_message(self, message: str) -> Activity:
|
|
@@ -514,6 +521,7 @@ class StreamingResponse:
|
|
|
514
521
|
)
|
|
515
522
|
],
|
|
516
523
|
)
|
|
524
|
+
self._add_generated_by_ai_metadata(activity)
|
|
517
525
|
return activity
|
|
518
526
|
|
|
519
527
|
def _create_stream_timed_out_message(
|
|
@@ -534,12 +542,15 @@ class StreamingResponse:
|
|
|
534
542
|
stream_info.stream_id = self._stream_id
|
|
535
543
|
entities.append(stream_info)
|
|
536
544
|
|
|
537
|
-
|
|
545
|
+
activity = Activity(
|
|
538
546
|
id=self._stream_id,
|
|
539
547
|
type="message",
|
|
540
548
|
text=text,
|
|
541
549
|
entities=entities,
|
|
542
550
|
)
|
|
551
|
+
if add_stream_final:
|
|
552
|
+
self._add_generated_by_ai_metadata(activity)
|
|
553
|
+
return activity
|
|
543
554
|
|
|
544
555
|
def _create_stream_timed_out_streaming_update(self) -> Activity:
|
|
545
556
|
text = (
|
|
@@ -615,23 +626,6 @@ class StreamingResponse:
|
|
|
615
626
|
)
|
|
616
627
|
)
|
|
617
628
|
|
|
618
|
-
# Add in Powered by AI feature flags
|
|
619
|
-
if self._ended:
|
|
620
|
-
if self._enable_feedback_loop and self._feedback_loop_type:
|
|
621
|
-
# Add feedback loop to streaminfo entity
|
|
622
|
-
if streaminfo_entity:
|
|
623
|
-
streaminfo_entity.feedback_loop = {"type": self._feedback_loop_type}
|
|
624
|
-
else:
|
|
625
|
-
# Add feedback loop enabled to streaminfo entity
|
|
626
|
-
if streaminfo_entity:
|
|
627
|
-
streaminfo_entity.feedback_loop_enabled = self._enable_feedback_loop
|
|
628
|
-
# Add in Generated by AI
|
|
629
|
-
if self._enable_generated_by_ai_label:
|
|
630
|
-
curr_citations = CitationUtil.get_used_citations(
|
|
631
|
-
self._message, self._citations
|
|
632
|
-
)
|
|
633
|
-
activity.add_ai_metadata(curr_citations, self._sensitivity_label)
|
|
634
|
-
|
|
635
629
|
try:
|
|
636
630
|
response = await self._context.send_activity(activity)
|
|
637
631
|
|
|
@@ -840,6 +834,38 @@ class StreamingResponse:
|
|
|
840
834
|
channel_id = self._context.activity.channel_id
|
|
841
835
|
return bool(channel_id) and channel_id.channel == Channels.ms_teams
|
|
842
836
|
|
|
837
|
+
def _add_feedback_loop_to_channel_data(self, activity: Activity) -> None:
|
|
838
|
+
channel_data = activity.channel_data
|
|
839
|
+
if channel_data is None:
|
|
840
|
+
serialized_channel_data = {}
|
|
841
|
+
elif isinstance(channel_data, Mapping):
|
|
842
|
+
serialized_channel_data = dict(channel_data)
|
|
843
|
+
elif callable(model_dump := getattr(channel_data, "model_dump", None)):
|
|
844
|
+
serialized_channel_data = model_dump(
|
|
845
|
+
mode="json",
|
|
846
|
+
by_alias=True,
|
|
847
|
+
exclude_none=True,
|
|
848
|
+
exclude_unset=True,
|
|
849
|
+
)
|
|
850
|
+
else:
|
|
851
|
+
logger.warning(
|
|
852
|
+
"Unable to add feedback loop to unsupported channel data type: %s",
|
|
853
|
+
type(channel_data).__name__,
|
|
854
|
+
)
|
|
855
|
+
return
|
|
856
|
+
|
|
857
|
+
serialized_channel_data["feedbackLoop"] = {
|
|
858
|
+
"type": self._feedback_loop_type or "default"
|
|
859
|
+
}
|
|
860
|
+
activity.channel_data = serialized_channel_data
|
|
861
|
+
|
|
862
|
+
def _add_generated_by_ai_metadata(self, activity: Activity) -> None:
|
|
863
|
+
if not self._enable_generated_by_ai_label:
|
|
864
|
+
return
|
|
865
|
+
|
|
866
|
+
curr_citations = CitationUtil.get_used_citations(self._message, self._citations)
|
|
867
|
+
activity.add_ai_metadata(curr_citations, self._sensitivity_label)
|
|
868
|
+
|
|
843
869
|
def _should_update_final_activity(self) -> bool:
|
|
844
870
|
if self._is_m365_copilot():
|
|
845
871
|
return False
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from ._connector import _SSRFError, _SSRFConnector
|
|
5
|
+
from ._utils import _try_create_url, _normalize_host
|
|
6
|
+
from .outbound_host_validator import OutboundHostValidator
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"OutboundHostValidator",
|
|
10
|
+
"_SSRFError",
|
|
11
|
+
"_SSRFConnector",
|
|
12
|
+
"_try_create_url",
|
|
13
|
+
"_normalize_host",
|
|
14
|
+
]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from collections.abc import Sequence
|
|
5
|
+
from typing import Protocol
|
|
6
|
+
|
|
7
|
+
from aiohttp import TCPConnector
|
|
8
|
+
from aiohttp.abc import ResolveResult
|
|
9
|
+
from aiohttp.tracing import Trace
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class _ResolveResultValidator(Protocol):
|
|
13
|
+
"""Protocol for validating resolved results to prevent SSRF attacks."""
|
|
14
|
+
|
|
15
|
+
def is_allowed(self, resolved: ResolveResult) -> bool:
|
|
16
|
+
"""Check if the resolved result is valid to prevent SSRF attacks.
|
|
17
|
+
|
|
18
|
+
:param resolved: The resolved result to validate.
|
|
19
|
+
:return: True if the resolved result is valid, False otherwise.
|
|
20
|
+
"""
|
|
21
|
+
...
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class _SSRFError(ValueError):
|
|
25
|
+
"""Exception raised when an SSRF attack is detected."""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class _SSRFConnector(TCPConnector):
|
|
29
|
+
"""TCPConnector subclass that validates resolved host results to prevent SSRF attacks."""
|
|
30
|
+
|
|
31
|
+
def __init__(
|
|
32
|
+
self, resolved_result_validator: _ResolveResultValidator, *args, **kwargs
|
|
33
|
+
):
|
|
34
|
+
"""Initialize the SSRFConnector with a resolved result validator.
|
|
35
|
+
|
|
36
|
+
:param resolved_result_validator: The validator used to check resolved host results.
|
|
37
|
+
"""
|
|
38
|
+
super().__init__(*args, **kwargs)
|
|
39
|
+
self._resolved_result_validator = resolved_result_validator
|
|
40
|
+
|
|
41
|
+
async def _resolve_host(
|
|
42
|
+
self, host: str, port: int, traces: Sequence[Trace] | None = None
|
|
43
|
+
) -> list[ResolveResult]:
|
|
44
|
+
"""Resolve the host and validate the resolved results to prevent SSRF attacks.
|
|
45
|
+
|
|
46
|
+
:param host: The hostname to resolve.
|
|
47
|
+
:param port: The port number to resolve.
|
|
48
|
+
:param traces: Optional sequence of Trace objects for tracing the resolution process.
|
|
49
|
+
:return: A list of validated ResolveResult objects.
|
|
50
|
+
:raises _SSRFError: If any resolved result is invalid.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
res = await super()._resolve_host(host, port, traces)
|
|
54
|
+
|
|
55
|
+
for r in res:
|
|
56
|
+
if not self._resolved_result_validator.is_allowed(r):
|
|
57
|
+
raise _SSRFError(f"Invalid resolved result: {r}")
|
|
58
|
+
return res
|