Skip to content

Commit 4a449a6

Browse files
Refresh codebase wiki
1 parent 5871907 commit 4a449a6

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

doc/wiki/http-scheduling-resilience.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ Core contracts:
139139

140140
Use resilience when an activity performs IO that can fail transiently. Keep strategy types registered by the owning module.
141141

142+
## Simulate-Response Endpoint Security
143+
144+
[SimulateResponseEndpoint](../../src/modules/Elsa.Resilience/Endpoints/SimulateResponse/Endpoint.cs) is a testing utility that cycles through a configured list of HTTP status codes. It requires one of the following permissions: `exec:*`, `exec:resilience`, or `exec:resilience:simulate-response`.
145+
146+
Session isolation is enforced per authenticated identity: the session ID stored in `SimulateResponseSessionStore` is a SHA-256 hash of the caller's identity key concatenated with the caller-supplied `sessionId` query parameter. This prevents one authenticated user from advancing another user's session counter. The `sessionId` and `codes` query parameters are validated and length-capped by `SimulateResponseOptions`.
147+
142148
## Cross-Cutting Graceful Shutdown
143149

144150
HTTP and Scheduling both register runtime ingress sources so graceful shutdown can pause new external work. When adding a new external event source, implement and register an `IIngressSource` in the owning module, then add runtime tests that prove pause/resume/drain behavior.

doc/wiki/identity-tenancy-security.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ Structured logs define diagnostics permissions in [StructuredLogsPermissions](..
106106

107107
Identity endpoints and user-management endpoints are permission-based; see [ADR 0010](../adr/0010-default-admin-user-bootstrap-for-initial-identity-access.md).
108108

109+
## SignalR Hub Authorization
110+
111+
[WorkflowInstanceHub](../../src/modules/Elsa.Workflows.Api/RealTime/Hubs/WorkflowInstanceHub.cs) requires authenticated callers (`[Authorize]` attribute). Before joining an instance observation group, `ObserveInstanceAsync` enforces two checks:
112+
113+
1. **Permission check** — the caller must hold one of `exec:*`, `read:*`, or `read:workflow-instances`.
114+
2. **Tenant check** — the requested workflow instance must belong to the caller's current tenant, or be tenant-agnostic.
115+
116+
Any violation throws a `HubException("Access denied.")` and prevents group membership. The tenant check uses `ITenantAccessor` and is skipped when tenancy is not configured.
117+
109118
## Ingress Rate Limiting
110119

111120
Elsa exposes opt-in ASP.NET Core rate limiting hooks for two ingress surfaces:
@@ -125,3 +134,4 @@ The reference server registers disabled-by-default fixed-window policies under `
125134
- Are bootstrap credentials only for development or secret-managed environments?
126135
- Does any diagnostic/logging feature expose sensitive data without redaction?
127136
- Do token settings use production-grade signing keys and data protection configuration?
137+
- Do SignalR hub methods check both authentication and permission before joining groups?

doc/wiki/persistence.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ When adding a new store implementation:
120120
5. Add unit tests for store-specific query behavior if logic is nontrivial.
121121
6. Add integration tests for provider behavior, migrations, and multi-target concerns where practical.
122122

123+
## Workflow JSON Type Resolution
124+
125+
Workflow JSON uses short type aliases rather than assembly-qualified names. [WorkflowJsonTypeResolver](../../src/modules/Elsa.Workflows.Core/Serialization/Helpers/WorkflowJsonTypeResolver.cs) resolves these aliases through `IWellKnownTypeRegistry` to prevent arbitrary CLR type instantiation during deserialization.
126+
127+
Resolution order:
128+
1. Registered short alias (e.g. `"String"`, `"Int32"`, `"MyActivity"`).
129+
2. Compound array alias (`TypeAlias[]`).
130+
3. Compound generic-collection alias (`List<TypeAlias>`, `IEnumerable<TypeAlias>`, etc.).
131+
4. Legacy assembly-qualified name, restricted to types already registered in `IWellKnownTypeRegistry`.
132+
133+
If none of these match, deserialization throws a `JsonException`. Unrecognized type strings are never passed to `Type.GetType` unconstrained. Modules that introduce new serializable activity or variable types must register their types with `IWellKnownTypeRegistry` at startup; see [WorkflowRuntimeTypeAliasRegistrar](../../src/modules/Elsa.Workflows.Runtime/WorkflowRuntimeTypeAliasRegistrar.cs) for a reference implementation.
134+
123135
## Persistence Risk Checklist
124136

125137
- Does the change affect multiple target frameworks?

0 commit comments

Comments
 (0)