Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/common/Elsa.Features/Implementations/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void Apply()
}

Services.AddSingleton<IInstalledFeatureRegistry>(registry);
Services.AddSingleton<IInstalledFeatureProvider>(sp => new InstalledFeatureProvider(sp.GetRequiredService<IInstalledFeatureRegistry>()));
}

private IEnumerable<IFeature> ExcludeFeaturesWithMissingDependencies(IEnumerable<IFeature> features)
Expand Down
1 change: 0 additions & 1 deletion src/modules/Elsa.Common/Elsa.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

<ItemGroup>
<PackageReference Include="Cronos" />
<!-- <PackageReference Include="CShells.Abstractions" />-->
<PackageReference Include="IronCompress" />
<PackageReference Include="LinqKit.Core" />
<PackageReference Include="DistributedLock.Core" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace Elsa.Common.ShellFeatures;

[ShellFeature("DefaultFormatters")]
public class DefaultFormattersFeature : IShellFeature
{
public void ConfigureServices(IServiceCollection services)
Expand Down
1 change: 1 addition & 0 deletions src/modules/Elsa.Common/ShellFeatures/MediatorFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Elsa.Common.ShellFeatures;
/// <summary>
/// Adds and configures the Mediator feature.
/// </summary>
[ShellFeature("Mediator")]
public class MediatorFeature : IShellFeature
{
public void ConfigureServices(IServiceCollection services)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Elsa.Common.ShellFeatures;

[ShellFeature("Multitenancy")]
public class MultitenancyFeature : IShellFeature
{
private readonly Func<IServiceProvider, ITenantsProvider> _tenantsProviderFactory = sp => sp.GetRequiredService<DefaultTenantsProvider>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Elsa.Common.ShellFeatures;

[UsedImplicitly]
[ShellFeature("StringCompression")]
public class StringCompressionFeature : IShellFeature
{
public void ConfigureServices(IServiceCollection services)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Elsa.Common.ShellFeatures;
/// <summary>
/// Configures the system clock.
/// </summary>
[ShellFeature("SystemClock")]
public class SystemClockFeature : IShellFeature
{
public void ConfigureServices(IServiceCollection services)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public void ConfigureServices(IServiceCollection services)
// JavaScript services.
services
.AddScoped<IJavaScriptEvaluator, JintJavaScriptEvaluator>()
.AddScoped<ITypeDefinitionService, TypeDefinitionService>()
.AddExpressionDescriptorProvider<JavaScriptExpressionDescriptorProvider>();

// Type definition services.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Elsa.Expressions.ShellFeatures;
/// <summary>
/// Installs and configures the expressions feature.
/// </summary>
[ShellFeature("Expressions")]
public class ExpressionsFeature : IShellFeature
{
public void ConfigureServices(IServiceCollection services)
Expand Down
4 changes: 2 additions & 2 deletions src/modules/Elsa.Identity/ShellFeatures/IdentityFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public class IdentityFeature : IFastEndpointsShellFeature

public void ConfigureServices(IServiceCollection services)
{
// Configure options with defaults
services.Configure<IdentityTokenOptions>(options => { options.SigningKey = "A really long signing key that should be replaced with something more secure."; });
// Configure options - Note: SigningKey must be configured by the application for security
services.Configure<IdentityTokenOptions>(_ => { });
Comment on lines +59 to +60
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking change - existing applications using IdentityFeature will need to explicitly configure the SigningKey in their startup code, otherwise token generation/validation will fail at runtime. Consider documenting migration steps.

services.Configure<ApiKeyOptions>(ApiKeyDefaults.AuthenticationScheme, options =>
{
options.Realm = "Elsa Workflows";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class PersistenceShellFeatureBase<TDbContext> : IShellFeature
public bool RunMigrations { get; set; } = true;

/// <summary>
/// Gets or sets the lifetime of the <see cref="IDbContextFactory{TContext}"/>. Defaults to <see cref="ServiceLifetime.Singleton"/>.
/// Gets or sets the lifetime of the <see cref="IDbContextFactory{TContext}"/>. Defaults to <see cref="ServiceLifetime.Scoped"/>.
/// </summary>
public ServiceLifetime DbContextFactoryLifetime { get; set; } = ServiceLifetime.Scoped;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ public void ConfigureServices(IServiceCollection services)
/// </summary>
public static string GetDefaultWorkflowsDirectory()
{
var entryAssemblyDir = Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!;
var directory = Path.Combine(entryAssemblyDir, "Workflows");
var entryAssembly = Assembly.GetEntryAssembly();
var entryAssemblyDir = entryAssembly != null
? Path.GetDirectoryName(entryAssembly.Location)
: AppContext.BaseDirectory;
var directory = Path.Combine(entryAssemblyDir!, "Workflows");
return directory;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/modules/Elsa.Workflows.Core/Elsa.Workflows.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</PropertyGroup>

<ItemGroup>
<!-- <PackageReference Include="CShells.Abstractions" />-->
<PackageReference Include="Humanizer.Core" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Logging" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace Elsa.Workflows.ShellFeatures;

[ShellFeature("CommitStrategies")]
public class CommitStrategiesFeature : IShellFeature
{
public void ConfigureServices(IServiceCollection services)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,6 @@ public void ConfigureServices(IServiceCollection services)

// Logging
.AddLogging();

// Flowchart
services.AddSerializationOptionsConfigurator<FlowchartSerializationOptionConfigurator>();

// Register FlowchartOptions
services.AddOptions<FlowchartOptions>();

// Overridable services
services.AddScoped<ICommitStateHandler, NoopCommitStateHandler>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,7 @@ public void ConfigureServices(IServiceCollection services)
.AddSingleton<VariableDefinitionMapper>()
.AddSingleton<WorkflowStateMapper>()
.AddScoped<IWorkflowInstanceStore, MemoryWorkflowInstanceStore>()
.AddScoped<IWorkflowDefinitionStore, MemoryWorkflowDefinitionStore>()
.AddSingleton<IWorkflowDefinitionCacheManager, WorkflowDefinitionCacheManager>()
.Decorate<IWorkflowDefinitionStore, CachingWorkflowDefinitionStore>()
.Decorate<IWorkflowDefinitionService, CachingWorkflowDefinitionService>()
.AddNotificationHandler<EvictWorkflowDefinitionServiceCache>();
.AddScoped<IWorkflowDefinitionStore, MemoryWorkflowDefinitionStore>();

services
.AddNotificationHandler<DeleteWorkflowInstances>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ public void ConfigureServices(IServiceCollection services)
{
options.Channels.AddRange(WorkflowDispatcherChannels.Values);
});
services.Configure<RecurringTaskOptions>(options =>
{
options.Schedule.ConfigureTask<TriggerBookmarkQueueRecurringTask>(TimeSpan.FromSeconds(10));
});

services
// Core.
Expand Down Expand Up @@ -182,9 +178,7 @@ public void ConfigureServices(IServiceCollection services)
.AddScoped<IBookmarkResumer, BookmarkResumer>()
.AddScoped<IBookmarkQueue, StoreBookmarkQueue>()
.AddScoped(WorkflowResumer)
.AddScoped<WorkflowResumer>()
.AddScoped(BookmarkQueueWorker)
.AddScoped<BookmarkQueueWorker>()
.AddScoped<ITriggerInvoker, TriggerInvoker>()
.AddScoped<IWorkflowCanceler, WorkflowCanceler>()
.AddScoped<IWorkflowCancellationService, WorkflowCancellationService>()
Expand Down Expand Up @@ -262,13 +256,5 @@ public void ConfigureServices(IServiceCollection services)
.AddScoped<IWorkflowActivationStrategy, CorrelatedSingletonStrategy>()
.AddScoped<IWorkflowActivationStrategy, CorrelationStrategy>()
;

services
// Decorators.
.Decorate<ITriggerStore, CachingTriggerStore>()

// Handlers.
.AddNotificationHandler<InvalidateTriggersCache>()
.AddNotificationHandler<InvalidateWorkflowsCache>();
}
}