Repository navigation
2.0.1-alpha - Develop - #21
Merged
Merged
Conversation
…ils on anything missing - every file named by the spec is resolved before the archive is written; a missing file, a missing or empty plugin output stops the build and leaves no archive behind - build output only counts for the requested configuration and target framework, obj never; a stale bin/Debug or a net8.0 build no longer ends up in a Release net10.0 package - the lookup stays inside the spec folder and matches whole path segments (icon.png no longer hits favicon.png); plugin paths leading outside of it are refused - licenses copied to the build output are not packed twice - WebEx reports a failed package on the console and returns 1 instead of crashing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Version is the single version; AssemblyVersion, FileVersion and PackageVersion are derived from it - the component detection scans a copy of the restore graph instead of obj, whose stale nuspecs made the package depend on itself in every version ever packed - Microsoft.Sbom.Targets is a PackageDownload and its download entry is left out of the copy, so the build tool is no dependency of the package Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plugin that contributes to an application of another plugin registers its pages, REST endpoints, assets, fragments, jobs, sockets and the other components for the applications it names, instead of only the applications of its own assembly. The plugin context carries the assembly it was loaded from, so the binding is read from the right attributes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it on every request AuthenticationSettings.ApplicationGroups lists applications that accept each other's tokens. A renewed token keeps the audience of the application the sign-in was issued for, so renewing in a member of two overlapping groups does not widen the trust of the sign-in. IIdentityValidator is asked on every request for the identity a token carries; a refusal or an exception makes the request anonymous and stops the renewal. Plugins' validators are discovered for the applications they serve. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IUriPathSegmentTrail lets a path segment stand for a chain of crumbs, such as the ancestors of a node in a hierarchy, which a breadcrumb renders one by one. UriData carries a data URL as a URI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pages, rest apis, resources, sockets and setting pages of a plugin that does not own the application were mounted under the lower-cased plugin name - often an i18n key, so the route carried a colon - while its assets sat under the plugin id. All of them now share EndpointManager.CreatePluginRoute. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bound segment stays a variable, so binding the current request onto a link to another record turned it into a link to the current record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PluginTypeCatalog<TItem> collects the types plugins contribute to an extension point, follows plugins arriving and leaving, keeps every offer per key in arrival order and can bind items per application. The HealthManager now discovers its checks through it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…kie handling - asset and socket items are resolved through an index by context instead of a scan over all items - removing a plugin's or application's sockets materializes the list first, so they are disposed - the log takes the caller class from the source file instead of a stack walk and writes the console through a background queue; closing the log flushes it - cookies are parsed once per request, and a cookie the cookie type rejects no longer fails it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nges - the console drain is hooked into process exit and unhandled exceptions before the first entry is queued; exceptions and fatal errors wait until they are on the console - a stopped or stuck console writer no longer blocks logging threads; the entry is written directly - a failing console write loses only its block, not the rest of the batch, and is reported - default-colored blocks reset the console color again - flushing the console shares one timeout instead of waiting twice - the origin column strips type parameters from generic file names - the socket index is thread-safe, since connections read it without a lock - the asset fallback lookup matches the application as well, so a removed application's asset is not served by another one; a replaced asset is disposed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An exception or fatal error waited until each of its lines was on the console. Every wait is a round trip through the writer the whole process shares, so a slow console held the caller - a request or a shutdown drain - for seconds and let Lifetime_FailureDoesNotSkipDrain time out. No level waits any more; closing the log, a regular exit and a crash drain the queue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e title Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical issues permit cross-application token replay and fail-open authentication, compromise plugin lifecycle consistency and cleanup, and can block request threads indefinitely.
8 open issues
Grouped apps do not share token replay and revocation state · New Validator activation failure can leave authentication unguarded · New Queue failure can block requests on synchronous console writes · New Trailing plugin path separator breaks packed DLL resolution · New Withdrawn owners can have discoveries committed afterward · New Reentrant catalog changes can publish stale notifications · New Throwing catalog subscribers prevent notifications and cleanup · New URI transformations and copies discard opaque data payloads · New
What changed in this PR
This PR prepares WebExpress.WebCore 2.0.1-alpha with reusable plugin discovery, broader application integration, and improvements to authentication, request handling, logging, and packaging.
Changes:
- Adds a plugin type catalog, adopts it for health checks, and centralizes application bindings and plugin route prefixes.
- Adds grouped authentication and request-time identity validators, preserves public request ports, and extends URI support.
- Updates logging, package validation, release metadata, regression tests, and developer documentation.
| File | Description |
|---|---|
src/WebExpress.WebCore/WebUri/UriTrailCrumb.cs |
Adds breadcrumb entries with optional menus. |
src/WebExpress.WebCore/WebUri/UriEndpoint.cs |
Preserves already-bound path variables. |
src/WebExpress.WebCore/WebUri/UriData.cs |
Adds an opaque data-URL representation. |
src/WebExpress.WebCore/WebUri/IUriPathSegmentTrail.cs |
Defines multi-step breadcrumb contributions. |
src/WebExpress.WebCore/WebTheme/ThemeManager.cs |
Uses shared application-binding lookup. |
src/WebExpress.WebCore/WebStatusPage/StatusPageManager.cs |
Uses shared application-binding lookup. |
src/WebExpress.WebCore/WebSocket/SocketManager.cs |
Centralizes bindings and plugin route prefixes. |
src/WebExpress.WebCore/WebSocket/Model/SocketDictionary.cs |
Indexes contexts and materializes removals. |
src/WebExpress.WebCore/WebSettingPage/SettingPageManager.cs |
Centralizes bindings and plugin route prefixes. |
src/WebExpress.WebCore/WebSetting/SettingsLog.cs |
Masks credentials in configuration diagnostics. |
src/WebExpress.WebCore/WebSetting/AuthenticationSettings.cs |
Adds authentication application groups. |
src/WebExpress.WebCore/WebRestApi/RestApiManager.cs |
Centralizes bindings and plugin route prefixes. |
src/WebExpress.WebCore/WebResource/ResourceManager.cs |
Centralizes bindings and plugin route prefixes. |
src/WebExpress.WebCore/WebPlugin/PluginTypeOrigin.cs |
Supplies discovery context to catalog factories. |
src/WebExpress.WebCore/WebPlugin/PluginTypeCatalogEventArgs.cs |
Defines catalog change notifications. |
src/WebExpress.WebCore/WebPlugin/PluginTypeCatalog.cs |
Adds discovery, ownership, fallback, and lifecycle management. |
src/WebExpress.WebCore/WebPlugin/PluginTypeBinding.cs |
Defines plugin and application catalog scopes. |
src/WebExpress.WebCore/WebPlugin/PluginManager.cs |
Retains the supplied discovery assembly. |
src/WebExpress.WebCore/WebPlugin/PluginBinding.cs |
Combines owned and associated applications. |
src/WebExpress.WebCore/WebPage/PageManager.cs |
Centralizes bindings and plugin route prefixes. |
src/WebExpress.WebCore/WebPackage/PackageBuilder.cs |
Validates inputs and selects matching build outputs. |
src/WebExpress.WebCore/WebMessage/RequestOriginGuard.cs |
Clarifies origin derivation in comments only. |
src/WebExpress.WebCore/WebMessage/RequestHeaderFields.cs |
Parses cookies once and skips malformed entries. |
src/WebExpress.WebCore/WebMessage/RequestBase.cs |
Uses the public Host port for request URIs. |
src/WebExpress.WebCore/WebMessage/HttpContext.cs |
Uses the public Host port for context URIs. |
src/WebExpress.WebCore/WebLog/Log.cs |
Queues console output and preserves exception details. |
src/WebExpress.WebCore/WebJob/JobManager.cs |
Uses shared application-binding lookup. |
src/WebExpress.WebCore/WebInclude/IncludeManager.cs |
Uses shared application-binding lookup. |
src/WebExpress.WebCore/WebIdentity/IIdentityValidator.cs |
Defines request-time identity validation. |
src/WebExpress.WebCore/WebIdentity/IIdentityManager.cs |
Exposes validator registration and removal. |
src/WebExpress.WebCore/WebIdentity/IdentityValidationContext.cs |
Supplies identity, grant, and request details. |
src/WebExpress.WebCore/WebIdentity/IdentityTokenStoreManager.cs |
Discovers stores for associated applications. |
src/WebExpress.WebCore/WebIdentity/IdentityProviderManager.cs |
Discovers providers for associated applications. |
src/WebExpress.WebCore/WebIdentity/IdentityManager.Validation.cs |
Discovers and invokes application validators. |
src/WebExpress.WebCore/WebIdentity/IdentityManager.Token.cs |
Accepts grouped audiences and preserves renewal audiences. |
src/WebExpress.WebCore/WebIdentity/IdentityManager.cs |
Connects validators to registration and removal. |
src/WebExpress.WebCore/WebIdentity/IdentityManager.Authentication.cs |
Confirms authenticated and refreshed identities. |
src/WebExpress.WebCore/WebHealth/HealthManager.cs |
Moves health discovery into the catalog. |
src/WebExpress.WebCore/WebFragment/FragmentManager.cs |
Honors supplied application bindings. |
src/WebExpress.WebCore/WebExpress.WebCore.csproj |
Updates release metadata and software-bill-of-materials generation. |
src/WebExpress.WebCore/WebEx.cs |
Reports packaging failures and configuration diagnostics. |
src/WebExpress.WebCore/WebEvent/EventManager.cs |
Uses shared application-binding lookup. |
src/WebExpress.WebCore/WebEndpoint/EndpointManager.cs |
Centralizes plugin-ID route prefixes. |
src/WebExpress.WebCore/WebAsset/Model/AssetItemDictionary.cs |
Indexes contexts and scopes fallback lookup by application. |
src/WebExpress.WebCore/WebAsset/AssetManager.cs |
Shares binding and route-prefix helpers. |
src/WebExpress.WebCore/Internationalization/en |
Adds English catalog diagnostics. |
src/WebExpress.WebCore/Internationalization/de |
Adds German catalog diagnostics. |
src/WebExpress.WebCore.Test/WebUri/UnitTestUri.cs |
Tests preservation of bound variables. |
src/WebExpress.WebCore.Test/WebSetting/UnitTestSettingsLog.cs |
Tests redaction and diagnostic formatting. |
src/WebExpress.WebCore.Test/WebLog/UnitTestLog.cs |
Tests exception details, origins, and console queuing. |
src/WebExpress.WebCore.Test/TestIdentityValidator.cs |
Adds a discoverable validator fixture. |
src/WebExpress.WebCore.Test/Message/UnitTestRequest.cs |
Tests public-port URI handling. |
src/WebExpress.WebCore.Test/Message/UnitTestGetRequest.cs |
Updates expected request ports. |
src/WebExpress.WebCore.Test/Manager/UnitTestSocketManager.cs |
Tests socket removal notifications. |
src/WebExpress.WebCore.Test/Manager/UnitTestPluginTypeCatalog.cs |
Tests catalog discovery, ownership, and lifecycle behavior. |
src/WebExpress.WebCore.Test/Manager/UnitTestPackageBuilder.cs |
Tests output selection and missing-input failures. |
src/WebExpress.WebCore.Test/Manager/UnitTestIdentityValidation.cs |
Tests grouped tokens and identity validators. |
src/WebExpress.WebCore.Test/Manager/UnitTestForeignApplicationBinding.cs |
Tests contributions to another plugin’s application. |
src/WebExpress.WebCore.Test/Manager/UnitTestAssetManager.cs |
Tests asset lookup after owner removal. |
src/WebExpress.WebCore.Test/Fixture/UnitTestFixture.cs |
Sets an explicit mock request scheme. |
src/WebExpress.WebCore.Test/Fixture/AuthenticationFixture.cs |
Supports configurable authentication groups. |
docs/user-guide.md |
Introduces the plugin catalog guide. |
docs/tutorials.md |
Links to the plugin contribution example. |
docs/toc.yml |
Adds catalog documentation navigation. |
docs/template/public/main.css |
Sets documentation logo sizing and spacing. |
docs/plugin-type-catalog.md |
Documents catalog contracts and usage. |
docs/assets/webexpress.svg |
Replaces the documentation logo artwork. |
Review effort: Balanced
Comment on lines
+410
to
+414
| : authority.Groups | ||
| .Where(x => x.Contains(own, StringComparer.OrdinalIgnoreCase)) | ||
| .SelectMany(x => x) | ||
| .Append(own) | ||
| .Distinct(StringComparer.OrdinalIgnoreCase); |
Comment on lines
+92
to
+93
| var validator = (IIdentityValidator)constructor.Invoke(constructor.GetParameters() | ||
| .Select(p => dependencies.First(p.ParameterType.IsInstanceOfType)).ToArray()); |
Comment on lines
+320
to
+325
| if (!Enqueue(line)) | ||
| { | ||
| // the writer is gone or stuck; writing directly keeps the entry and, above all, | ||
| // keeps the caller from waiting on a queue nobody drains any more | ||
| WriteBlock(color, line.Text + Environment.NewLine); | ||
| } |
| Readme = "readme.md", | ||
| Description = package?.Description, | ||
| Tags = package?.Tags, | ||
| Plugins = package?.Plugins?.Select(x => $"{zipBinarys}/{SanitizeFileNameComponent(Path.GetFileName(x))}").ToArray(), |
Comment on lines
+535
to
+538
| if (!_disposed && !_offers.Any(x => x.IsOfferOf(pluginContext, applicationContext, assembly))) | ||
| { | ||
| _offers.Add(offer); | ||
| changes = Resolve(offer.Items.Keys.Select(x => new Slot(applicationContext, x))); |
Comment on lines
+698
to
+700
| if (change.After is { } after) | ||
| { | ||
| Added?.Invoke(this, new PluginTypeCatalogEventArgs<TItem>(change.Slot.Key, after.Items[change.Slot.Key], after.PluginContext, after.ApplicationContext)); |
Comment on lines
+689
to
+703
| private void Raise(IEnumerable<Change> changes) | ||
| { | ||
| foreach (var change in changes) | ||
| { | ||
| if (change.Before is { } before) | ||
| { | ||
| Removed?.Invoke(this, new PluginTypeCatalogEventArgs<TItem>(change.Slot.Key, before.Items[change.Slot.Key], before.PluginContext, before.ApplicationContext)); | ||
| } | ||
|
|
||
| if (change.After is { } after) | ||
| { | ||
| Added?.Invoke(this, new PluginTypeCatalogEventArgs<TItem>(change.Slot.Key, after.Items[change.Slot.Key], after.PluginContext, after.ApplicationContext)); | ||
| } | ||
| } | ||
| } |
| /// as written: parsed as an endpoint it would lose everything but its scheme, and a picture | ||
| /// sent inline would be served as an empty address. | ||
| /// </summary> | ||
| public class UriData : UriEndpoint |
…consistent - a sign-in credential keeps its replay and revocation markers in the store of the application it was issued for, so every member of a group consults the same place - a validator that cannot be constructed makes its application refuse every identity instead of leaving it unguarded; discovery of the rest of the plugin continues - a console queue timeout drops the console copy instead of waiting on the stalled console - the package spec names a plugin like its packed folder, also for a trailing separator - the plugin type catalog vetoes discoveries whose owner was withdrawn meanwhile, raises its events in the order of the changes through one dispatcher, and isolates throwing subscribers so later notices and disposals still run - a data url keeps its content when its fragment changes and refuses path, query and copy operations that would turn it into an empty endpoint Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This pull request introduces comprehensive documentation for the
PluginTypeCatalog<TItem>extension point mechanism, improves test coverage for asset removal scenarios, and enhances test fixtures for authentication and HTTP context mocking. It also updates the documentation navigation and styling to support the new content.Documentation and User Guide Improvements:
docs/plugin-type-catalog.mdfile describing the purpose, usage, conventions, and examples forPluginTypeCatalog<TItem>, including when to use it, ownership rules, application binding, and integration with other managers.docs/user-guide.md), tutorials (docs/tutorials.md), and table of contents (docs/toc.yml) to reference the new plugin type catalog documentation and provide a practical example for plugin-based extension points. [1] [2] [3]Test Coverage Enhancements:
UnitTestAssetManagerto verify that assets are not served after their plugin or application has been removed, ensuring correct cleanup and isolation in asset management.Test Fixture Improvements:
AuthenticationFixtureto allow configuration of application groups for tests, making group assignment more flexible and testable. [1] [2]UnitTestFixture.CreateHttpContextMockto always set the HTTP scheme, improving the reliability of HTTP context mocks in tests.Styling and UI: