diff --git a/src/api/Synapse.Api.Client.Http/Synapse.Api.Client.Http.csproj b/src/api/Synapse.Api.Client.Http/Synapse.Api.Client.Http.csproj index 357cf68dd..24e533bd6 100644 --- a/src/api/Synapse.Api.Client.Http/Synapse.Api.Client.Http.csproj +++ b/src/api/Synapse.Api.Client.Http/Synapse.Api.Client.Http.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/api/Synapse.Api.Http/Synapse.Api.Http.csproj b/src/api/Synapse.Api.Http/Synapse.Api.Http.csproj index b95210dd6..1d20db1db 100644 --- a/src/api/Synapse.Api.Http/Synapse.Api.Http.csproj +++ b/src/api/Synapse.Api.Http/Synapse.Api.Http.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/cli/Synapse.Cli/Synapse.Cli.csproj b/src/cli/Synapse.Cli/Synapse.Cli.csproj index 67bdec8e3..6594465e9 100644 --- a/src/cli/Synapse.Cli/Synapse.Cli.csproj +++ b/src/cli/Synapse.Cli/Synapse.Cli.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/core/Synapse.Core.Infrastructure/Services/Interfaces/IOAuth2TokenManager.cs b/src/core/Synapse.Core.Infrastructure/Services/Interfaces/IOAuth2TokenManager.cs index a2709d205..d80ab41db 100644 --- a/src/core/Synapse.Core.Infrastructure/Services/Interfaces/IOAuth2TokenManager.cs +++ b/src/core/Synapse.Core.Infrastructure/Services/Interfaces/IOAuth2TokenManager.cs @@ -27,6 +27,6 @@ public interface IOAuth2TokenManager /// The configuration that defines how to generate the to get /// A /// An - Task GetTokenAsync(OAuth2AuthenticationSchemeDefinition configuration, CancellationToken cancellationToken = default); + Task GetTokenAsync(OAuth2AuthenticationSchemeDefinitionBase configuration, CancellationToken cancellationToken = default); } diff --git a/src/core/Synapse.Core.Infrastructure/Services/OAuth2TokenManager.cs b/src/core/Synapse.Core.Infrastructure/Services/OAuth2TokenManager.cs index 5909e10ca..4169d2226 100644 --- a/src/core/Synapse.Core.Infrastructure/Services/OAuth2TokenManager.cs +++ b/src/core/Synapse.Core.Infrastructure/Services/OAuth2TokenManager.cs @@ -13,9 +13,16 @@ using IdentityModel.Client; using Microsoft.Extensions.Logging; +using Microsoft.IdentityModel.Tokens; using Neuroglia.Serialization; +using ServerlessWorkflow.Sdk; using ServerlessWorkflow.Sdk.Models.Authentication; using System.Collections.Concurrent; +using System.IdentityModel.Tokens.Jwt; +using System.Net.Mime; +using System.Security.Claims; +using System.Text; +using YamlDotNet.Core.Tokens; namespace Synapse.Core.Infrastructure.Services; @@ -50,16 +57,49 @@ public class OAuth2TokenManager(ILogger logger, IJsonSeriali protected ConcurrentDictionary Tokens { get; } = []; /// - public virtual async Task GetTokenAsync(OAuth2AuthenticationSchemeDefinition configuration, CancellationToken cancellationToken = default) + public virtual async Task GetTokenAsync(OAuth2AuthenticationSchemeDefinitionBase configuration, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(configuration); - var tokenKey = $"{configuration.Client.Id}@{configuration.Authority}"; + Uri tokenEndpoint; + if (configuration is OpenIDConnectSchemeDefinition) + { + var discoveryDocument = await this.HttpClient.GetDiscoveryDocumentAsync(configuration.Authority.OriginalString, cancellationToken).ConfigureAwait(false); + if (string.IsNullOrWhiteSpace(discoveryDocument.TokenEndpoint)) throw new NullReferenceException("The token endpoint is not documented by the OIDC discovery document"); + tokenEndpoint = new(discoveryDocument.TokenEndpoint!); + } + else if (configuration is OAuth2AuthenticationSchemeDefinition oauth2) tokenEndpoint = oauth2.Endpoints.Token; + else throw new NotSupportedException($"The specified scheme type '{configuration.GetType().FullName}' is not supported in this context"); + var tokenKey = $"{configuration.Client?.Id}@{configuration.Authority}"; var properties = new Dictionary() { - { "grant_type", configuration.Grant }, - { "client_id", configuration.Client.Id } + { "grant_type", configuration.Grant } }; - if (!string.IsNullOrWhiteSpace(configuration.Client.Secret)) properties["client_secret"] = configuration.Client.Secret; + switch (configuration.Client?.Authentication) + { + case null: + if(!string.IsNullOrWhiteSpace(configuration.Client?.Id) && !string.IsNullOrWhiteSpace(configuration.Client?.Secret)) + { + properties["client_id"] = configuration.Client.Id!; + properties["client_secret"] = configuration.Client.Secret!; + } + break; + case OAuth2ClientAuthenticationMethod.Post: + this.ThrowIfInvalidClientCredentials(configuration.Client); + properties["client_id"] = configuration.Client.Id!; + properties["client_secret"] = configuration.Client.Secret!; + break; + case OAuth2ClientAuthenticationMethod.JwT: + this.ThrowIfInvalidClientCredentials(configuration.Client); + properties["client_assertion_type"] = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"; + properties["client_assertion"] = this.CreateClientAssertionJwt(configuration.Client.Id!, tokenEndpoint.OriginalString, new(new SymmetricSecurityKey(Encoding.UTF8.GetBytes(configuration.Client.Secret!)), SecurityAlgorithms.HmacSha256)); + break; + case OAuth2ClientAuthenticationMethod.PrivateKey: + this.ThrowIfInvalidClientCredentials(configuration.Client); + throw new NotImplementedException(); //todo + case OAuth2ClientAuthenticationMethod.Basic: + break; + default: throw new NotSupportedException($"The specified OAUTH2 client authentication method '{configuration.Client?.Authentication}' is not supported"); + } if (configuration.Scopes?.Count > 0) properties["scope"] = string.Join(" ", configuration.Scopes); if (configuration.Audiences?.Count > 0) properties["audience"] = string.Join(" ", configuration.Audiences); if (!string.IsNullOrWhiteSpace(configuration.Username)) properties["username"] = configuration.Username; @@ -84,11 +124,18 @@ public virtual async Task GetTokenAsync(OAuth2AuthenticationSchemeD } else return token; } - var discoveryDocument = await this.HttpClient.GetDiscoveryDocumentAsync(configuration.Authority.OriginalString, cancellationToken).ConfigureAwait(false); - using var request = new HttpRequestMessage(HttpMethod.Post, discoveryDocument.TokenEndpoint) + using var content = configuration.Request.Encoding switch { - Content = new FormUrlEncodedContent(properties) + OAuth2RequestEncoding.FormUrl => (HttpContent)new FormUrlEncodedContent(properties), + OAuth2RequestEncoding.Json => new StringContent(this.JsonSerializer.SerializeToText(properties), Encoding.UTF8, MediaTypeNames.Application.Json), + _ => throw new NotSupportedException($"The specified OAUTH2 request encoding '{configuration.Request.Encoding}' is not supported") }; + using var request = new HttpRequestMessage(HttpMethod.Post, tokenEndpoint) { Content = content }; + if (configuration.Client?.Authentication == OAuth2ClientAuthenticationMethod.Basic) + { + this.ThrowIfInvalidClientCredentials(configuration.Client); + request.Headers.Authorization = new("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{configuration.Client.Id}:{configuration.Client.Secret}"))); + } using var response = await this.HttpClient.SendAsync(request, cancellationToken).ConfigureAwait(false); var json = await response.Content?.ReadAsStringAsync(cancellationToken)!; if (!response.IsSuccessStatusCode) @@ -101,4 +148,36 @@ public virtual async Task GetTokenAsync(OAuth2AuthenticationSchemeD return token; } + /// + /// Throws a new if the specified client credentials have not been properly configured, as required by the configured authentication method + /// + /// The client credentials to validate + protected virtual void ThrowIfInvalidClientCredentials(OAuth2AuthenticationClientDefinition? client) + { + if(string.IsNullOrWhiteSpace(client?.Id) || string.IsNullOrWhiteSpace(client?.Secret)) throw new NullReferenceException($"The client id and client secret must be configured when using the '{client?.Authentication}' OAUTH2 authentication method"); + } + + /// + /// Creates a JSON Web Token (JWT) for client authentication using the provided client ID, audience and signing credentials. + /// + /// The client ID used as the subject and issuer of the JWT + /// The audience for which the JWT is intended, typically the token endpoint URL + /// The credentials used to signed the JWT + /// A signed JWT in string format, to be used as a client assertion in OAuth 2.0 requests + protected virtual string CreateClientAssertionJwt(string clientId, string audience, SigningCredentials signingCredentials) + { + ArgumentException.ThrowIfNullOrWhiteSpace(clientId); + ArgumentException.ThrowIfNullOrWhiteSpace(audience); + ArgumentNullException.ThrowIfNull(signingCredentials); + var tokenHandler = new JwtSecurityTokenHandler(); + var claims = new List + { + new(JwtRegisteredClaimNames.Sub, clientId), + new(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()), + new(JwtRegisteredClaimNames.Iat, DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(), ClaimValueTypes.Integer64) + }; + var token = new JwtSecurityToken(clientId, audience, claims, DateTime.UtcNow, DateTime.UtcNow.AddMinutes(5), signingCredentials); + return tokenHandler.WriteToken(token); + } + } diff --git a/src/core/Synapse.Core.Infrastructure/Synapse.Core.Infrastructure.csproj b/src/core/Synapse.Core.Infrastructure/Synapse.Core.Infrastructure.csproj index 91c42b706..9b4ccad3e 100644 --- a/src/core/Synapse.Core.Infrastructure/Synapse.Core.Infrastructure.csproj +++ b/src/core/Synapse.Core.Infrastructure/Synapse.Core.Infrastructure.csproj @@ -10,12 +10,13 @@ - - - - - - + + + + + + + diff --git a/src/core/Synapse.Core/Synapse.Core.csproj b/src/core/Synapse.Core/Synapse.Core.csproj index 5159c4a3f..5c99356cb 100644 --- a/src/core/Synapse.Core/Synapse.Core.csproj +++ b/src/core/Synapse.Core/Synapse.Core.csproj @@ -32,10 +32,10 @@ - - + + - + diff --git a/src/correlator/Synapse.Correlator/Synapse.Correlator.csproj b/src/correlator/Synapse.Correlator/Synapse.Correlator.csproj index af774ec23..71591ee28 100644 --- a/src/correlator/Synapse.Correlator/Synapse.Correlator.csproj +++ b/src/correlator/Synapse.Correlator/Synapse.Correlator.csproj @@ -16,12 +16,12 @@ - - - - - - + + + + + + diff --git a/src/dashboard/Synapse.Dashboard/Synapse.Dashboard.csproj b/src/dashboard/Synapse.Dashboard/Synapse.Dashboard.csproj index 833bbc899..641c7baaa 100644 --- a/src/dashboard/Synapse.Dashboard/Synapse.Dashboard.csproj +++ b/src/dashboard/Synapse.Dashboard/Synapse.Dashboard.csproj @@ -34,7 +34,7 @@ - + diff --git a/src/runner/Synapse.Runner/Program.cs b/src/runner/Synapse.Runner/Program.cs index 5509c3d42..8d5b4196c 100644 --- a/src/runner/Synapse.Runner/Program.cs +++ b/src/runner/Synapse.Runner/Program.cs @@ -41,7 +41,7 @@ services.AddPythonScriptExecutor(); services.AddSynapseHttpApiClient(http => { - var configuration = new ServerlessWorkflow.Sdk.Models.Authentication.OAuth2AuthenticationSchemeDefinition() + var configuration = new ServerlessWorkflow.Sdk.Models.Authentication.OpenIDConnectSchemeDefinition() { Authority = options.Api.BaseAddress, Grant = OAuth2GrantType.ClientCredentials, diff --git a/src/runner/Synapse.Runner/Services/RunnerApplication.cs b/src/runner/Synapse.Runner/Services/RunnerApplication.cs index b48e16124..e59a4d3d7 100644 --- a/src/runner/Synapse.Runner/Services/RunnerApplication.cs +++ b/src/runner/Synapse.Runner/Services/RunnerApplication.cs @@ -18,8 +18,9 @@ namespace Synapse.Runner.Services; /// /// The current /// The current +/// The service used to perform logging /// The service used to access the current -internal class RunnerApplication(IServiceProvider serviceProvider, IHostApplicationLifetime applicationLifetime, IOptions options) +internal class RunnerApplication(IServiceProvider serviceProvider, IHostApplicationLifetime applicationLifetime, ILogger logger, IOptions options) : IHostedService, IDisposable { @@ -40,6 +41,11 @@ internal class RunnerApplication(IServiceProvider serviceProvider, IHostApplicat /// protected IHostApplicationLifetime ApplicationLifetime { get; } = applicationLifetime; + /// + /// Gets the service used to perform logging + /// + protected ILogger Logger { get; } = logger; + /// /// Gets the service used to interact with the Synapse API /// @@ -60,7 +66,7 @@ public virtual Task StartAsync(CancellationToken cancellationToken) { this.ApplicationLifetime.ApplicationStarted.Register(() => { - Task.Run(() => this.RunAsync(cancellationToken), cancellationToken); + _ = Task.Run(async () => await this.RunAsync(cancellationToken), cancellationToken); }); return Task.CompletedTask; } @@ -72,17 +78,24 @@ public virtual Task StartAsync(CancellationToken cancellationToken) /// A new awaitable protected virtual async Task RunAsync(CancellationToken cancellationToken) { - if (string.IsNullOrWhiteSpace(this.Options.Workflow?.Instance)) throw new NullReferenceException("The workflow instance to run must be configured, which can be done using the application's appsettings.json file, using command line arguments or using environment variables"); - var instance = await this.ApiClient.WorkflowInstances.GetAsync(this.Options.Workflow.GetInstanceName(), this.Options.Workflow.GetInstanceNamespace(), cancellationToken).ConfigureAwait(false) ?? throw new NullReferenceException($"Failed to find the specified workflow instance '{this.Options.Workflow.Instance}'"); - var resource = await this.ApiClient.Workflows.GetAsync(instance.Spec.Definition.Name, instance.Spec.Definition.Namespace, cancellationToken).ConfigureAwait(false) ?? throw new NullReferenceException($"Failed to find the specified workflow '{instance.Spec.Definition.Namespace}.{instance.Spec.Definition.Name}'"); - var definition = resource.Spec.Versions.FirstOrDefault(v => v.Document.Version == instance.Spec.Definition.Version) ?? throw new NullReferenceException($"Failed to find the specified version '{instance.Spec.Definition.Version}' of the workflow '{instance.Spec.Definition.Namespace}.{instance.Spec.Definition.Name}'"); - var expressionLanguage = definition.Evaluate?.Language ?? RuntimeExpressions.Languages.JQ; - var expressionEvaluator = this.ServiceProvider.GetRequiredService().GetEvaluator(expressionLanguage) - ?? throw new NullReferenceException($"Failed to find an expression evaluator for the language '{expressionLanguage}' defined by workflow '{instance.Spec.Definition.Namespace}.{instance.Spec.Definition.Name}:{instance.Spec.Definition.Version}'"); - var context = ActivatorUtilities.CreateInstance(this.ServiceProvider, expressionEvaluator, definition, instance); - this.Executor = ActivatorUtilities.CreateInstance(this.ServiceProvider, context); - await this.Executor.ExecuteAsync(cancellationToken).ConfigureAwait(false); - this.ApplicationLifetime.StopApplication(); + try + { + if (string.IsNullOrWhiteSpace(this.Options.Workflow?.Instance)) throw new NullReferenceException("The workflow instance to run must be configured, which can be done using the application's appsettings.json file, using command line arguments or using environment variables"); + var instance = await this.ApiClient.WorkflowInstances.GetAsync(this.Options.Workflow.GetInstanceName(), this.Options.Workflow.GetInstanceNamespace(), cancellationToken).ConfigureAwait(false) ?? throw new NullReferenceException($"Failed to find the specified workflow instance '{this.Options.Workflow.Instance}'"); + var resource = await this.ApiClient.Workflows.GetAsync(instance.Spec.Definition.Name, instance.Spec.Definition.Namespace, cancellationToken).ConfigureAwait(false) ?? throw new NullReferenceException($"Failed to find the specified workflow '{instance.Spec.Definition.Namespace}.{instance.Spec.Definition.Name}'"); + var definition = resource.Spec.Versions.FirstOrDefault(v => v.Document.Version == instance.Spec.Definition.Version) ?? throw new NullReferenceException($"Failed to find the specified version '{instance.Spec.Definition.Version}' of the workflow '{instance.Spec.Definition.Namespace}.{instance.Spec.Definition.Name}'"); + var expressionLanguage = definition.Evaluate?.Language ?? RuntimeExpressions.Languages.JQ; + var expressionEvaluator = this.ServiceProvider.GetRequiredService().GetEvaluator(expressionLanguage) + ?? throw new NullReferenceException($"Failed to find an expression evaluator for the language '{expressionLanguage}' defined by workflow '{instance.Spec.Definition.Namespace}.{instance.Spec.Definition.Name}:{instance.Spec.Definition.Version}'"); + var context = ActivatorUtilities.CreateInstance(this.ServiceProvider, expressionEvaluator, definition, instance); + this.Executor = ActivatorUtilities.CreateInstance(this.ServiceProvider, context); + await this.Executor.ExecuteAsync(cancellationToken).ConfigureAwait(false); + this.ApplicationLifetime.StopApplication(); + } + catch(Exception ex) + { + this.Logger.LogError("An error occurred while running the specified workflow instance: {ex}", ex); + } } /// diff --git a/src/runner/Synapse.Runner/Synapse.Runner.csproj b/src/runner/Synapse.Runner/Synapse.Runner.csproj index 77817782d..7dbb20527 100644 --- a/src/runner/Synapse.Runner/Synapse.Runner.csproj +++ b/src/runner/Synapse.Runner/Synapse.Runner.csproj @@ -33,18 +33,18 @@ - + - + - - - - - + + + + + diff --git a/tests/Synapse.IntegrationTests/Synapse.IntegrationTests.csproj b/tests/Synapse.IntegrationTests/Synapse.IntegrationTests.csproj index 6a6a1e8a5..9d1a1267b 100644 --- a/tests/Synapse.IntegrationTests/Synapse.IntegrationTests.csproj +++ b/tests/Synapse.IntegrationTests/Synapse.IntegrationTests.csproj @@ -17,7 +17,7 @@ - + diff --git a/tests/Synapse.UnitTests/Cases/Runner/ExtensionTests.cs b/tests/Synapse.UnitTests/Cases/Runner/ExtensionTests.cs index 82a656808..48d9997b8 100644 --- a/tests/Synapse.UnitTests/Cases/Runner/ExtensionTests.cs +++ b/tests/Synapse.UnitTests/Cases/Runner/ExtensionTests.cs @@ -52,7 +52,7 @@ public async Task Run_Before_All_Should_Work() { Document = new() { - Dsl = DslVersion.V010, + Dsl = DslVersion.V1Alpha2, Namespace = Namespace.DefaultNamespaceName, Name = "test", Version = "0.1.0" @@ -116,7 +116,7 @@ public async Task Run_After_All_Should_Work() { Document = new() { - Dsl = DslVersion.V010, + Dsl = DslVersion.V1Alpha2, Namespace = Namespace.DefaultNamespaceName, Name = "test", Version = "0.1.0" diff --git a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/DoTaskExecutorTests.cs b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/DoTaskExecutorTests.cs index 6f8d9f712..216cafa68 100644 --- a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/DoTaskExecutorTests.cs +++ b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/DoTaskExecutorTests.cs @@ -59,7 +59,7 @@ public async Task Execute_Should_Work() { Document = new() { - Dsl = DslVersion.V010, + Dsl = DslVersion.V1Alpha2, Namespace = Namespace.DefaultNamespaceName, Name = "fake", Version = "0.1.0" diff --git a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/EmitTaskExecutorTests.cs b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/EmitTaskExecutorTests.cs index f4157e13b..aa2693d47 100644 --- a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/EmitTaskExecutorTests.cs +++ b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/EmitTaskExecutorTests.cs @@ -54,7 +54,7 @@ public async Task Emit_Should_Work() { Document = new() { - Dsl = DslVersion.V010, + Dsl = DslVersion.V1Alpha2, Namespace = Namespace.DefaultNamespaceName, Name = "fake", Version = "0.1.0" diff --git a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/ForTaskExecutorTests.cs b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/ForTaskExecutorTests.cs index 3073d3f4b..1431d5dec 100644 --- a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/ForTaskExecutorTests.cs +++ b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/ForTaskExecutorTests.cs @@ -50,7 +50,7 @@ public async Task Iterate_Should_Work() { Document = new() { - Dsl = DslVersion.V010, + Dsl = DslVersion.V1Alpha2, Namespace = Namespace.DefaultNamespaceName, Name = "fake", Version = "0.1.0" diff --git a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/ForkTaskExecutorTests.cs b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/ForkTaskExecutorTests.cs index 31ab61eeb..5ac762220 100644 --- a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/ForkTaskExecutorTests.cs +++ b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/ForkTaskExecutorTests.cs @@ -61,7 +61,7 @@ public async Task Execute_Concurrently_Should_Work() { Document = new() { - Dsl = DslVersion.V010, + Dsl = DslVersion.V1Alpha2, Namespace = Namespace.DefaultNamespaceName, Name = "fake", Version = "0.1.0" diff --git a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/GrpcCallExecutorTests.cs b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/GrpcCallExecutorTests.cs index ff5e4538a..5ecf847cc 100644 --- a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/GrpcCallExecutorTests.cs +++ b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/GrpcCallExecutorTests.cs @@ -53,7 +53,7 @@ public async Task Call_Should_Work() { Document = new() { - Dsl = DslVersion.V010, + Dsl = DslVersion.V1Alpha2, Namespace = Namespace.DefaultNamespaceName, Name = "fake", Version = "0.1.0" diff --git a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/HttpCallExecutorTests.cs b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/HttpCallExecutorTests.cs index c6ae1928c..0a5f622c4 100644 --- a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/HttpCallExecutorTests.cs +++ b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/HttpCallExecutorTests.cs @@ -43,7 +43,7 @@ public async Task Post_And_Read_Json_Should_Work() { Document = new() { - Dsl = DslVersion.V010, + Dsl = DslVersion.V1Alpha2, Namespace = Namespace.DefaultNamespaceName, Name = "fake", Version = "0.1.0" diff --git a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/OpenApiCallExecutorTests.cs b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/OpenApiCallExecutorTests.cs index ee44715b6..59944ffb9 100644 --- a/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/OpenApiCallExecutorTests.cs +++ b/tests/Synapse.UnitTests/Cases/Runner/TaskExecutors/OpenApiCallExecutorTests.cs @@ -44,7 +44,7 @@ public async Task GetPetById_Should_Work() { Document = new() { - Dsl = DslVersion.V010, + Dsl = DslVersion.V1Alpha2, Namespace = Namespace.DefaultNamespaceName, Name = "fake", Version = "0.1.0" diff --git a/tests/Synapse.UnitTests/Cases/Runtime/NativeRuntimeTests.cs b/tests/Synapse.UnitTests/Cases/Runtime/NativeRuntimeTests.cs index 0f4793d5a..171179542 100644 --- a/tests/Synapse.UnitTests/Cases/Runtime/NativeRuntimeTests.cs +++ b/tests/Synapse.UnitTests/Cases/Runtime/NativeRuntimeTests.cs @@ -52,7 +52,7 @@ public async Task Create_Process_Should_Work() { Document = new() { - Dsl = DslVersion.V010, + Dsl = DslVersion.V1Alpha2, Namespace = Namespace.DefaultNamespaceName, Name = "test", Version = "0.1.0" diff --git a/tests/Synapse.UnitTests/Services/MockTaskExecutionContextFactory.cs b/tests/Synapse.UnitTests/Services/MockTaskExecutionContextFactory.cs index b037ed840..50cc8a447 100644 --- a/tests/Synapse.UnitTests/Services/MockTaskExecutionContextFactory.cs +++ b/tests/Synapse.UnitTests/Services/MockTaskExecutionContextFactory.cs @@ -32,7 +32,7 @@ internal static async Task> CreateAsync - - - - - + + + + +