Skip to content

Commit

Permalink
Merge pull request #66 from conductor-sdk/update-api-extension
Browse files Browse the repository at this point in the history
Exposed configuration from ApiExtension to enable custom settings
  • Loading branch information
gardusig authored May 11, 2023
2 parents 2ad581a + 5f5a49b commit a9f85c7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Conductor/Client/Extensions/ApiExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public class ApiExtensions
private const string ENV_KEY_ID = "KEY";
private const string ENV_SECRET = "SECRET";

private static Configuration _configuration = null;
public static Configuration Configuration { get; set; }

static ApiExtensions()
{
_configuration = new Configuration()
Configuration = new Configuration
{
Timeout = 30 * 1000,
BasePath = GetEnvironmentVariable(ENV_ROOT_URI),
Expand All @@ -37,12 +37,19 @@ public static WorkflowExecutor GetWorkflowExecutor()

public static T GetClient<T>() where T : IApiAccessor, new()
{
return _configuration.GetClient<T>();
return Configuration.GetClient<T>();
}

public static Configuration GetConfiguration()
{
return _configuration;
return Configuration;
}

public static string GetWorkflowExecutionURL(string workflowId)
{
var basePath = Configuration.BasePath;
var prefix = basePath.Remove(basePath.Length - 4);
return $"{prefix}/execution/{workflowId}";
}

private static string GetEnvironmentVariable(string variable)
Expand Down

0 comments on commit a9f85c7

Please sign in to comment.