Skip to content

Commit ef95e92

Browse files
authored
Merge pull request #467 from serverlessworkflow/feat-form-based-input
Updates the modal to create a new workflow instance by adding a form-based editor for the instance's input
2 parents 896b8d9 + 9f9c8d4 commit ef95e92

File tree

71 files changed

+1444
-248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1444
-248
lines changed

src/api/Synapse.Api.Application/Synapse.Api.Application.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<NeutralLanguage>en</NeutralLanguage>
88
<GenerateDocumentationFile>True</GenerateDocumentationFile>
99
<VersionPrefix>1.0.0</VersionPrefix>
10-
<VersionSuffix>alpha5.3</VersionSuffix>
10+
<VersionSuffix>alpha5.7</VersionSuffix>
1111
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
1212
<FileVersion>$(VersionPrefix)</FileVersion>
1313
<Authors>The Synapse Authors</Authors>

src/api/Synapse.Api.Client.Core/Synapse.Api.Client.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<NeutralLanguage>en</NeutralLanguage>
88
<GenerateDocumentationFile>True</GenerateDocumentationFile>
99
<VersionPrefix>1.0.0</VersionPrefix>
10-
<VersionSuffix>alpha5.3</VersionSuffix>
10+
<VersionSuffix>alpha5.7</VersionSuffix>
1111
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
1212
<FileVersion>$(VersionPrefix)</FileVersion>
1313
<Authors>The Synapse Authors</Authors>

src/api/Synapse.Api.Client.Http/Synapse.Api.Client.Http.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<NeutralLanguage>en</NeutralLanguage>
88
<GenerateDocumentationFile>True</GenerateDocumentationFile>
99
<VersionPrefix>1.0.0</VersionPrefix>
10-
<VersionSuffix>alpha5.3</VersionSuffix>
10+
<VersionSuffix>alpha5.7</VersionSuffix>
1111
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
1212
<FileVersion>$(VersionPrefix)</FileVersion>
1313
<Authors>The Synapse Authors</Authors>
@@ -43,7 +43,7 @@
4343

4444
<ItemGroup>
4545
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.0" />
46-
<PackageReference Include="ServerlessWorkflow.Sdk.IO" Version="1.0.0-alpha5.1" />
46+
<PackageReference Include="ServerlessWorkflow.Sdk.IO" Version="1.0.0-alpha5.2" />
4747
<PackageReference Include="System.Reactive" Version="6.0.1" />
4848
</ItemGroup>
4949

src/api/Synapse.Api.Http/Synapse.Api.Http.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<OutputType>Library</OutputType>
99
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1010
<VersionPrefix>1.0.0</VersionPrefix>
11-
<VersionSuffix>alpha5.3</VersionSuffix>
11+
<VersionSuffix>alpha5.7</VersionSuffix>
1212
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
1313
<FileVersion>$(VersionPrefix)</FileVersion>
1414
<Authors>The Synapse Authors</Authors>
@@ -43,8 +43,8 @@
4343
</ItemGroup>
4444

4545
<ItemGroup>
46-
<PackageReference Include="Neuroglia.Mediation.AspNetCore" Version="4.16.2" />
47-
<PackageReference Include="Neuroglia.Security.AspNetCore" Version="4.16.2" />
46+
<PackageReference Include="Neuroglia.Mediation.AspNetCore" Version="4.18.0" />
47+
<PackageReference Include="Neuroglia.Security.AspNetCore" Version="4.18.0" />
4848
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="7.1.0" />
4949
</ItemGroup>
5050

src/api/Synapse.Api.Server/Synapse.Api.Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<NeutralLanguage>en</NeutralLanguage>
88
<GenerateDocumentationFile>True</GenerateDocumentationFile>
99
<VersionPrefix>1.0.0</VersionPrefix>
10-
<VersionSuffix>alpha5.3</VersionSuffix>
10+
<VersionSuffix>alpha5.7</VersionSuffix>
1111
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
1212
<FileVersion>$(VersionPrefix)</FileVersion>
1313
<Authors>The Synapse Authors</Authors>

src/cli/Synapse.Cli/Synapse.Cli.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<NeutralLanguage>en</NeutralLanguage>
99
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1010
<VersionPrefix>1.0.0</VersionPrefix>
11-
<VersionSuffix>alpha5.3</VersionSuffix>
11+
<VersionSuffix>alpha5.7</VersionSuffix>
1212
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
1313
<FileVersion>$(VersionPrefix)</FileVersion>
1414
<Authors>The Synapse Authors</Authors>
@@ -33,7 +33,7 @@
3333
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
3434
<PackageReference Include="moment.net" Version="1.3.4" />
3535
<PackageReference Include="NetEscapades.Configuration.Yaml" Version="3.1.0" />
36-
<PackageReference Include="ServerlessWorkflow.Sdk.IO" Version="1.0.0-alpha5.1" />
36+
<PackageReference Include="ServerlessWorkflow.Sdk.IO" Version="1.0.0-alpha5.2" />
3737
<PackageReference Include="Spectre.Console" Version="0.49.1" />
3838
<PackageReference Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta4.22272.1" />
3939
</ItemGroup>

src/core/Synapse.Core.Infrastructure.Containers.Docker/Synapse.Core.Infrastructure.Containers.Docker.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<NeutralLanguage>en</NeutralLanguage>
88
<GenerateDocumentationFile>True</GenerateDocumentationFile>
99
<VersionPrefix>1.0.0</VersionPrefix>
10-
<VersionSuffix>alpha5.3</VersionSuffix>
10+
<VersionSuffix>alpha5.7</VersionSuffix>
1111
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
1212
<FileVersion>$(VersionPrefix)</FileVersion>
1313
<Authors>The Synapse Authors</Authors>

src/core/Synapse.Core.Infrastructure.Containers.Kubernetes/Synapse.Core.Infrastructure.Containers.Kubernetes.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<NeutralLanguage>en</NeutralLanguage>
88
<GenerateDocumentationFile>True</GenerateDocumentationFile>
99
<VersionPrefix>1.0.0</VersionPrefix>
10-
<VersionSuffix>alpha5.3</VersionSuffix>
10+
<VersionSuffix>alpha5.7</VersionSuffix>
1111
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
1212
<FileVersion>$(VersionPrefix)</FileVersion>
1313
<Authors>The Synapse Authors</Authors>

src/runner/Synapse.Runner/AuthorizationInfo.cs renamed to src/core/Synapse.Core.Infrastructure/AuthorizationInfo.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@
1111
// See the License for the specific language governing permissions and
1212
// limitations under the License.
1313

14+
using Microsoft.Extensions.DependencyInjection;
15+
using Microsoft.Extensions.Logging;
1416
using Neuroglia.Data.Infrastructure.ResourceOriented;
17+
using ServerlessWorkflow.Sdk;
1518
using ServerlessWorkflow.Sdk.Models.Authentication;
19+
using Synapse.Core.Infrastructure.Services;
1620
using System.Text;
1721

1822
namespace Synapse;
@@ -41,28 +45,28 @@ public class AuthorizationInfo(string scheme, string parameter)
4145
/// <summary>
4246
/// Creates a new <see cref="AuthorizationInfo"/> based on the specified <see cref="AuthenticationPolicyDefinition"/>
4347
/// </summary>
44-
/// <param name="workflow">The <see cref="WorkflowDefinition"/> that defines the <see cref="AuthenticationPolicyDefinition"/> to create a new <see cref="AuthorizationInfo"/> for</param>
4548
/// <param name="authentication">The <see cref="AuthenticationPolicyDefinition"/> to create a new <see cref="AuthorizationInfo"/> for</param>
4649
/// <param name="serviceProvider">The current <see cref="IServiceProvider"/></param>
50+
/// <param name="workflow">The <see cref="WorkflowDefinition"/>, if any, that defines the <see cref="AuthenticationPolicyDefinition"/> to create a new <see cref="AuthorizationInfo"/> for</param>
4751
/// <param name="cancellationToken">A <see cref="CancellationToken"/></param>
4852
/// <returns>A new <see cref="AuthorizationInfo"/> based on the specified <see cref="AuthenticationPolicyDefinition"/></returns>
49-
public static async Task<AuthorizationInfo> CreateAsync(WorkflowDefinition workflow, AuthenticationPolicyDefinition authentication, IServiceProvider serviceProvider, CancellationToken cancellationToken = default)
53+
public static async Task<AuthorizationInfo> CreateAsync( AuthenticationPolicyDefinition authentication, IServiceProvider serviceProvider, WorkflowDefinition? workflow = null, CancellationToken cancellationToken = default)
5054
{
5155
ArgumentNullException.ThrowIfNull(authentication);
5256
ArgumentNullException.ThrowIfNull(serviceProvider);
5357
string scheme, parameter;
5458
var logger = serviceProvider.GetRequiredService<ILoggerFactory>().CreateLogger("AuthenticationPolicyHandler");
5559
if (!string.IsNullOrWhiteSpace(authentication.Use))
5660
{
57-
if (workflow.Use?.Authentications?.TryGetValue(authentication.Use, out AuthenticationPolicyDefinition? referencedAuthentication) != true || referencedAuthentication == null) throw new NullReferenceException($"Failed to find the specified authentication policy '{authentication.Use}'");
61+
if (workflow?.Use?.Authentications?.TryGetValue(authentication.Use, out AuthenticationPolicyDefinition? referencedAuthentication) != true || referencedAuthentication == null) throw new NullReferenceException($"Failed to find the specified authentication policy '{authentication.Use}'");
5862
else authentication = referencedAuthentication;
5963
}
6064
var isSecretBased = authentication.TryGetBaseSecret(out var secretName);
6165
object? authenticationProperties = null;
6266
if (isSecretBased && !string.IsNullOrWhiteSpace(secretName))
6367
{
6468
logger.LogDebug("Authentication is secret based");
65-
var secretsManager = serviceProvider.GetRequiredService<ISecretsManager>();
69+
var secretsManager = serviceProvider.GetService<ISecretsManager>() ?? throw new NotSupportedException("Secret based authentication is not supported in this context");
6670
var secrets = await secretsManager.GetSecretsAsync(cancellationToken).ConfigureAwait(false);
6771
if (!secrets.TryGetValue(secretName, out authenticationProperties) || authenticationProperties == null)
6872
{

src/runner/Synapse.Runner/Extensions/HttpClientExtensions.cs renamed to src/core/Synapse.Core.Infrastructure/Extensions/HttpClientExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ public static class HttpClientExtensions
2525
/// Configures the <see cref="HttpClient"/> to use the specified authentication mechanism
2626
/// </summary>
2727
/// <param name="httpClient">The <see cref="HttpClient"/> to configure</param>
28-
/// <param name="workflow">The <see cref="WorkflowDefinition"/> that defines the authentication to configure</param>
2928
/// <param name="authentication">An object that describes the authentication mechanism to use</param>
3029
/// <param name="serviceProvider">The current <see cref="IServiceProvider"/></param>
30+
/// <param name="workflow">The <see cref="WorkflowDefinition"/>, if any, that defines the authentication to configure</param>
3131
/// <param name="cancellationToken">A <see cref="CancellationToken"/></param>
3232
/// <returns>A new awaitable <see cref="Task"/></returns>
33-
public static async Task ConfigureAuthenticationAsync(this HttpClient httpClient, WorkflowDefinition workflow, AuthenticationPolicyDefinition? authentication, IServiceProvider serviceProvider, CancellationToken cancellationToken = default)
33+
public static async Task ConfigureAuthenticationAsync(this HttpClient httpClient, AuthenticationPolicyDefinition? authentication, IServiceProvider serviceProvider, WorkflowDefinition? workflow = null, CancellationToken cancellationToken = default)
3434
{
35-
ArgumentNullException.ThrowIfNull(workflow);
35+
ArgumentNullException.ThrowIfNull(serviceProvider);
3636
if (authentication == null) return;
37-
var authorization = await AuthorizationInfo.CreateAsync(workflow, authentication, serviceProvider, cancellationToken).ConfigureAwait(false);
37+
var authorization = await AuthorizationInfo.CreateAsync(authentication, serviceProvider, workflow, cancellationToken).ConfigureAwait(false);
3838
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(authorization.Scheme, authorization.Parameter);
3939
}
4040

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy