ThreeMammals/Ocelot
45.0
Weak · 12 November 2026
18.4k
lines of production code
C#
primary language
8
measurements over time
What this system is
Features
Introduce new multiplexing middleware and response aggregation system
This change introduces a new \MultiplexingMiddleware\ and associated aggregation infrastructure within the \Ocelot.Multiplexer\ namespace. The middleware handles routing logic for single, multiple, and route-key-based downstream routes, while new interfaces (\IDefinedAggregator\, \IResponseAggregator\) and implementations (\SimpleJsonResponseAggregator\, \UserDefinedResponseAggregator\) enable combining responses from multiple downstream services into a single JSON object or using custom user-defined aggregators.
src/Multiplexer · high confidence
New authorization middleware with scope and claims support
A new AuthorizationMiddleware has been introduced to handle route-level authorization by enforcing both OAuth 2.0 scopes and custom claims. The middleware now validates that user tokens contain at least one allowed scope (supporting RFC 8693 space-separated values) and verifies that user claims match route-specific requirements, including dynamic claim matching against URL path placeholders. This change introduces dedicated authorizers (ScopesAuthorizer and ClaimsAuthorizer) and specific error types (ScopeNotAuthorizedError, ClaimValueNotAuthorizedError, etc.) to provide clear feedback when authorization fails.
src/Authorization · high confidence
New benchmark suite for Ocelot performance analysis
Added a new benchmark project in the \benchmark\ directory to measure Ocelot's performance characteristics. The suite includes benchmarks for the \DownstreamRouteFinderMiddleware\, \ExceptionHandlerMiddleware\, and URL path template matching, as well as end-to-end benchmarks for logging performance (comparing Microsoft.Extensions.Logging and Serilog across various log levels) and payload handling (testing response and request sizes from 1KB to 30MB JSON and 10MB to 1GB binary payloads).
benchmark · high confidence
New header manipulation and infrastructure components
This change introduces new middleware and supporting classes for Ocelot's header handling. The \HttpHeadersTransformationMiddleware\ and \ClaimsToHeadersMiddleware\ now manage request and response headers, including finding/replacing header values, adding new headers (with placeholder support), and converting authentication claims into headers. Supporting infrastructure includes a \CircuitBreaker\ pattern (with count and ratio modes), a \Retry\ pattern, a placeholder resolution system (\IPlaceholders\), and claim parsing utilities.
(repo-wide), src/Headers · high confidence
New manual test application for Ocelot
A new manual test application has been added to the 'manual' directory, providing a self-hosted environment for developers to interact with and verify Ocelot's behavior. This includes a console-based launcher (Program.cs) to run basic Ocelot setups or manual tests, configuration files (ocelot.json, ocelot.identityserver4.json) for routing and authentication scenarios, and specific test assets like a Postman collection and an HTML page for WebSocket debugging (Bug 930). The application is structured to be built and run via Docker, offering a convenient way to test the gateway locally without relying on external acceptance test infrastructure.
manual, src · high confidence
Removals
Removal of initial Ocelot.ApiGateway prototype
The initial prototype implementation for the Ocelot.ApiGateway module has been removed. This includes the deletion of the entry point (Program.cs), startup configuration (Startup.cs), and a basic routing setup that previously returned a static 'Hi, Tom!' response. Additionally, the Dockerfile, project.json, and web.config files defining the .NET Core 1.0 rc2 build and deployment environment for this specific gateway component have been deleted, indicating the abandonment of this early experimental structure.
src/Ocelot.ApiGateway · high confidence
Removed legacy Ocelot.Library project scaffolding
The src/Ocelot.Library project has been removed, including its project.json configuration, .gitignore, and the empty RouterMiddleware.cs class. This cleanup eliminates obsolete .NET Standard 1.5 scaffolding and associated build artifacts from the repository.
src/Ocelot.Library · high confidence
Architecture
Refactored configuration model and builder infrastructure
The configuration system has been restructured to use a dedicated builder pattern and new immutable value objects. New classes such as AuthenticationOptions, CacheOptions, and MetadataOptions replace previous structures, while builders like DownstreamRouteBuilder and ServiceProviderConfigurationBuilder provide a fluent API for assembling route and service settings. Creator classes (e.g., ConfigurationCreator, DynamicRoutesCreator) now orchestrate the construction of these objects from file configurations, and a new change-tracking mechanism (IOcelotConfigurationChangeTokenSource) enables monitoring for configuration updates.
src/Configuration · high confidence
Refactored middleware pipeline into a new modular structure
The middleware layer has been reorganized into a new folder structure, introducing a dedicated \src/Middleware\ directory with new core components. This includes \ConfigurationMiddleware\ for loading internal configuration into the request context, \BaseUrlFinder\ for resolving base URLs from configuration, and \DownstreamResponse\ to properly manage HTTP response disposal. The pipeline assembly is now handled by \OcelotMiddlewareExtensions\ and \OcelotPipelineExtensions\, which define the standard request processing order (authentication, authorization, routing, etc.) and support user customization via \OcelotPipelineConfiguration\. Helper classes like \HttpItemsExtensions\ and \OcelotMiddleware\ provide base functionality for context management and logging.
src/Middleware · high confidence
Behavioural changes
1 commit (0 fixes) modifying (repo-wide), samples
A change to existing behaviour in (repo-wide), samples — 1 commit, 11 files: “\#714 \#792 \#1485 \#1685 Thorough testing for MIME type \multipart/form-data\ as HTTP \Content‑Type\ aka RFC 7578 (\#2421)” (refs \#714, \#792, \#1485, \#1685, \#2421).
samples/MultipartFormData · low confidence · unverified
1 commit (0 fixes) modifying samples/WebSocket
A change to existing behaviour in samples/WebSocket — 1 commit, 8 files: “\#2386 Overridable WebSocket buffer size via virtual property and custom middleware injection (\#2387)” (refs \#2386, \#2387).
samples/WebSocket · medium confidence · unverified
3 commits (0 fixes) modifying samples/Configuration
A change to existing behaviour in samples/Configuration — 3 commits, 12 files: “\#2219 Documentation supporting .NET 8-9 (\#2258)”; “\#651 Merge custom JSON properties across multiple ocelot.X.json configuration files using Newtonsoft's JToken merge functionality (\#1183)”; “\#1912 Use top-level statements for Program in samples and update Getting Started docs (\#2244)” (refs \#2219, \#2258, \#651, \#1183, \#1912, …).
samples/Configuration · medium confidence · unverified
3 commits (0 fixes) modifying samples/Metadata
A change to existing behaviour in samples/Metadata — 3 commits, 15 files: “\#2254 GitHub Actions: Cake release job”; “\#2219 Documentation supporting .NET 8-9 (\#2258)”; “\#585 \#2319 Load Balancer global configuration (\#2324)” (refs \#2254, \#2219, \#2258, \#585, \#2319, …).
samples/Metadata · medium confidence · unverified
3 commits (0 fixes) modifying samples/Web
A change to existing behaviour in samples/Web — 3 commits, 4 files: “\#651 Merge custom JSON properties across multiple ocelot.X.json configuration files using Newtonsoft's JToken merge functionality (\#1183)”; “\#1912 Use top-level statements for Program in samples and update Getting Started docs (\#2244)”; “Follow up \#2179 \#2180 : Enable validation of DI scopes everywhere” (refs \#651, \#1183, \#1912, \#2244, \#2179, …).
samples/Web · medium confidence · unverified
4 commits (0 fixes) modifying samples/OpenTracing, samples/ServiceDiscovery
A change to existing behaviour in samples/OpenTracing, samples/ServiceDiscovery — 4 commits, 26 files: “\#2219 Documentation supporting .NET 8-9 (\#2258)”; “\#2034 More rapid CircleCI builds (Part 1) (\#2045)”; “\#1912 Use top-level statements for Program in samples and update Getting Started docs (\#2244)”; and 1 more (refs \#2219, \#2258, \#2034, \#2045, \#1912, …).
samples/OpenTracing, samples/ServiceDiscovery · medium confidence · unverified
5 commits (0 fixes) modifying samples/Basic, samples/ServiceFabric
A change to existing behaviour in samples/Basic, samples/ServiceFabric — 5 commits, 49 files: “\#2219 Documentation supporting .NET 8-9 (\#2258)”; “\#2034 More rapid CircleCI builds (Part 1) (\#2045)”; “\#1912 Use top-level statements for Program in samples and update Getting Started docs (\#2244)”; and 2 more (refs \#2219, \#2258, \#2034, \#2045, \#1912, …).
samples/Basic, samples/ServiceFabric · medium confidence · unverified
5 commits (0 fixes) modifying samples/Eureka
A change to existing behaviour in samples/Eureka — 5 commits, 11 files: “\#2034 More rapid CircleCI builds (Part 1) (\#2045)”; “Ref SDK 10.0.300 (Runtime 10.0.8) to release Ocelot v25 beta 3 and Ocelot.Testing v25 beta 8+ (\#2389)”; “\#1912 Use top-level statements for Program in samples and update Getting Started docs (\#2244)”; and 2 more (refs \#2034, \#2045, \#2389, \#1912, \#2244, …).
samples/Eureka · medium confidence · unverified
5 commits (0 fixes) modifying samples/GraphQL
A change to existing behaviour in samples/GraphQL — 5 commits, 8 files: “\#2034 More rapid CircleCI builds (Part 1) (\#2045)”; “\#2219 Upgrade Docker, CircleCI and update to \net8.0\, \net9.0\ target frameworks (\#2230)”; “\#1912 Use top-level statements for Program in samples and update Getting Started docs (\#2244)”; and 2 more (refs \#2034, \#2045, \#2219, \#2230, \#1912, …).
samples/GraphQL · medium confidence · unverified
8 commits (0 fixes) modifying samples/Kubernetes
A change to existing behaviour in samples/Kubernetes — 8 commits, 17 files: “\#2219 Documentation supporting .NET 8-9 (\#2258)”; “\#2255 \#2256 Overload \AddKubernetes\ method with \KubeClientOptions\ param for the discovery provider (\#2257)”; “\#2034 More rapid CircleCI builds (Part 1) (\#2045)”; and 5 more (refs \#2219, \#2258, \#2255, \#2256, \#2257, …).
samples/Kubernetes · medium confidence · unverified
Docker build environment upgraded to .NET 9 with new base images
The Docker build infrastructure has been updated to support .NET 9, introducing new base images (Dockerfile.base and Dockerfile.windows) that use the .NET 9 SDK as the primary runtime while retaining .NET 8 for compatibility. The Linux build image now relies on Alpine with .NET 9, and the Windows image uses Nano Server 2022 with .NET 9. Additionally, the repository now includes archived 'outdated' Dockerfiles for previous .NET 6/7/8 configurations to preserve historical build capabilities, and build scripts (build.sh, build-windows.sh) have been updated to tag and push these new .NET 9-specific images.
docker · high confidence
Introduces structured error handling and RFC 9110 compliant timeout responses
This change introduces a new, structured error model in the Ocelot pipeline. A new \Error\ base class and \OcelotErrorCode\ enum replace ad-hoc error handling, allowing errors to carry specific codes, messages, and HTTP status codes. Specifically, downstream request timeouts now return a 504 Gateway Timeout status code to align with RFC 9110, and client-cancelled requests return 499. The \ExceptionHandlerMiddleware\ now catches unhandled exceptions and logs detailed inner-exception chains, while the \ResponderMiddleware\ uses a new \ErrorsToHttpStatusCodeMapper\ to translate these structured errors into appropriate HTTP responses (e.g., 401, 403, 404, 500) before sending them to the client.
src/Errors · high confidence
Migration to .NET Global Tools for build and versioning
The build system has been updated to use .NET global tools instead of previous methods. A new dotnet-tools.json file defines specific versions for Cake (6.3.0), ReportGenerator (5.5.11), and GitVersion (6.8.2). Additionally, a GitVersion configuration file (GitVersion.yml) has been added to set ContinuousDelivery mode, and a Coverlet runsettings file (coverlet.runsettings) has been introduced to configure code coverage collection, specifically excluding the Ocelot.Testing assembly and test assemblies from coverage metrics.
.config · high confidence
New configuration merging and dependency injection builder infrastructure
Ocelot now introduces a new \IOcelotBuilder\ interface and \OcelotBuilder\ implementation to centralize service registration, replacing the previous direct \IServiceCollection\ extension pattern. This change adds a \MergeOcelotJson\ enum that allows users to choose whether to merge multiple \ocelot.\*.json\ configuration files into the primary file or keep them merged in memory. The \ConfigurationBuilderExtensions\ class now handles the discovery and merging of primary, global, and environment-specific configuration files using Newtonsoft's \JToken\ merge functionality, and \ConfigurationExtensions\ provides helper methods to access specific configuration sections like routes and aggregates.
src/DependencyInjection · high confidence
Refactor error handling and response mapping in the Responder middleware
The Responder module has been restructured to improve how HTTP responses and errors are mapped and sent to clients. A new \ErrorsToHttpStatusCodeMapper\ class centralizes the logic for converting internal Ocelot error codes into specific HTTP status codes, notably mapping \RequestTimedOutError\ to 504 Gateway Timeout (per RFC 7231) and \RequestCanceled\ to 499 Client Closed Request. The \ResponderMiddleware\ now uses this mapper and a new \IHttpResponder\ abstraction (\HttpContextResponder\) to handle setting response headers, status codes, and body content on the \HttpContext\. This change separates the concerns of error code resolution from HTTP context manipulation, making the error response behavior more explicit and configurable.
src/Responder · high confidence
Refactored HTTP requester to use a pooled HttpMessageInvoker and granular error mapping
The HTTP requester implementation has been rewritten to use a pooled HttpMessageInvoker (MessageInvokerPool) instead of creating new handlers per request, improving performance and resource management. The new architecture introduces a DelegatingHandlerFactory to manage handler chains (tracing, QoS, custom handlers) and a dedicated HttpExceptionToErrorMapper that maps specific exceptions to precise HTTP status codes, including 504 Gateway Timeout for timeouts, 400 Bad Request for invalid headers, 413 Content Too Large, and 499 for cancelled requests, replacing the previous generic 502/500 responses.
src/Requester · high confidence
Reorganized source code into a new folder structure
The project's source files have been moved into a new directory layout, with middleware and logic now located under dedicated namespaces such as Ocelot.Authentication, Ocelot.Cache, Ocelot.Claims, Ocelot.Headers, and Ocelot.Infrastructure. This structural change reorganizes how components like authentication, caching, claim handling, and header transformation are grouped, but does not alter the external API or runtime behavior.
(repo-wide) · high confidence
Repository modernization with .editorconfig, .gitattributes, and VS 2026 solution files
The repository now includes standardized development tooling to improve consistency and compatibility. A comprehensive .editorconfig file enforces .NET and C\# coding conventions, indentation, and formatting rules across all source files. A .gitattributes file ensures correct line-ending normalization (CRLF for source/config files, LF for scripts) and prevents binary file corruption. Additionally, the project has migrated to the Visual Studio 2026 solution file format (.slnx), introducing Ocelot.slnx and Ocelot.Samples.slnx to replace legacy .sln files, and a .dockerignore file has been added to exclude build artifacts and temporary directories from Docker contexts.
(repo-wide) · high confidence
Restructure Administration module and hide endpoints from API documentation
The Administration module has been reorganized into a new folder structure, introducing dedicated classes for administration paths and configuration management. To improve security and reduce noise in API documentation, the FileConfiguration and OutputCache controllers are now explicitly hidden from Swagger and OpenAPI views via the \[ApiExplorerSettings(IgnoreApi = true)\] attribute, while retaining their authorization requirements. The FileConfigurationController exposes GET and POST endpoints for retrieving and setting file-based configuration, and the OutputCacheController provides a DELETE endpoint to clear cache regions.
src/Administration · high confidence
Test coverage
Acceptance tests migrated to .NET 10 and new folder structure; Added unit tests for administration, authentication, authorization, and caching components; Cleanup of obsolete test project files; New Ocelot.Testing library for acceptance and unit tests.
Dependencies
Upgrade to .NET 8, 9, and 10 target frameworks
The Ocelot project, including its core library, testing utilities, samples, and documentation tooling, has been updated to support .NET 8.0, 9.0, and 10.0. This change aligns the solution with the latest .NET SDK versions and updates associated NuGet packages, such as Microsoft.Extensions.\* and Microsoft.AspNetCore.\*, to versions compatible with these frameworks.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 45 → 45 (-0.0)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.
Lenses
- Code Health 60 → 61 (+0.8)
- Architecture 84 → 72 (-12.2)
- Maturity 65 → 64 (-0.8)
- Readiness 43 → 45 (+2.6)
- Security 37 → 36 (-1.2)
- Performance 54 → 54 (+0.6)
Resolved (36)
- CommentedOutCode (acceptance/Authentication/AuthenticationTests.cs)
- CommentedOutCode (acceptance/Authentication/AuthenticationTests.cs)
- CommentedOutCode (acceptance/Properties/BddfyConfig.cs)
- CommentedOutCode (acceptance/Properties/BddfyConfig.cs)
- CommentedOutCode (acceptance/RateLimiting/ClientHeaderRateLimitingTests.cs)
- CommentedOutCode (acceptance/RateLimiting/ClientHeaderRateLimitingTests.cs)
- CommentedOutCode (acceptance/Request/StreamContentTests.cs)
- Dead code: AndIf (acceptance/IFluentStepBuilderExtensions.cs)
- Dead code: AndIfNot (acceptance/IFluentStepBuilderExtensions.cs)
- Leaked secret: high-entropy-secret (samples/Kubernetes/ApiGateway/ocelot.json)
- Low XML-doc coverage: Ocelot(net8.0) (src/Ocelot.csproj)
- Low XML-doc coverage: Ocelot.ManualTest(net8.0) (manual/Ocelot.ManualTest.csproj)
- Low XML-doc coverage: Ocelot.Samples.Configuration(net8.0) (samples/Configuration/Ocelot.Samples.Configuration.csproj)
- Low XML-doc coverage: Ocelot.Samples.Eureka.DownstreamService(net8.0) (samples/Eureka/DownstreamService/Ocelot.Samples.Eureka.DownstreamService.csproj)
- Low XML-doc coverage: Ocelot.Samples.GraphQL(net8.0) (samples/GraphQL/Ocelot.Samples.GraphQL.csproj)
- Low XML-doc coverage: Ocelot.Samples.Kubernetes.DownstreamService(net8.0) (samples/Kubernetes/DownstreamService/Ocelot.Samples.Kubernetes.DownstreamService.csproj)
- Low XML-doc coverage: Ocelot.Samples.Metadata(net8.0) (samples/Metadata/Ocelot.Samples.Metadata.csproj)
- Low XML-doc coverage: Ocelot.Samples.ServiceDiscovery.ApiGateway(net8.0) (samples/ServiceDiscovery/ApiGateway/Ocelot.Samples.ServiceDiscovery.ApiGateway.csproj)
- Low XML-doc coverage: Ocelot.Samples.ServiceDiscovery.DownstreamService(net8.0) (samples/ServiceDiscovery/DownstreamService/Ocelot.Samples.ServiceDiscovery.DownstreamService.csproj)
- Low XML-doc coverage: Ocelot.Samples.ServiceFabric.ApiGateway(net8.0) (samples/ServiceFabric/ApiGateway/Ocelot.Samples.ServiceFabric.ApiGateway.csproj)
- …and 16 more
New (59)
- Duplicated block (7 lines × 2) (samples/Kubernetes/DownstreamService/Program.cs)
- Edited copy of a member (10 corresponding lines) (src/DependencyInjection/ConfigurationBuilderExtensions.cs)
- Edited copy of a member (11 corresponding lines) (src/Configuration/File/FileSecurityOptions.cs)
- Edited copy of a member (13 corresponding lines) (testing/Steps/WebSocketsSteps.cs)
- Edited copy of a member (17 corresponding lines) (testing/AcceptanceSteps.cs)
- Edited copy of a member (21 corresponding lines) (src/Headers/AddHeadersToRequest.cs)
- Edited copy of a member (22 corresponding lines) (src/Configuration/Repository/DiskFileConfigurationRepository.cs)
- Edited copy of a member (22 corresponding lines) (src/Headers/AddHeadersToRequest.cs)
- Edited copy of a member (22 corresponding lines) (src/Headers/Middleware/ClaimsToHeadersMiddleware.cs)
- Edited copy of a member (24 corresponding lines) (src/Configuration/Creator/AuthenticationOptionsCreator.cs)
- Edited copy of a member (28 corresponding lines) (src/Configuration/Creator/CacheOptionsCreator.cs)
- Edited copy of a member (28 corresponding lines) (src/Configuration/Creator/LoadBalancerOptionsCreator.cs)
- Edited copy of a member (35 corresponding lines) (src/Infrastructure/DesignPatterns/Retry.cs)
- Edited copy of a member (4 corresponding lines) (src/Configuration/Creator/DynamicRoutesCreator.cs)
- Edited copy of a member (4 corresponding lines) (src/Logging/OcelotLogger.cs)
- Edited copy of a member (41 corresponding lines) (src/Configuration/Repository/FileConfigurationPoller.cs)
- Edited copy of a member (6 corresponding lines) (src/LoadBalancer/Balancers/LeastConnection.cs)
- Edited copy of a member (7 corresponding lines) (src/Configuration/File/FileMetadataOptions.cs)
- Edited copy of a member (9 corresponding lines) (testing/Ocelot.cs)
- Fixed-sleep synchronisation: Multiple_Start_Stop_Cycles_Should_work_correctly (unit/Configuration/Repository/FileConfigurationPollerTests.cs)
- …and 39 more
Changes since last survey
- 3 commits — 3 feature/other, 0 fixes
By area
- acceptance/Configuration — 1 commit
- samples/MultipartFormData — 1 commit
- unit/Multiplexer — 1 commit
Notable commits
- change: #1741 Support exotic HTTP methods in aggregation by avoiding the UpstreamHttpMethod GET-constraint for aggregate routes (#1389)
- change: #714 #792 #1485 #1685 Thorough testing for MIME type multipart/form-data as HTTP Content‑Type aka RFC 7578 (#2421)
- change: Remove TestStack.BDDfy from acceptance tests (#2433)
API surface
- Unchanged — 15 HTTP endpoints
Architecture
- Unchanged — 3 containers · 0 contexts · 0 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
ThreeMammals/Ocelot was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 12 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 8ce4fb6712dbf3c5c4194694da5e9995a439b939 — the exact code this score is about.
- Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.42+preprod-6bc2a431cb25.