-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update .NET SDK to 1.3.1 and add proxy tests (#536)
- Loading branch information
Showing
6 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace client.http_proxy; | ||
|
||
using Temporalio.Client; | ||
using Temporalio.Features.Harness; | ||
using Temporalio.Worker; | ||
using Temporalio.Workflows; | ||
|
||
class Feature : IFeature | ||
{ | ||
public static void ConfigureClient( | ||
Runner runner, TemporalClientConnectOptions options, bool useAuth) | ||
{ | ||
var uri = new Uri(runner.HttpProxyUrl ?? throw new InvalidOperationException("Missing proxy URL")); | ||
options.HttpConnectProxy = new() { TargetHost = $"{uri.Host}:{uri.Port}" }; | ||
if (useAuth) | ||
{ | ||
options.HttpConnectProxy!.BasicAuth = ("proxy-user", "proxy-pass"); | ||
} | ||
} | ||
|
||
public void ConfigureClient(Runner runner, TemporalClientConnectOptions options) => | ||
ConfigureClient(runner, options, useAuth: false); | ||
|
||
public void ConfigureWorker(Runner runner, TemporalWorkerOptions options) => | ||
options.AddWorkflow<MyWorkflow>(); | ||
|
||
[Workflow] | ||
class MyWorkflow | ||
{ | ||
[WorkflowRun] | ||
public async Task<string> RunAsync() => "done"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace client.http_proxy_auth; | ||
|
||
using Temporalio.Client; | ||
using Temporalio.Features.Harness; | ||
using Temporalio.Worker; | ||
using Temporalio.Workflows; | ||
|
||
class Feature : IFeature | ||
{ | ||
public void ConfigureClient(Runner runner, TemporalClientConnectOptions options) => | ||
http_proxy.Feature.ConfigureClient(runner, options, useAuth: true); | ||
|
||
public void ConfigureWorker(Runner runner, TemporalWorkerOptions options) => | ||
options.AddWorkflow<MyWorkflow>(); | ||
|
||
[Workflow] | ||
class MyWorkflow | ||
{ | ||
[WorkflowRun] | ||
public async Task<string> RunAsync() => "done"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters