Skip to content
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

[C#] feat: Allow passing custom credentials factory to CloudAdapter #2166

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,29 @@ public TeamsAdapter(
CredentialsFactory = new ConfigurationServiceClientCredentialFactory(configuration);
}

/// <summary>
/// Initializes a new instance of the <see cref="TeamsAdapter"/> class.
/// </summary>
/// <param name="configuration">The <see cref="IConfiguration"/> instance.</param>
/// <param name="credentialsFactory">The <see cref="ServiceClientCredentialsFactory"/> instance.</param>
/// <param name="httpClientFactory">The <see cref="IHttpClientFactory"/> this adapter should use.</param>
/// <param name="logger">The <see cref="ILogger"/> implementation this adapter should use.</param>
public TeamsAdapter(
IConfiguration configuration,
ServiceClientCredentialsFactory credentialsFactory,
IHttpClientFactory? httpClientFactory = null,
ILogger? logger = null) : base(
new ConfigurationBotFrameworkAuthentication(configuration,
credentialsFactory: credentialsFactory,
httpClientFactory: new TeamsHttpClientFactory(httpClientFactory),
logger: logger),
logger)
{
HttpClientFactory = new TeamsHttpClientFactory(httpClientFactory);
Configuration = configuration;
CredentialsFactory = credentialsFactory;
}

/// <inheritdoc />
public new async Task ProcessAsync(HttpRequest httpRequest, HttpResponse httpResponse, IBot bot, CancellationToken cancellationToken = default)
{
Expand Down
Loading