elsa-core/src/modules/Elsa.Identity/README.md

102 lines
4.4 KiB
Markdown
Raw Normal View History

feat: extend shells integration and modular server support (#7399) * refactor(deps): use local CShells project refs Replace CShells NuGet package references with direct project references to the local CShells source to enable developing and testing against local changes and simplify build integration across modules. * Handle assembly load errors in feature discovery Added error handling for assembly load failures in feature discovery to improve resilience. Also updated configuration for identity token options and removed unused service bus consumer dependencies. Simplified project structure by moving and cleaning up `Directory.Build.targets` files. * Refactor configuration and service extension methods. Moved `ShellSettingsExtensions` and `ShellConfiguration` to `CShells.Abstractions` for better modularity. Added new `ServiceCollectionFeatureExtensions` to improve options registration. Updated appsettings and references to support these changes. * Introduce ManagementServiceCollectionExtensions to streamline activity and variable registration Added `ManagementServiceCollectionExtensions` for registering Elsa activity types and variable descriptors, providing a modular and shell-feature-compatible approach to configuration. Updated relevant features to utilize these new extension methods, enhancing code modularity and reducing redundancy. * Add resilience strategy registration to HTTP feature Introduced `ResilienceServiceCollectionExtensions` to register resilience strategies within the `Elsa.Resilience.Core` module. Updated `HttpFeature` to incorporate resilience strategies, enhancing HTTP-related resilience configuration leveraging the new extension methods. * Add new configuration options to JavaScriptFeature Implemented multiple properties in `JavaScriptFeature` to enhance JavaScript execution: `AllowClrAccess`, `AllowConfigurationAccess`, `ScriptCacheTimeout`, `DisableWrappers`, and `DisableVariableCopying`. These additions enable more flexible and secure configuration of the Jint JavaScript engine. * refactor(workflows): unify graph caching Resolve workflow definitions first and store graphs under stable per-version-ID cache keys so different lookup paths share entries. Centralize cache creation and change-token registration to remove duplicated caching logic. Skip materializer-unavailable definitions to avoid caching null graphs and simplify flow. * refactor(tests): centralize default IDs and materializer setup Introduce constants for default definition and version IDs, and materializer name. Refactor tests to use these constants, streamline graph and definition resolution, and improve cache key creation by sharing logic across tests. Extend tests to check scenarios with unavailable materializers, ensuring caching only occurs for valid cases. * extend(tests): enhance cache key verification in AutoUpdateTests Added checks for both workflow definition and version cache keys in AutoUpdateTests to ensure comprehensive cache validation, improving test reliability and coverage. * refactor(projects): update CShells project paths and solution configuration Revised project reference paths in `Elsa.ModularServer.Web.csproj` for CShells projects and updated `Elsa.sln` to include new CShells projects, streamlining project organization and build configuration. * Add `IWorkflowReferenceGraphBuilder` to `WorkflowManagementFeature`; rename `ResilienceShellFeature` to `ResilienceFeature`. * Refactor `HttpFeature` to use `IMiddlewareShellFeature`, include `HttpWorkflowsMiddleware`, and update `HttpActivityOptions` defaults. * Add `AddTypeAlias` and `AddVariableTypeAndAlias` extension methods to service collections - Introduced `AddTypeAlias<T>` method in `ServiceCollectionExtensions.cs` for adding type aliases. - Added `AddVariableTypeAndAlias<T>` method in `ManagementServiceCollectionExtensions.cs` to add variable types with aliases. * Remove shell reload API endpoints, orchestrator, and associated tests from the codebase. * Introduce `DefaultAdminUser` options and refactor `AdminUserInitializer` to use `IOptions`. * Add user management endpoints: Delete, List, Update with enhanced user store functionality * Implement `DefaultAdminUser` feature for initial admin bootstrap, decouple `SecurityRoot` from user management endpoints, update related documentation and permissions. * Add role management endpoints: Delete, List, and Update, including role data models and handle obsolete SecurityRoot policy. * Update CShells package references to version 0.0.12-preview.66 and refactor `TenantTaskManager` for improved task lifecycle management. * Replace project references with package references in csproj files and remove unused folders. * Integrate Nuplane features, add sample packages, and update dependency handling within ModularServer Web. * Improve `CShells` startup endpoint registration and resolver handling - Address duplicate endpoint registration by adding state-aware tracking and deduplication - Resolve `WebRoutingShellResolver` constructor ambiguity by switching to factory-based registration - Implement a startup-specific filter to prevent redundant endpoint remapping during `ShellsReloaded` - Update project to use project references for `CShells` and `Nuplane` components in csproj files. * Update logging configuration in appsettings for Development and Production - Change default log level to 'Warning' in Development settings - Adjust Microsoft.Hosting and Elsa.SamplePackage log levels to 'Information' - Remove Microsoft.EntityFrameworkCore log level entry from Production settings * Refactor assembly retrieval methods and update endpoint calls for consistency. * Add `SampleEndpointFeature` and enhance logging and service integration - Implement `SampleEndpointFeature` with a new endpoint for handling requests. - Log endpoint access and integrate `ISampleService` with method `DoSomething`. - Update logging configuration to include `CShells` and `Nuplane` log levels in Development settings. - Update `Elsa.SamplePackage` to version 1.0.1 and manage dependencies with project and assembly references. - Modify JSON configuration for `SampleEndpoint`. * Update package versions for `CShells` to 0.0.13 and `Nuplane` to 0.0.1-preview.15 in props file. * Refactor `DefaultAdminUserFeature` by renaming `ConfigureServices` to `Apply` and adjusting service registration method. * Replace project references with package references across multiple projects and remove obsolete cshells-related solution entries. * Remove `SampleCatalogEndpointExtensions.cs` and related endpoint mappings. * Improve `TenantTaskManager` by using `TryRemove` for state clean-up and clarify `SemaphoreSlim` disposal behavior. * Remove hardcoded default admin credentials and add warning for unconfigured AdminRoleName in admin user setup. * Address unresolved review comments: fix doc comments, security defaults, compilation issue, and restore reload response contracts Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Refine reload endpoints: use specific exceptions, add error messages, rename ReloadedAt to Timestamp, remove unused model Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Add `ExceptionExtensions` with `IsFatal` method and simplify exception handling in `TenantTaskManager`. Remove unused properties from `Directory.Build.props`. * Add unit tests for `TenantTaskManager` and fix potential state orphaning issue. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Fix logger dependency in `SampleEndpointFeature` constructor to use correct type. * Add unit tests for Elsa Shells API endpoints and update solution configuration. * Refactor ShellReload models: remove ShellReloadItemResult, update ShellReloadResponse properties. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-18 12:33:34 +00:00
# Elsa.Identity
## JWT Signing Key Configuration
Identity token signing requires a secure random key. Configure it through environment variables or a secrets manager and keep it out of committed appsettings files.
- Code-first hosts using `Identity:Tokens` should set `Identity__Tokens__SigningKey`.
- Shell-based hosts should set the shell feature path, for example `CShells__Shells__Default__Features__Identity__SigningKey`.
- Production startup rejects missing keys, keys shorter than 32 ASCII characters, and known public defaults. Known public defaults are tolerated only in the explicit `Development` or `Demo` environments.
feat: extend shells integration and modular server support (#7399) * refactor(deps): use local CShells project refs Replace CShells NuGet package references with direct project references to the local CShells source to enable developing and testing against local changes and simplify build integration across modules. * Handle assembly load errors in feature discovery Added error handling for assembly load failures in feature discovery to improve resilience. Also updated configuration for identity token options and removed unused service bus consumer dependencies. Simplified project structure by moving and cleaning up `Directory.Build.targets` files. * Refactor configuration and service extension methods. Moved `ShellSettingsExtensions` and `ShellConfiguration` to `CShells.Abstractions` for better modularity. Added new `ServiceCollectionFeatureExtensions` to improve options registration. Updated appsettings and references to support these changes. * Introduce ManagementServiceCollectionExtensions to streamline activity and variable registration Added `ManagementServiceCollectionExtensions` for registering Elsa activity types and variable descriptors, providing a modular and shell-feature-compatible approach to configuration. Updated relevant features to utilize these new extension methods, enhancing code modularity and reducing redundancy. * Add resilience strategy registration to HTTP feature Introduced `ResilienceServiceCollectionExtensions` to register resilience strategies within the `Elsa.Resilience.Core` module. Updated `HttpFeature` to incorporate resilience strategies, enhancing HTTP-related resilience configuration leveraging the new extension methods. * Add new configuration options to JavaScriptFeature Implemented multiple properties in `JavaScriptFeature` to enhance JavaScript execution: `AllowClrAccess`, `AllowConfigurationAccess`, `ScriptCacheTimeout`, `DisableWrappers`, and `DisableVariableCopying`. These additions enable more flexible and secure configuration of the Jint JavaScript engine. * refactor(workflows): unify graph caching Resolve workflow definitions first and store graphs under stable per-version-ID cache keys so different lookup paths share entries. Centralize cache creation and change-token registration to remove duplicated caching logic. Skip materializer-unavailable definitions to avoid caching null graphs and simplify flow. * refactor(tests): centralize default IDs and materializer setup Introduce constants for default definition and version IDs, and materializer name. Refactor tests to use these constants, streamline graph and definition resolution, and improve cache key creation by sharing logic across tests. Extend tests to check scenarios with unavailable materializers, ensuring caching only occurs for valid cases. * extend(tests): enhance cache key verification in AutoUpdateTests Added checks for both workflow definition and version cache keys in AutoUpdateTests to ensure comprehensive cache validation, improving test reliability and coverage. * refactor(projects): update CShells project paths and solution configuration Revised project reference paths in `Elsa.ModularServer.Web.csproj` for CShells projects and updated `Elsa.sln` to include new CShells projects, streamlining project organization and build configuration. * Add `IWorkflowReferenceGraphBuilder` to `WorkflowManagementFeature`; rename `ResilienceShellFeature` to `ResilienceFeature`. * Refactor `HttpFeature` to use `IMiddlewareShellFeature`, include `HttpWorkflowsMiddleware`, and update `HttpActivityOptions` defaults. * Add `AddTypeAlias` and `AddVariableTypeAndAlias` extension methods to service collections - Introduced `AddTypeAlias<T>` method in `ServiceCollectionExtensions.cs` for adding type aliases. - Added `AddVariableTypeAndAlias<T>` method in `ManagementServiceCollectionExtensions.cs` to add variable types with aliases. * Remove shell reload API endpoints, orchestrator, and associated tests from the codebase. * Introduce `DefaultAdminUser` options and refactor `AdminUserInitializer` to use `IOptions`. * Add user management endpoints: Delete, List, Update with enhanced user store functionality * Implement `DefaultAdminUser` feature for initial admin bootstrap, decouple `SecurityRoot` from user management endpoints, update related documentation and permissions. * Add role management endpoints: Delete, List, and Update, including role data models and handle obsolete SecurityRoot policy. * Update CShells package references to version 0.0.12-preview.66 and refactor `TenantTaskManager` for improved task lifecycle management. * Replace project references with package references in csproj files and remove unused folders. * Integrate Nuplane features, add sample packages, and update dependency handling within ModularServer Web. * Improve `CShells` startup endpoint registration and resolver handling - Address duplicate endpoint registration by adding state-aware tracking and deduplication - Resolve `WebRoutingShellResolver` constructor ambiguity by switching to factory-based registration - Implement a startup-specific filter to prevent redundant endpoint remapping during `ShellsReloaded` - Update project to use project references for `CShells` and `Nuplane` components in csproj files. * Update logging configuration in appsettings for Development and Production - Change default log level to 'Warning' in Development settings - Adjust Microsoft.Hosting and Elsa.SamplePackage log levels to 'Information' - Remove Microsoft.EntityFrameworkCore log level entry from Production settings * Refactor assembly retrieval methods and update endpoint calls for consistency. * Add `SampleEndpointFeature` and enhance logging and service integration - Implement `SampleEndpointFeature` with a new endpoint for handling requests. - Log endpoint access and integrate `ISampleService` with method `DoSomething`. - Update logging configuration to include `CShells` and `Nuplane` log levels in Development settings. - Update `Elsa.SamplePackage` to version 1.0.1 and manage dependencies with project and assembly references. - Modify JSON configuration for `SampleEndpoint`. * Update package versions for `CShells` to 0.0.13 and `Nuplane` to 0.0.1-preview.15 in props file. * Refactor `DefaultAdminUserFeature` by renaming `ConfigureServices` to `Apply` and adjusting service registration method. * Replace project references with package references across multiple projects and remove obsolete cshells-related solution entries. * Remove `SampleCatalogEndpointExtensions.cs` and related endpoint mappings. * Improve `TenantTaskManager` by using `TryRemove` for state clean-up and clarify `SemaphoreSlim` disposal behavior. * Remove hardcoded default admin credentials and add warning for unconfigured AdminRoleName in admin user setup. * Address unresolved review comments: fix doc comments, security defaults, compilation issue, and restore reload response contracts Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Refine reload endpoints: use specific exceptions, add error messages, rename ReloadedAt to Timestamp, remove unused model Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Add `ExceptionExtensions` with `IsFatal` method and simplify exception handling in `TenantTaskManager`. Remove unused properties from `Directory.Build.props`. * Add unit tests for `TenantTaskManager` and fix potential state orphaning issue. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Fix logger dependency in `SampleEndpointFeature` constructor to use correct type. * Add unit tests for Elsa Shells API endpoints and update solution configuration. * Refactor ShellReload models: remove ShellReloadItemResult, update ShellReloadResponse properties. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-18 12:33:34 +00:00
## Default Admin User Bootstrap
Elsa supports bootstrapping an initial admin role and user through the `DefaultAdminUser` feature.
This is the recommended way to initialize identity access now that user-management endpoints are permission-based and no longer rely on the `SecurityRoot` policy.
See `doc/adr/0010-default-admin-user-bootstrap-for-initial-identity-access.md` for the architectural decision.
### New shell functionality (recommended)
When using shell-based configuration (`CShells`), configure the `DefaultAdminUser` shell feature.
Example (`appsettings.json`):
```json
{
"CShells": {
"Shells": [
{
"Name": "Default",
"Features": {
"Identity": {},
feat: extend shells integration and modular server support (#7399) * refactor(deps): use local CShells project refs Replace CShells NuGet package references with direct project references to the local CShells source to enable developing and testing against local changes and simplify build integration across modules. * Handle assembly load errors in feature discovery Added error handling for assembly load failures in feature discovery to improve resilience. Also updated configuration for identity token options and removed unused service bus consumer dependencies. Simplified project structure by moving and cleaning up `Directory.Build.targets` files. * Refactor configuration and service extension methods. Moved `ShellSettingsExtensions` and `ShellConfiguration` to `CShells.Abstractions` for better modularity. Added new `ServiceCollectionFeatureExtensions` to improve options registration. Updated appsettings and references to support these changes. * Introduce ManagementServiceCollectionExtensions to streamline activity and variable registration Added `ManagementServiceCollectionExtensions` for registering Elsa activity types and variable descriptors, providing a modular and shell-feature-compatible approach to configuration. Updated relevant features to utilize these new extension methods, enhancing code modularity and reducing redundancy. * Add resilience strategy registration to HTTP feature Introduced `ResilienceServiceCollectionExtensions` to register resilience strategies within the `Elsa.Resilience.Core` module. Updated `HttpFeature` to incorporate resilience strategies, enhancing HTTP-related resilience configuration leveraging the new extension methods. * Add new configuration options to JavaScriptFeature Implemented multiple properties in `JavaScriptFeature` to enhance JavaScript execution: `AllowClrAccess`, `AllowConfigurationAccess`, `ScriptCacheTimeout`, `DisableWrappers`, and `DisableVariableCopying`. These additions enable more flexible and secure configuration of the Jint JavaScript engine. * refactor(workflows): unify graph caching Resolve workflow definitions first and store graphs under stable per-version-ID cache keys so different lookup paths share entries. Centralize cache creation and change-token registration to remove duplicated caching logic. Skip materializer-unavailable definitions to avoid caching null graphs and simplify flow. * refactor(tests): centralize default IDs and materializer setup Introduce constants for default definition and version IDs, and materializer name. Refactor tests to use these constants, streamline graph and definition resolution, and improve cache key creation by sharing logic across tests. Extend tests to check scenarios with unavailable materializers, ensuring caching only occurs for valid cases. * extend(tests): enhance cache key verification in AutoUpdateTests Added checks for both workflow definition and version cache keys in AutoUpdateTests to ensure comprehensive cache validation, improving test reliability and coverage. * refactor(projects): update CShells project paths and solution configuration Revised project reference paths in `Elsa.ModularServer.Web.csproj` for CShells projects and updated `Elsa.sln` to include new CShells projects, streamlining project organization and build configuration. * Add `IWorkflowReferenceGraphBuilder` to `WorkflowManagementFeature`; rename `ResilienceShellFeature` to `ResilienceFeature`. * Refactor `HttpFeature` to use `IMiddlewareShellFeature`, include `HttpWorkflowsMiddleware`, and update `HttpActivityOptions` defaults. * Add `AddTypeAlias` and `AddVariableTypeAndAlias` extension methods to service collections - Introduced `AddTypeAlias<T>` method in `ServiceCollectionExtensions.cs` for adding type aliases. - Added `AddVariableTypeAndAlias<T>` method in `ManagementServiceCollectionExtensions.cs` to add variable types with aliases. * Remove shell reload API endpoints, orchestrator, and associated tests from the codebase. * Introduce `DefaultAdminUser` options and refactor `AdminUserInitializer` to use `IOptions`. * Add user management endpoints: Delete, List, Update with enhanced user store functionality * Implement `DefaultAdminUser` feature for initial admin bootstrap, decouple `SecurityRoot` from user management endpoints, update related documentation and permissions. * Add role management endpoints: Delete, List, and Update, including role data models and handle obsolete SecurityRoot policy. * Update CShells package references to version 0.0.12-preview.66 and refactor `TenantTaskManager` for improved task lifecycle management. * Replace project references with package references in csproj files and remove unused folders. * Integrate Nuplane features, add sample packages, and update dependency handling within ModularServer Web. * Improve `CShells` startup endpoint registration and resolver handling - Address duplicate endpoint registration by adding state-aware tracking and deduplication - Resolve `WebRoutingShellResolver` constructor ambiguity by switching to factory-based registration - Implement a startup-specific filter to prevent redundant endpoint remapping during `ShellsReloaded` - Update project to use project references for `CShells` and `Nuplane` components in csproj files. * Update logging configuration in appsettings for Development and Production - Change default log level to 'Warning' in Development settings - Adjust Microsoft.Hosting and Elsa.SamplePackage log levels to 'Information' - Remove Microsoft.EntityFrameworkCore log level entry from Production settings * Refactor assembly retrieval methods and update endpoint calls for consistency. * Add `SampleEndpointFeature` and enhance logging and service integration - Implement `SampleEndpointFeature` with a new endpoint for handling requests. - Log endpoint access and integrate `ISampleService` with method `DoSomething`. - Update logging configuration to include `CShells` and `Nuplane` log levels in Development settings. - Update `Elsa.SamplePackage` to version 1.0.1 and manage dependencies with project and assembly references. - Modify JSON configuration for `SampleEndpoint`. * Update package versions for `CShells` to 0.0.13 and `Nuplane` to 0.0.1-preview.15 in props file. * Refactor `DefaultAdminUserFeature` by renaming `ConfigureServices` to `Apply` and adjusting service registration method. * Replace project references with package references across multiple projects and remove obsolete cshells-related solution entries. * Remove `SampleCatalogEndpointExtensions.cs` and related endpoint mappings. * Improve `TenantTaskManager` by using `TryRemove` for state clean-up and clarify `SemaphoreSlim` disposal behavior. * Remove hardcoded default admin credentials and add warning for unconfigured AdminRoleName in admin user setup. * Address unresolved review comments: fix doc comments, security defaults, compilation issue, and restore reload response contracts Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Refine reload endpoints: use specific exceptions, add error messages, rename ReloadedAt to Timestamp, remove unused model Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Add `ExceptionExtensions` with `IsFatal` method and simplify exception handling in `TenantTaskManager`. Remove unused properties from `Directory.Build.props`. * Add unit tests for `TenantTaskManager` and fix potential state orphaning issue. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Fix logger dependency in `SampleEndpointFeature` constructor to use correct type. * Add unit tests for Elsa Shells API endpoints and update solution configuration. * Refactor ShellReload models: remove ShellReloadItemResult, update ShellReloadResponse properties. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-18 12:33:34 +00:00
"DefaultAuthentication": {},
"DefaultAdminUser": {
"AdminUserName": "admin",
"AdminPassword": "REPLACE_WITH_SECURE_BOOTSTRAP_PASSWORD",
feat: extend shells integration and modular server support (#7399) * refactor(deps): use local CShells project refs Replace CShells NuGet package references with direct project references to the local CShells source to enable developing and testing against local changes and simplify build integration across modules. * Handle assembly load errors in feature discovery Added error handling for assembly load failures in feature discovery to improve resilience. Also updated configuration for identity token options and removed unused service bus consumer dependencies. Simplified project structure by moving and cleaning up `Directory.Build.targets` files. * Refactor configuration and service extension methods. Moved `ShellSettingsExtensions` and `ShellConfiguration` to `CShells.Abstractions` for better modularity. Added new `ServiceCollectionFeatureExtensions` to improve options registration. Updated appsettings and references to support these changes. * Introduce ManagementServiceCollectionExtensions to streamline activity and variable registration Added `ManagementServiceCollectionExtensions` for registering Elsa activity types and variable descriptors, providing a modular and shell-feature-compatible approach to configuration. Updated relevant features to utilize these new extension methods, enhancing code modularity and reducing redundancy. * Add resilience strategy registration to HTTP feature Introduced `ResilienceServiceCollectionExtensions` to register resilience strategies within the `Elsa.Resilience.Core` module. Updated `HttpFeature` to incorporate resilience strategies, enhancing HTTP-related resilience configuration leveraging the new extension methods. * Add new configuration options to JavaScriptFeature Implemented multiple properties in `JavaScriptFeature` to enhance JavaScript execution: `AllowClrAccess`, `AllowConfigurationAccess`, `ScriptCacheTimeout`, `DisableWrappers`, and `DisableVariableCopying`. These additions enable more flexible and secure configuration of the Jint JavaScript engine. * refactor(workflows): unify graph caching Resolve workflow definitions first and store graphs under stable per-version-ID cache keys so different lookup paths share entries. Centralize cache creation and change-token registration to remove duplicated caching logic. Skip materializer-unavailable definitions to avoid caching null graphs and simplify flow. * refactor(tests): centralize default IDs and materializer setup Introduce constants for default definition and version IDs, and materializer name. Refactor tests to use these constants, streamline graph and definition resolution, and improve cache key creation by sharing logic across tests. Extend tests to check scenarios with unavailable materializers, ensuring caching only occurs for valid cases. * extend(tests): enhance cache key verification in AutoUpdateTests Added checks for both workflow definition and version cache keys in AutoUpdateTests to ensure comprehensive cache validation, improving test reliability and coverage. * refactor(projects): update CShells project paths and solution configuration Revised project reference paths in `Elsa.ModularServer.Web.csproj` for CShells projects and updated `Elsa.sln` to include new CShells projects, streamlining project organization and build configuration. * Add `IWorkflowReferenceGraphBuilder` to `WorkflowManagementFeature`; rename `ResilienceShellFeature` to `ResilienceFeature`. * Refactor `HttpFeature` to use `IMiddlewareShellFeature`, include `HttpWorkflowsMiddleware`, and update `HttpActivityOptions` defaults. * Add `AddTypeAlias` and `AddVariableTypeAndAlias` extension methods to service collections - Introduced `AddTypeAlias<T>` method in `ServiceCollectionExtensions.cs` for adding type aliases. - Added `AddVariableTypeAndAlias<T>` method in `ManagementServiceCollectionExtensions.cs` to add variable types with aliases. * Remove shell reload API endpoints, orchestrator, and associated tests from the codebase. * Introduce `DefaultAdminUser` options and refactor `AdminUserInitializer` to use `IOptions`. * Add user management endpoints: Delete, List, Update with enhanced user store functionality * Implement `DefaultAdminUser` feature for initial admin bootstrap, decouple `SecurityRoot` from user management endpoints, update related documentation and permissions. * Add role management endpoints: Delete, List, and Update, including role data models and handle obsolete SecurityRoot policy. * Update CShells package references to version 0.0.12-preview.66 and refactor `TenantTaskManager` for improved task lifecycle management. * Replace project references with package references in csproj files and remove unused folders. * Integrate Nuplane features, add sample packages, and update dependency handling within ModularServer Web. * Improve `CShells` startup endpoint registration and resolver handling - Address duplicate endpoint registration by adding state-aware tracking and deduplication - Resolve `WebRoutingShellResolver` constructor ambiguity by switching to factory-based registration - Implement a startup-specific filter to prevent redundant endpoint remapping during `ShellsReloaded` - Update project to use project references for `CShells` and `Nuplane` components in csproj files. * Update logging configuration in appsettings for Development and Production - Change default log level to 'Warning' in Development settings - Adjust Microsoft.Hosting and Elsa.SamplePackage log levels to 'Information' - Remove Microsoft.EntityFrameworkCore log level entry from Production settings * Refactor assembly retrieval methods and update endpoint calls for consistency. * Add `SampleEndpointFeature` and enhance logging and service integration - Implement `SampleEndpointFeature` with a new endpoint for handling requests. - Log endpoint access and integrate `ISampleService` with method `DoSomething`. - Update logging configuration to include `CShells` and `Nuplane` log levels in Development settings. - Update `Elsa.SamplePackage` to version 1.0.1 and manage dependencies with project and assembly references. - Modify JSON configuration for `SampleEndpoint`. * Update package versions for `CShells` to 0.0.13 and `Nuplane` to 0.0.1-preview.15 in props file. * Refactor `DefaultAdminUserFeature` by renaming `ConfigureServices` to `Apply` and adjusting service registration method. * Replace project references with package references across multiple projects and remove obsolete cshells-related solution entries. * Remove `SampleCatalogEndpointExtensions.cs` and related endpoint mappings. * Improve `TenantTaskManager` by using `TryRemove` for state clean-up and clarify `SemaphoreSlim` disposal behavior. * Remove hardcoded default admin credentials and add warning for unconfigured AdminRoleName in admin user setup. * Address unresolved review comments: fix doc comments, security defaults, compilation issue, and restore reload response contracts Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Refine reload endpoints: use specific exceptions, add error messages, rename ReloadedAt to Timestamp, remove unused model Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Add `ExceptionExtensions` with `IsFatal` method and simplify exception handling in `TenantTaskManager`. Remove unused properties from `Directory.Build.props`. * Add unit tests for `TenantTaskManager` and fix potential state orphaning issue. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Fix logger dependency in `SampleEndpointFeature` constructor to use correct type. * Add unit tests for Elsa Shells API endpoints and update solution configuration. * Refactor ShellReload models: remove ShellReloadItemResult, update ShellReloadResponse properties. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-18 12:33:34 +00:00
"AdminRoleName": "admin",
"AdminRolePermissions": ["*"]
}
}
}
]
}
}
```
This maps to `Elsa.Identity.ShellFeatures.DefaultAdminUserFeature` and configures `DefaultAdminUserOptions` at startup.
### Legacy feature system (code-first)
When using the legacy feature system (module configuration in code), call `UseDefaultAdmin` while configuring `Identity`.
```csharp
services.AddElsa(elsa =>
{
elsa
.UseIdentity(identity =>
{
identity.TokenOptions += options =>
{
options.SigningKey = builder.Configuration.GetRequiredSection("Identity:Tokens")["SigningKey"]!;
feat: extend shells integration and modular server support (#7399) * refactor(deps): use local CShells project refs Replace CShells NuGet package references with direct project references to the local CShells source to enable developing and testing against local changes and simplify build integration across modules. * Handle assembly load errors in feature discovery Added error handling for assembly load failures in feature discovery to improve resilience. Also updated configuration for identity token options and removed unused service bus consumer dependencies. Simplified project structure by moving and cleaning up `Directory.Build.targets` files. * Refactor configuration and service extension methods. Moved `ShellSettingsExtensions` and `ShellConfiguration` to `CShells.Abstractions` for better modularity. Added new `ServiceCollectionFeatureExtensions` to improve options registration. Updated appsettings and references to support these changes. * Introduce ManagementServiceCollectionExtensions to streamline activity and variable registration Added `ManagementServiceCollectionExtensions` for registering Elsa activity types and variable descriptors, providing a modular and shell-feature-compatible approach to configuration. Updated relevant features to utilize these new extension methods, enhancing code modularity and reducing redundancy. * Add resilience strategy registration to HTTP feature Introduced `ResilienceServiceCollectionExtensions` to register resilience strategies within the `Elsa.Resilience.Core` module. Updated `HttpFeature` to incorporate resilience strategies, enhancing HTTP-related resilience configuration leveraging the new extension methods. * Add new configuration options to JavaScriptFeature Implemented multiple properties in `JavaScriptFeature` to enhance JavaScript execution: `AllowClrAccess`, `AllowConfigurationAccess`, `ScriptCacheTimeout`, `DisableWrappers`, and `DisableVariableCopying`. These additions enable more flexible and secure configuration of the Jint JavaScript engine. * refactor(workflows): unify graph caching Resolve workflow definitions first and store graphs under stable per-version-ID cache keys so different lookup paths share entries. Centralize cache creation and change-token registration to remove duplicated caching logic. Skip materializer-unavailable definitions to avoid caching null graphs and simplify flow. * refactor(tests): centralize default IDs and materializer setup Introduce constants for default definition and version IDs, and materializer name. Refactor tests to use these constants, streamline graph and definition resolution, and improve cache key creation by sharing logic across tests. Extend tests to check scenarios with unavailable materializers, ensuring caching only occurs for valid cases. * extend(tests): enhance cache key verification in AutoUpdateTests Added checks for both workflow definition and version cache keys in AutoUpdateTests to ensure comprehensive cache validation, improving test reliability and coverage. * refactor(projects): update CShells project paths and solution configuration Revised project reference paths in `Elsa.ModularServer.Web.csproj` for CShells projects and updated `Elsa.sln` to include new CShells projects, streamlining project organization and build configuration. * Add `IWorkflowReferenceGraphBuilder` to `WorkflowManagementFeature`; rename `ResilienceShellFeature` to `ResilienceFeature`. * Refactor `HttpFeature` to use `IMiddlewareShellFeature`, include `HttpWorkflowsMiddleware`, and update `HttpActivityOptions` defaults. * Add `AddTypeAlias` and `AddVariableTypeAndAlias` extension methods to service collections - Introduced `AddTypeAlias<T>` method in `ServiceCollectionExtensions.cs` for adding type aliases. - Added `AddVariableTypeAndAlias<T>` method in `ManagementServiceCollectionExtensions.cs` to add variable types with aliases. * Remove shell reload API endpoints, orchestrator, and associated tests from the codebase. * Introduce `DefaultAdminUser` options and refactor `AdminUserInitializer` to use `IOptions`. * Add user management endpoints: Delete, List, Update with enhanced user store functionality * Implement `DefaultAdminUser` feature for initial admin bootstrap, decouple `SecurityRoot` from user management endpoints, update related documentation and permissions. * Add role management endpoints: Delete, List, and Update, including role data models and handle obsolete SecurityRoot policy. * Update CShells package references to version 0.0.12-preview.66 and refactor `TenantTaskManager` for improved task lifecycle management. * Replace project references with package references in csproj files and remove unused folders. * Integrate Nuplane features, add sample packages, and update dependency handling within ModularServer Web. * Improve `CShells` startup endpoint registration and resolver handling - Address duplicate endpoint registration by adding state-aware tracking and deduplication - Resolve `WebRoutingShellResolver` constructor ambiguity by switching to factory-based registration - Implement a startup-specific filter to prevent redundant endpoint remapping during `ShellsReloaded` - Update project to use project references for `CShells` and `Nuplane` components in csproj files. * Update logging configuration in appsettings for Development and Production - Change default log level to 'Warning' in Development settings - Adjust Microsoft.Hosting and Elsa.SamplePackage log levels to 'Information' - Remove Microsoft.EntityFrameworkCore log level entry from Production settings * Refactor assembly retrieval methods and update endpoint calls for consistency. * Add `SampleEndpointFeature` and enhance logging and service integration - Implement `SampleEndpointFeature` with a new endpoint for handling requests. - Log endpoint access and integrate `ISampleService` with method `DoSomething`. - Update logging configuration to include `CShells` and `Nuplane` log levels in Development settings. - Update `Elsa.SamplePackage` to version 1.0.1 and manage dependencies with project and assembly references. - Modify JSON configuration for `SampleEndpoint`. * Update package versions for `CShells` to 0.0.13 and `Nuplane` to 0.0.1-preview.15 in props file. * Refactor `DefaultAdminUserFeature` by renaming `ConfigureServices` to `Apply` and adjusting service registration method. * Replace project references with package references across multiple projects and remove obsolete cshells-related solution entries. * Remove `SampleCatalogEndpointExtensions.cs` and related endpoint mappings. * Improve `TenantTaskManager` by using `TryRemove` for state clean-up and clarify `SemaphoreSlim` disposal behavior. * Remove hardcoded default admin credentials and add warning for unconfigured AdminRoleName in admin user setup. * Address unresolved review comments: fix doc comments, security defaults, compilation issue, and restore reload response contracts Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Refine reload endpoints: use specific exceptions, add error messages, rename ReloadedAt to Timestamp, remove unused model Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Add `ExceptionExtensions` with `IsFatal` method and simplify exception handling in `TenantTaskManager`. Remove unused properties from `Directory.Build.props`. * Add unit tests for `TenantTaskManager` and fix potential state orphaning issue. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Fix logger dependency in `SampleEndpointFeature` constructor to use correct type. * Add unit tests for Elsa Shells API endpoints and update solution configuration. * Refactor ShellReload models: remove ShellReloadItemResult, update ShellReloadResponse properties. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-18 12:33:34 +00:00
};
identity.UseDefaultAdmin(admin => admin
.WithAdminUserName("admin")
.WithAdminPassword("REPLACE_WITH_SECURE_BOOTSTRAP_PASSWORD")
feat: extend shells integration and modular server support (#7399) * refactor(deps): use local CShells project refs Replace CShells NuGet package references with direct project references to the local CShells source to enable developing and testing against local changes and simplify build integration across modules. * Handle assembly load errors in feature discovery Added error handling for assembly load failures in feature discovery to improve resilience. Also updated configuration for identity token options and removed unused service bus consumer dependencies. Simplified project structure by moving and cleaning up `Directory.Build.targets` files. * Refactor configuration and service extension methods. Moved `ShellSettingsExtensions` and `ShellConfiguration` to `CShells.Abstractions` for better modularity. Added new `ServiceCollectionFeatureExtensions` to improve options registration. Updated appsettings and references to support these changes. * Introduce ManagementServiceCollectionExtensions to streamline activity and variable registration Added `ManagementServiceCollectionExtensions` for registering Elsa activity types and variable descriptors, providing a modular and shell-feature-compatible approach to configuration. Updated relevant features to utilize these new extension methods, enhancing code modularity and reducing redundancy. * Add resilience strategy registration to HTTP feature Introduced `ResilienceServiceCollectionExtensions` to register resilience strategies within the `Elsa.Resilience.Core` module. Updated `HttpFeature` to incorporate resilience strategies, enhancing HTTP-related resilience configuration leveraging the new extension methods. * Add new configuration options to JavaScriptFeature Implemented multiple properties in `JavaScriptFeature` to enhance JavaScript execution: `AllowClrAccess`, `AllowConfigurationAccess`, `ScriptCacheTimeout`, `DisableWrappers`, and `DisableVariableCopying`. These additions enable more flexible and secure configuration of the Jint JavaScript engine. * refactor(workflows): unify graph caching Resolve workflow definitions first and store graphs under stable per-version-ID cache keys so different lookup paths share entries. Centralize cache creation and change-token registration to remove duplicated caching logic. Skip materializer-unavailable definitions to avoid caching null graphs and simplify flow. * refactor(tests): centralize default IDs and materializer setup Introduce constants for default definition and version IDs, and materializer name. Refactor tests to use these constants, streamline graph and definition resolution, and improve cache key creation by sharing logic across tests. Extend tests to check scenarios with unavailable materializers, ensuring caching only occurs for valid cases. * extend(tests): enhance cache key verification in AutoUpdateTests Added checks for both workflow definition and version cache keys in AutoUpdateTests to ensure comprehensive cache validation, improving test reliability and coverage. * refactor(projects): update CShells project paths and solution configuration Revised project reference paths in `Elsa.ModularServer.Web.csproj` for CShells projects and updated `Elsa.sln` to include new CShells projects, streamlining project organization and build configuration. * Add `IWorkflowReferenceGraphBuilder` to `WorkflowManagementFeature`; rename `ResilienceShellFeature` to `ResilienceFeature`. * Refactor `HttpFeature` to use `IMiddlewareShellFeature`, include `HttpWorkflowsMiddleware`, and update `HttpActivityOptions` defaults. * Add `AddTypeAlias` and `AddVariableTypeAndAlias` extension methods to service collections - Introduced `AddTypeAlias<T>` method in `ServiceCollectionExtensions.cs` for adding type aliases. - Added `AddVariableTypeAndAlias<T>` method in `ManagementServiceCollectionExtensions.cs` to add variable types with aliases. * Remove shell reload API endpoints, orchestrator, and associated tests from the codebase. * Introduce `DefaultAdminUser` options and refactor `AdminUserInitializer` to use `IOptions`. * Add user management endpoints: Delete, List, Update with enhanced user store functionality * Implement `DefaultAdminUser` feature for initial admin bootstrap, decouple `SecurityRoot` from user management endpoints, update related documentation and permissions. * Add role management endpoints: Delete, List, and Update, including role data models and handle obsolete SecurityRoot policy. * Update CShells package references to version 0.0.12-preview.66 and refactor `TenantTaskManager` for improved task lifecycle management. * Replace project references with package references in csproj files and remove unused folders. * Integrate Nuplane features, add sample packages, and update dependency handling within ModularServer Web. * Improve `CShells` startup endpoint registration and resolver handling - Address duplicate endpoint registration by adding state-aware tracking and deduplication - Resolve `WebRoutingShellResolver` constructor ambiguity by switching to factory-based registration - Implement a startup-specific filter to prevent redundant endpoint remapping during `ShellsReloaded` - Update project to use project references for `CShells` and `Nuplane` components in csproj files. * Update logging configuration in appsettings for Development and Production - Change default log level to 'Warning' in Development settings - Adjust Microsoft.Hosting and Elsa.SamplePackage log levels to 'Information' - Remove Microsoft.EntityFrameworkCore log level entry from Production settings * Refactor assembly retrieval methods and update endpoint calls for consistency. * Add `SampleEndpointFeature` and enhance logging and service integration - Implement `SampleEndpointFeature` with a new endpoint for handling requests. - Log endpoint access and integrate `ISampleService` with method `DoSomething`. - Update logging configuration to include `CShells` and `Nuplane` log levels in Development settings. - Update `Elsa.SamplePackage` to version 1.0.1 and manage dependencies with project and assembly references. - Modify JSON configuration for `SampleEndpoint`. * Update package versions for `CShells` to 0.0.13 and `Nuplane` to 0.0.1-preview.15 in props file. * Refactor `DefaultAdminUserFeature` by renaming `ConfigureServices` to `Apply` and adjusting service registration method. * Replace project references with package references across multiple projects and remove obsolete cshells-related solution entries. * Remove `SampleCatalogEndpointExtensions.cs` and related endpoint mappings. * Improve `TenantTaskManager` by using `TryRemove` for state clean-up and clarify `SemaphoreSlim` disposal behavior. * Remove hardcoded default admin credentials and add warning for unconfigured AdminRoleName in admin user setup. * Address unresolved review comments: fix doc comments, security defaults, compilation issue, and restore reload response contracts Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Refine reload endpoints: use specific exceptions, add error messages, rename ReloadedAt to Timestamp, remove unused model Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Add `ExceptionExtensions` with `IsFatal` method and simplify exception handling in `TenantTaskManager`. Remove unused properties from `Directory.Build.props`. * Add unit tests for `TenantTaskManager` and fix potential state orphaning issue. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Fix logger dependency in `SampleEndpointFeature` constructor to use correct type. * Add unit tests for Elsa Shells API endpoints and update solution configuration. * Refactor ShellReload models: remove ShellReloadItemResult, update ShellReloadResponse properties. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-18 12:33:34 +00:00
.WithAdminRoleName("admin")
.WithAdminRolePermissions(new List<string> { "*" }));
})
.UseDefaultAuthentication();
});
```
You can also use the shorthand overload:
```csharp
identity.UseDefaultAdmin("admin", "REPLACE_WITH_SECURE_BOOTSTRAP_PASSWORD", "admin", new List<string> { "*" });
feat: extend shells integration and modular server support (#7399) * refactor(deps): use local CShells project refs Replace CShells NuGet package references with direct project references to the local CShells source to enable developing and testing against local changes and simplify build integration across modules. * Handle assembly load errors in feature discovery Added error handling for assembly load failures in feature discovery to improve resilience. Also updated configuration for identity token options and removed unused service bus consumer dependencies. Simplified project structure by moving and cleaning up `Directory.Build.targets` files. * Refactor configuration and service extension methods. Moved `ShellSettingsExtensions` and `ShellConfiguration` to `CShells.Abstractions` for better modularity. Added new `ServiceCollectionFeatureExtensions` to improve options registration. Updated appsettings and references to support these changes. * Introduce ManagementServiceCollectionExtensions to streamline activity and variable registration Added `ManagementServiceCollectionExtensions` for registering Elsa activity types and variable descriptors, providing a modular and shell-feature-compatible approach to configuration. Updated relevant features to utilize these new extension methods, enhancing code modularity and reducing redundancy. * Add resilience strategy registration to HTTP feature Introduced `ResilienceServiceCollectionExtensions` to register resilience strategies within the `Elsa.Resilience.Core` module. Updated `HttpFeature` to incorporate resilience strategies, enhancing HTTP-related resilience configuration leveraging the new extension methods. * Add new configuration options to JavaScriptFeature Implemented multiple properties in `JavaScriptFeature` to enhance JavaScript execution: `AllowClrAccess`, `AllowConfigurationAccess`, `ScriptCacheTimeout`, `DisableWrappers`, and `DisableVariableCopying`. These additions enable more flexible and secure configuration of the Jint JavaScript engine. * refactor(workflows): unify graph caching Resolve workflow definitions first and store graphs under stable per-version-ID cache keys so different lookup paths share entries. Centralize cache creation and change-token registration to remove duplicated caching logic. Skip materializer-unavailable definitions to avoid caching null graphs and simplify flow. * refactor(tests): centralize default IDs and materializer setup Introduce constants for default definition and version IDs, and materializer name. Refactor tests to use these constants, streamline graph and definition resolution, and improve cache key creation by sharing logic across tests. Extend tests to check scenarios with unavailable materializers, ensuring caching only occurs for valid cases. * extend(tests): enhance cache key verification in AutoUpdateTests Added checks for both workflow definition and version cache keys in AutoUpdateTests to ensure comprehensive cache validation, improving test reliability and coverage. * refactor(projects): update CShells project paths and solution configuration Revised project reference paths in `Elsa.ModularServer.Web.csproj` for CShells projects and updated `Elsa.sln` to include new CShells projects, streamlining project organization and build configuration. * Add `IWorkflowReferenceGraphBuilder` to `WorkflowManagementFeature`; rename `ResilienceShellFeature` to `ResilienceFeature`. * Refactor `HttpFeature` to use `IMiddlewareShellFeature`, include `HttpWorkflowsMiddleware`, and update `HttpActivityOptions` defaults. * Add `AddTypeAlias` and `AddVariableTypeAndAlias` extension methods to service collections - Introduced `AddTypeAlias<T>` method in `ServiceCollectionExtensions.cs` for adding type aliases. - Added `AddVariableTypeAndAlias<T>` method in `ManagementServiceCollectionExtensions.cs` to add variable types with aliases. * Remove shell reload API endpoints, orchestrator, and associated tests from the codebase. * Introduce `DefaultAdminUser` options and refactor `AdminUserInitializer` to use `IOptions`. * Add user management endpoints: Delete, List, Update with enhanced user store functionality * Implement `DefaultAdminUser` feature for initial admin bootstrap, decouple `SecurityRoot` from user management endpoints, update related documentation and permissions. * Add role management endpoints: Delete, List, and Update, including role data models and handle obsolete SecurityRoot policy. * Update CShells package references to version 0.0.12-preview.66 and refactor `TenantTaskManager` for improved task lifecycle management. * Replace project references with package references in csproj files and remove unused folders. * Integrate Nuplane features, add sample packages, and update dependency handling within ModularServer Web. * Improve `CShells` startup endpoint registration and resolver handling - Address duplicate endpoint registration by adding state-aware tracking and deduplication - Resolve `WebRoutingShellResolver` constructor ambiguity by switching to factory-based registration - Implement a startup-specific filter to prevent redundant endpoint remapping during `ShellsReloaded` - Update project to use project references for `CShells` and `Nuplane` components in csproj files. * Update logging configuration in appsettings for Development and Production - Change default log level to 'Warning' in Development settings - Adjust Microsoft.Hosting and Elsa.SamplePackage log levels to 'Information' - Remove Microsoft.EntityFrameworkCore log level entry from Production settings * Refactor assembly retrieval methods and update endpoint calls for consistency. * Add `SampleEndpointFeature` and enhance logging and service integration - Implement `SampleEndpointFeature` with a new endpoint for handling requests. - Log endpoint access and integrate `ISampleService` with method `DoSomething`. - Update logging configuration to include `CShells` and `Nuplane` log levels in Development settings. - Update `Elsa.SamplePackage` to version 1.0.1 and manage dependencies with project and assembly references. - Modify JSON configuration for `SampleEndpoint`. * Update package versions for `CShells` to 0.0.13 and `Nuplane` to 0.0.1-preview.15 in props file. * Refactor `DefaultAdminUserFeature` by renaming `ConfigureServices` to `Apply` and adjusting service registration method. * Replace project references with package references across multiple projects and remove obsolete cshells-related solution entries. * Remove `SampleCatalogEndpointExtensions.cs` and related endpoint mappings. * Improve `TenantTaskManager` by using `TryRemove` for state clean-up and clarify `SemaphoreSlim` disposal behavior. * Remove hardcoded default admin credentials and add warning for unconfigured AdminRoleName in admin user setup. * Address unresolved review comments: fix doc comments, security defaults, compilation issue, and restore reload response contracts Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Refine reload endpoints: use specific exceptions, add error messages, rename ReloadedAt to Timestamp, remove unused model Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Add `ExceptionExtensions` with `IsFatal` method and simplify exception handling in `TenantTaskManager`. Remove unused properties from `Directory.Build.props`. * Add unit tests for `TenantTaskManager` and fix potential state orphaning issue. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Fix logger dependency in `SampleEndpointFeature` constructor to use correct type. * Add unit tests for Elsa Shells API endpoints and update solution configuration. * Refactor ShellReload models: remove ShellReloadItemResult, update ShellReloadResponse properties. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-18 12:33:34 +00:00
```
### Operational notes
- The initializer is idempotent: existing admin role/user are not recreated.
- Do not keep development defaults in production.
feat: extend shells integration and modular server support (#7399) * refactor(deps): use local CShells project refs Replace CShells NuGet package references with direct project references to the local CShells source to enable developing and testing against local changes and simplify build integration across modules. * Handle assembly load errors in feature discovery Added error handling for assembly load failures in feature discovery to improve resilience. Also updated configuration for identity token options and removed unused service bus consumer dependencies. Simplified project structure by moving and cleaning up `Directory.Build.targets` files. * Refactor configuration and service extension methods. Moved `ShellSettingsExtensions` and `ShellConfiguration` to `CShells.Abstractions` for better modularity. Added new `ServiceCollectionFeatureExtensions` to improve options registration. Updated appsettings and references to support these changes. * Introduce ManagementServiceCollectionExtensions to streamline activity and variable registration Added `ManagementServiceCollectionExtensions` for registering Elsa activity types and variable descriptors, providing a modular and shell-feature-compatible approach to configuration. Updated relevant features to utilize these new extension methods, enhancing code modularity and reducing redundancy. * Add resilience strategy registration to HTTP feature Introduced `ResilienceServiceCollectionExtensions` to register resilience strategies within the `Elsa.Resilience.Core` module. Updated `HttpFeature` to incorporate resilience strategies, enhancing HTTP-related resilience configuration leveraging the new extension methods. * Add new configuration options to JavaScriptFeature Implemented multiple properties in `JavaScriptFeature` to enhance JavaScript execution: `AllowClrAccess`, `AllowConfigurationAccess`, `ScriptCacheTimeout`, `DisableWrappers`, and `DisableVariableCopying`. These additions enable more flexible and secure configuration of the Jint JavaScript engine. * refactor(workflows): unify graph caching Resolve workflow definitions first and store graphs under stable per-version-ID cache keys so different lookup paths share entries. Centralize cache creation and change-token registration to remove duplicated caching logic. Skip materializer-unavailable definitions to avoid caching null graphs and simplify flow. * refactor(tests): centralize default IDs and materializer setup Introduce constants for default definition and version IDs, and materializer name. Refactor tests to use these constants, streamline graph and definition resolution, and improve cache key creation by sharing logic across tests. Extend tests to check scenarios with unavailable materializers, ensuring caching only occurs for valid cases. * extend(tests): enhance cache key verification in AutoUpdateTests Added checks for both workflow definition and version cache keys in AutoUpdateTests to ensure comprehensive cache validation, improving test reliability and coverage. * refactor(projects): update CShells project paths and solution configuration Revised project reference paths in `Elsa.ModularServer.Web.csproj` for CShells projects and updated `Elsa.sln` to include new CShells projects, streamlining project organization and build configuration. * Add `IWorkflowReferenceGraphBuilder` to `WorkflowManagementFeature`; rename `ResilienceShellFeature` to `ResilienceFeature`. * Refactor `HttpFeature` to use `IMiddlewareShellFeature`, include `HttpWorkflowsMiddleware`, and update `HttpActivityOptions` defaults. * Add `AddTypeAlias` and `AddVariableTypeAndAlias` extension methods to service collections - Introduced `AddTypeAlias<T>` method in `ServiceCollectionExtensions.cs` for adding type aliases. - Added `AddVariableTypeAndAlias<T>` method in `ManagementServiceCollectionExtensions.cs` to add variable types with aliases. * Remove shell reload API endpoints, orchestrator, and associated tests from the codebase. * Introduce `DefaultAdminUser` options and refactor `AdminUserInitializer` to use `IOptions`. * Add user management endpoints: Delete, List, Update with enhanced user store functionality * Implement `DefaultAdminUser` feature for initial admin bootstrap, decouple `SecurityRoot` from user management endpoints, update related documentation and permissions. * Add role management endpoints: Delete, List, and Update, including role data models and handle obsolete SecurityRoot policy. * Update CShells package references to version 0.0.12-preview.66 and refactor `TenantTaskManager` for improved task lifecycle management. * Replace project references with package references in csproj files and remove unused folders. * Integrate Nuplane features, add sample packages, and update dependency handling within ModularServer Web. * Improve `CShells` startup endpoint registration and resolver handling - Address duplicate endpoint registration by adding state-aware tracking and deduplication - Resolve `WebRoutingShellResolver` constructor ambiguity by switching to factory-based registration - Implement a startup-specific filter to prevent redundant endpoint remapping during `ShellsReloaded` - Update project to use project references for `CShells` and `Nuplane` components in csproj files. * Update logging configuration in appsettings for Development and Production - Change default log level to 'Warning' in Development settings - Adjust Microsoft.Hosting and Elsa.SamplePackage log levels to 'Information' - Remove Microsoft.EntityFrameworkCore log level entry from Production settings * Refactor assembly retrieval methods and update endpoint calls for consistency. * Add `SampleEndpointFeature` and enhance logging and service integration - Implement `SampleEndpointFeature` with a new endpoint for handling requests. - Log endpoint access and integrate `ISampleService` with method `DoSomething`. - Update logging configuration to include `CShells` and `Nuplane` log levels in Development settings. - Update `Elsa.SamplePackage` to version 1.0.1 and manage dependencies with project and assembly references. - Modify JSON configuration for `SampleEndpoint`. * Update package versions for `CShells` to 0.0.13 and `Nuplane` to 0.0.1-preview.15 in props file. * Refactor `DefaultAdminUserFeature` by renaming `ConfigureServices` to `Apply` and adjusting service registration method. * Replace project references with package references across multiple projects and remove obsolete cshells-related solution entries. * Remove `SampleCatalogEndpointExtensions.cs` and related endpoint mappings. * Improve `TenantTaskManager` by using `TryRemove` for state clean-up and clarify `SemaphoreSlim` disposal behavior. * Remove hardcoded default admin credentials and add warning for unconfigured AdminRoleName in admin user setup. * Address unresolved review comments: fix doc comments, security defaults, compilation issue, and restore reload response contracts Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Refine reload endpoints: use specific exceptions, add error messages, rename ReloadedAt to Timestamp, remove unused model Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Add `ExceptionExtensions` with `IsFatal` method and simplify exception handling in `TenantTaskManager`. Remove unused properties from `Directory.Build.props`. * Add unit tests for `TenantTaskManager` and fix potential state orphaning issue. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Fix logger dependency in `SampleEndpointFeature` constructor to use correct type. * Add unit tests for Elsa Shells API endpoints and update solution configuration. * Refactor ShellReload models: remove ShellReloadItemResult, update ShellReloadResponse properties. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-18 12:33:34 +00:00
- Prefer environment variables or a secret manager for admin credentials.
- After first bootstrap, rotate credentials according to your security policy.
- Localhost requests no longer satisfy `SecurityRoot` by default. Legacy localhost bootstrap requires an explicit opt-in: call `EnableLocalHostPermissionGrantForSecurityRoot()` in code-first configuration or set `EnableLocalHostPermissionGrant` on the shell `DefaultAuthentication` feature; prefer `DefaultAdminUser` instead.
feat: extend shells integration and modular server support (#7399) * refactor(deps): use local CShells project refs Replace CShells NuGet package references with direct project references to the local CShells source to enable developing and testing against local changes and simplify build integration across modules. * Handle assembly load errors in feature discovery Added error handling for assembly load failures in feature discovery to improve resilience. Also updated configuration for identity token options and removed unused service bus consumer dependencies. Simplified project structure by moving and cleaning up `Directory.Build.targets` files. * Refactor configuration and service extension methods. Moved `ShellSettingsExtensions` and `ShellConfiguration` to `CShells.Abstractions` for better modularity. Added new `ServiceCollectionFeatureExtensions` to improve options registration. Updated appsettings and references to support these changes. * Introduce ManagementServiceCollectionExtensions to streamline activity and variable registration Added `ManagementServiceCollectionExtensions` for registering Elsa activity types and variable descriptors, providing a modular and shell-feature-compatible approach to configuration. Updated relevant features to utilize these new extension methods, enhancing code modularity and reducing redundancy. * Add resilience strategy registration to HTTP feature Introduced `ResilienceServiceCollectionExtensions` to register resilience strategies within the `Elsa.Resilience.Core` module. Updated `HttpFeature` to incorporate resilience strategies, enhancing HTTP-related resilience configuration leveraging the new extension methods. * Add new configuration options to JavaScriptFeature Implemented multiple properties in `JavaScriptFeature` to enhance JavaScript execution: `AllowClrAccess`, `AllowConfigurationAccess`, `ScriptCacheTimeout`, `DisableWrappers`, and `DisableVariableCopying`. These additions enable more flexible and secure configuration of the Jint JavaScript engine. * refactor(workflows): unify graph caching Resolve workflow definitions first and store graphs under stable per-version-ID cache keys so different lookup paths share entries. Centralize cache creation and change-token registration to remove duplicated caching logic. Skip materializer-unavailable definitions to avoid caching null graphs and simplify flow. * refactor(tests): centralize default IDs and materializer setup Introduce constants for default definition and version IDs, and materializer name. Refactor tests to use these constants, streamline graph and definition resolution, and improve cache key creation by sharing logic across tests. Extend tests to check scenarios with unavailable materializers, ensuring caching only occurs for valid cases. * extend(tests): enhance cache key verification in AutoUpdateTests Added checks for both workflow definition and version cache keys in AutoUpdateTests to ensure comprehensive cache validation, improving test reliability and coverage. * refactor(projects): update CShells project paths and solution configuration Revised project reference paths in `Elsa.ModularServer.Web.csproj` for CShells projects and updated `Elsa.sln` to include new CShells projects, streamlining project organization and build configuration. * Add `IWorkflowReferenceGraphBuilder` to `WorkflowManagementFeature`; rename `ResilienceShellFeature` to `ResilienceFeature`. * Refactor `HttpFeature` to use `IMiddlewareShellFeature`, include `HttpWorkflowsMiddleware`, and update `HttpActivityOptions` defaults. * Add `AddTypeAlias` and `AddVariableTypeAndAlias` extension methods to service collections - Introduced `AddTypeAlias<T>` method in `ServiceCollectionExtensions.cs` for adding type aliases. - Added `AddVariableTypeAndAlias<T>` method in `ManagementServiceCollectionExtensions.cs` to add variable types with aliases. * Remove shell reload API endpoints, orchestrator, and associated tests from the codebase. * Introduce `DefaultAdminUser` options and refactor `AdminUserInitializer` to use `IOptions`. * Add user management endpoints: Delete, List, Update with enhanced user store functionality * Implement `DefaultAdminUser` feature for initial admin bootstrap, decouple `SecurityRoot` from user management endpoints, update related documentation and permissions. * Add role management endpoints: Delete, List, and Update, including role data models and handle obsolete SecurityRoot policy. * Update CShells package references to version 0.0.12-preview.66 and refactor `TenantTaskManager` for improved task lifecycle management. * Replace project references with package references in csproj files and remove unused folders. * Integrate Nuplane features, add sample packages, and update dependency handling within ModularServer Web. * Improve `CShells` startup endpoint registration and resolver handling - Address duplicate endpoint registration by adding state-aware tracking and deduplication - Resolve `WebRoutingShellResolver` constructor ambiguity by switching to factory-based registration - Implement a startup-specific filter to prevent redundant endpoint remapping during `ShellsReloaded` - Update project to use project references for `CShells` and `Nuplane` components in csproj files. * Update logging configuration in appsettings for Development and Production - Change default log level to 'Warning' in Development settings - Adjust Microsoft.Hosting and Elsa.SamplePackage log levels to 'Information' - Remove Microsoft.EntityFrameworkCore log level entry from Production settings * Refactor assembly retrieval methods and update endpoint calls for consistency. * Add `SampleEndpointFeature` and enhance logging and service integration - Implement `SampleEndpointFeature` with a new endpoint for handling requests. - Log endpoint access and integrate `ISampleService` with method `DoSomething`. - Update logging configuration to include `CShells` and `Nuplane` log levels in Development settings. - Update `Elsa.SamplePackage` to version 1.0.1 and manage dependencies with project and assembly references. - Modify JSON configuration for `SampleEndpoint`. * Update package versions for `CShells` to 0.0.13 and `Nuplane` to 0.0.1-preview.15 in props file. * Refactor `DefaultAdminUserFeature` by renaming `ConfigureServices` to `Apply` and adjusting service registration method. * Replace project references with package references across multiple projects and remove obsolete cshells-related solution entries. * Remove `SampleCatalogEndpointExtensions.cs` and related endpoint mappings. * Improve `TenantTaskManager` by using `TryRemove` for state clean-up and clarify `SemaphoreSlim` disposal behavior. * Remove hardcoded default admin credentials and add warning for unconfigured AdminRoleName in admin user setup. * Address unresolved review comments: fix doc comments, security defaults, compilation issue, and restore reload response contracts Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Refine reload endpoints: use specific exceptions, add error messages, rename ReloadedAt to Timestamp, remove unused model Agent-Logs-Url: https://github.com/elsa-workflows/elsa-core/sessions/34eb1e13-833f-4b3c-9db6-2e9221d221b9 Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Add `ExceptionExtensions` with `IsFatal` method and simplify exception handling in `TenantTaskManager`. Remove unused properties from `Directory.Build.props`. * Add unit tests for `TenantTaskManager` and fix potential state orphaning issue. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Fix logger dependency in `SampleEndpointFeature` constructor to use correct type. * Add unit tests for Elsa Shells API endpoints and update solution configuration. * Refactor ShellReload models: remove ShellReloadItemResult, update ShellReloadResponse properties. * Potential fix for pull request finding 'Generic catch clause' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-04-18 12:33:34 +00:00
## Secret Hashing
New identity passwords, client secrets, and API keys are hashed with PBKDF2-SHA256 using 600,000 iterations, a per-record salt, and version metadata. Existing legacy SHA-256 hashes remain valid and are upgraded opportunistically after a successful user login or API-key validation.
2026-07-24 16:59:17 +00:00
## External Authentication Compatibility
External Authentication is additive to Elsa Identity:
- Existing `/identity/login` and `/identity/refresh-token` contracts remain the direct local-credential flow.
- The optional broker exposes separate local and external completion endpoints that return a short-lived, PKCE-bound authorization code before issuing Elsa credentials.
- Externally provisioned users may have no local password hash or salt. Such users fail direct local login with the same public result as any other invalid credential.
- Elsa remains the issuer of access tokens and the authority for their `permissions` claim, regardless of how the user authenticated.
See [the External Authentication migration guide](../../../docs/migrations/external-authentication.md) before changing a Studio host from direct OpenID Connect to brokered mode.