public BpmLogOutputService(BpmServerConnectionSettings bpmOptions) { var validator = new BpmServerConnectionSettingsValidator(); validator.ValidateAndThrow(bpmOptions); Console.Write("Created a client"); }
internal static IServiceCollection AddConfiguration(this IServiceCollection services) { var environmentName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); IConfiguration config = new ConfigurationBuilder() .AddJsonFile("appsettings.json", true, true) .AddJsonFile($"appsettings.{environmentName}.json", optional: false, reloadOnChange: true) .Build(); var BpmConnectSettings = new BpmServerConnectionSettings(); config.GetSection(typeof(BpmServerConnectionSettings).Name).Bind(BpmConnectSettings); return(services.AddSingleton <IConfiguration>(config) .AddSingleton(BpmConnectSettings)); }
public ZeebeService(BpmServerConnectionSettings bpmOptions) { var validator = new BpmServerConnectionSettingsValidator(); validator.ValidateAndThrow(bpmOptions); //Discard any potential :443 port at the end char[] port = { '4', '3', ':' }; var audience = bpmOptions.Address.TrimEnd(port); _client = ZeebeClient.Builder() .UseGatewayAddress(bpmOptions.Address) .UseTransportEncryption() .UseAccessTokenSupplier( CamundaCloudTokenProvider.Builder() .UseAuthServer(bpmOptions.AuthServer) .UseClientId(bpmOptions.ClientId) .UseClientSecret(bpmOptions.ClientSecret) .UseAudience(audience) .Build()) .Build(); }