Skip to content

[#6883] Capture x-ms-correlation-id and use in all outgoing requests #6893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ceciliaavila
Copy link
Collaborator

Fixes #6883

Description

This PR adds the ability to select headers from incoming requests to be propagated to outgoing requests.
This feature supports 4 possible operations:

  • The choice of an existing header for propagation (known as the propagate operation).
  • The ability to add a new header to the outgoing request (referred to as the add operation).
  • The ability to replace the value of an existing header (override operation).
  • The option to concatenate a new value to that of an existing header (append operation).

Proactive scenarios are supported by incorporating an IStorage instance which stores the selected headers from the reception of the incoming request until the moment the bot sends the proactive message.

Specific Changes

  • Added new classes to handle the header propagation in Microsoft.Bot.Connector:
    • HeaderPropagation
    • HeaderPropagationEntry
    • HeaderPropagationEntryCollection
  • Updated ProcessAsync and ProcessProactiveAsync methods in CloudAdapter to receive and filter the incoming headers.
  • Updated AddDefaultRequestHeaders method in ConnectorClientEx to read the collection of headers to propagate and set them in the HttpClient.
  • Added an optional IStorage parameter in CloudAdapter to store headers for proactive scenarios.
  • Added a call to AddDefaultRequestHeaders in SkillDialog to support dialogs root-skill scenarios.
  • Added TeamsHeaderPropagation class as an example of how header propagations should be implemented for different channels.
  • Fixed failing tests in CloudAdapterTests.

Testing

This image shows an outgoing request with the headers propagated.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Capture x-ms-correlation-id and use in all outgoing requests
1 participant