Skip to content

Commit 355cc33

Browse files
authored
#2219 Documentation supporting .NET 8-9 (#2258)
* #2217 Answer to How can I configure Ocelot programmatically? * Update README.md * Review license and readme. Check new signing GPG key * Docs config & Update Introduction docs * Disable BddfyConfig * Update README.md Keep images in the assets branch and read them from raw.githubusercontent.com * Delete images directory All images should be located in the ASSETS branch * Update workflows * Disable icon embedding * Update features A-C * Update Configuration feature doc: Add schemas Add Overview section Organize sections * Configuration feature doc * remove namespace * Delegating Handlers feature * Dependency Injection feature * Features E-K * Load Balancer feature * Logging feature vs Error Handling one * Add Metadata sample * Metadata sample: JSON responder. Serialize route metadata JSON to HTTP response body * Metadata sample: Rename to MetadataResponder * Metadata sample: Test gzip & deflate encodings. Add OC-Route-Metadata header * Metadata sample: DONE * Update metadata.rst * Metadata feature (complete doc) * Method Transformation feature * Review Kubernetes doc after rebasing * Middleware Injection feature * Quality of Service feature * Rate Limiting feature * Update requestaggregation.rst: Rename to aggregation.rst * Aggregation feature * Request ID feature * Merge Request ID doc into Logging one * Routing feature * Service Discovery feature * Service Fabric feature * Tracing doc looks good! * Websockets doc looks good too! * Update Building Ocelot docs. Move content of building.rst and tests.rst to overview.rst. Remove [building.rst, tests.rst] from index
1 parent a8ba984 commit 355cc33

File tree

123 files changed

+4654
-3159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+4654
-3159
lines changed

.github/workflows/develop.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# This workflow will build a .NET project
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3-
4-
name: develop
5-
3+
name: Develop
64
on:
75
push:
86
branches: [ "develop" ]
@@ -15,19 +13,20 @@ jobs:
1513
dotnet-version: [ '8.0', '9.0' ]
1614

1715
steps:
18-
- uses: actions/checkout@v4
16+
- name: Checkout
17+
uses: actions/checkout@v4
1918
- name: Setup .NET ${{ matrix.dotnet-version }}
2019
uses: actions/setup-dotnet@v3
2120
with:
2221
dotnet-version: ${{ matrix.dotnet-version }}.x
23-
# - name: Display dotnet version
24-
# run: dotnet --version
22+
#- name: Display dotnet version
23+
# run: dotnet --version
2524
- name: Restore
2625
run: dotnet restore ./Ocelot.sln -p:TargetFramework=net${{ matrix.dotnet-version }}
2726
- name: Build
2827
run: dotnet build --no-restore ./Ocelot.sln --framework net${{ matrix.dotnet-version }}
29-
# - name: Test
30-
# run: dotnet test --no-build --verbosity normal ./Ocelot.sln --framework net${{ matrix.dotnet-version }}
28+
#- name: Test
29+
# run: dotnet test --no-build --verbosity normal ./Ocelot.sln --framework net${{ matrix.dotnet-version }}
3130
- name: Unit Tests
3231
run: dotnet test --no-restore --no-build --verbosity minimal --framework net${{ matrix.dotnet-version }} ./test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
3332
- name: Integration Tests

.github/workflows/pr.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
# This workflow will build a .NET project
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3-
43
name: PR
5-
64
on: pull_request
7-
# branches-ignore:
8-
# - main
9-
# - develop
105

116
jobs:
127
build:
138
runs-on: ubuntu-latest
149
steps:
15-
- uses: actions/checkout@v4
16-
- name: Setup .NET 9.0
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Setup .NET 9
1713
uses: actions/setup-dotnet@v3
1814
with:
1915
dotnet-version: 9.0.x

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The MIT License (MIT)
2-
Copyright (c) 2024 Tom Pallister, Raman Maksimchuk and GitHub Ocelot community.
2+
Copyright © 2016-2025 Tom Gardham-Pallister, Raman Maksimchuk and contributors.
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
55

Ocelot.Release.sln

+11
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ocelot.Samples.ServiceFabri
8282
EndProject
8383
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ocelot.Samples.Web", "samples\Web\Ocelot.Samples.Web.csproj", "{1A00E87D-2B0B-4D61-A606-3D747C1E43F8}"
8484
EndProject
85+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ocelot.Samples.Metadata", "samples\Metadata\Ocelot.Samples.Metadata.csproj", "{8A48F777-89D7-B17F-F352-CF57E49E5EF5}"
86+
EndProject
8587
Global
8688
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8789
Debug|Any CPU = Debug|Any CPU
@@ -322,6 +324,14 @@ Global
322324
{1A00E87D-2B0B-4D61-A606-3D747C1E43F8}.Release|Any CPU.Build.0 = Release|Any CPU
323325
{1A00E87D-2B0B-4D61-A606-3D747C1E43F8}.Release|x64.ActiveCfg = Release|Any CPU
324326
{1A00E87D-2B0B-4D61-A606-3D747C1E43F8}.Release|x64.Build.0 = Release|Any CPU
327+
{8A48F777-89D7-B17F-F352-CF57E49E5EF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
328+
{8A48F777-89D7-B17F-F352-CF57E49E5EF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
329+
{8A48F777-89D7-B17F-F352-CF57E49E5EF5}.Debug|x64.ActiveCfg = Debug|Any CPU
330+
{8A48F777-89D7-B17F-F352-CF57E49E5EF5}.Debug|x64.Build.0 = Debug|Any CPU
331+
{8A48F777-89D7-B17F-F352-CF57E49E5EF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
332+
{8A48F777-89D7-B17F-F352-CF57E49E5EF5}.Release|Any CPU.Build.0 = Release|Any CPU
333+
{8A48F777-89D7-B17F-F352-CF57E49E5EF5}.Release|x64.ActiveCfg = Release|Any CPU
334+
{8A48F777-89D7-B17F-F352-CF57E49E5EF5}.Release|x64.Build.0 = Release|Any CPU
325335
EndGlobalSection
326336
GlobalSection(SolutionProperties) = preSolution
327337
HideSolutionNode = FALSE
@@ -356,6 +366,7 @@ Global
356366
{D991C694-01F0-4F04-8135-5C133DC8E029} = {8FA0CBA0-0338-48EB-B37F-83CA5022237C}
357367
{AD09D124-7DD7-4C9E-9BCC-782B579B1786} = {8FA0CBA0-0338-48EB-B37F-83CA5022237C}
358368
{1A00E87D-2B0B-4D61-A606-3D747C1E43F8} = {8FA0CBA0-0338-48EB-B37F-83CA5022237C}
369+
{8A48F777-89D7-B17F-F352-CF57E49E5EF5} = {8FA0CBA0-0338-48EB-B37F-83CA5022237C}
359370
EndGlobalSection
360371
GlobalSection(ExtensibilityGlobals) = postSolution
361372
SolutionGuid = {21476EFF-778A-4F97-8A56-D1AF1CEC0C48}

README.md

+37-37
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
![Ocelot Logo](/images/ocelot_logo.png)
1+
![Ocelot Logo](https://raw.githubusercontent.com/ThreeMammals/Ocelot/refs/heads/assets/images/ocelot_logo.png)
22

3-
[![.NET](https://github.com/ThreeMammals/Ocelot/actions/workflows/develop.yml/badge.svg)](https://github.com/ThreeMammals/Ocelot/actions/workflows/develop.yml)
4-
5-
<!-- [![Coverage Status](https://coveralls.io/repos/github/ThreeMammals/Ocelot/badge.svg)](https://coveralls.io/github/ThreeMammals/Ocelot) -->
3+
[![develop](https://github.com/ThreeMammals/Ocelot/actions/workflows/develop.yml/badge.svg)](https://github.com/ThreeMammals/Ocelot/actions/workflows/develop.yml)
4+
[![ReadTheDocs](https://readthedocs.org/projects/ocelot/badge/?version=latest&style=flat-default)](https://app.readthedocs.org/projects/ocelot/builds/?version__slug=latest)
5+
[![Coveralls](https://coveralls.io/repos/github/ThreeMammals/Ocelot/badge.svg)](https://coveralls.io/github/ThreeMammals/Ocelot)
66

77
## About
8+
Ocelot is a .NET [API gateway](https://www.bing.com/search?q=API+gateway).
9+
This project is aimed at people using .NET running a microservices (service-oriented) architecture that needs a unified point of entry into their system.
10+
However, it will work with anything that speaks HTTP(S) and runs on any platform that [ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/) supports.
811

9-
Ocelot is a .NET API Gateway. This project is aimed at people using .NET running a microservices / service-oriented architecture
10-
that need a unified point of entry into their system. However it will work with anything that speaks HTTP(S) and run on any platform that ASP.NET Core supports.
11-
12+
<!--
1213
In particular we want easy integration with [IdentityServer](https://github.com/IdentityServer) reference and [Bearer](https://oauth.net/2/bearer-tokens/) tokens.
1314
We have been unable to find this in our current workplace without having to write our own Javascript middlewares to handle the IdentityServer reference tokens.
1415
We would rather use the IdentityServer code that already exists to do this.
16+
-->
1517

16-
Ocelot is a bunch of middlewares in a specific order.
18+
Ocelot consists of a series of ASP.NET Core [middlewares](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/) arranged in a specific order.
1719

18-
Ocelot manipulates the `HttpRequest` object into a state specified by its configuration until it reaches a request builder middleware, where it creates a `HttpRequestMessage` object which is used to make a request to a downstream service.
20+
Ocelot [custom middlewares](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/write) manipulate the `HttpRequest` object into a state specified by its configuration until it reaches a request builder middleware, where it creates a `HttpRequestMessage` object, which is used to make a request to a downstream service.
1921
The middleware that makes the request is the last thing in the Ocelot pipeline. It does not call the next middleware.
20-
The response from the downstream service is retrieved as the requests goes back up the Ocelot pipeline.
21-
There is a piece of middleware that maps the `HttpResponseMessage` onto the `HttpResponse` object and that is returned to the client.
22-
That is basically it with a bunch of other features!
22+
The response from the downstream service is retrieved as the request goes back up the Ocelot pipeline.
23+
There is a piece of middleware that maps the `HttpResponseMessage` onto the `HttpResponse` object, and that is returned to the client.
24+
That is basically it, with a bunch of other features!
2325

2426
## Features
25-
26-
A quick list of Ocelot's capabilities, for more information see the [Documentation](#documentation).
27+
A concise list of Ocelot's capabilities, for further details refer to [Documentation](#documentation)
2728

2829
* [Routing](https://ocelot.readthedocs.io/en/latest/features/routing.html)
2930
* [Request Aggregation](https://ocelot.readthedocs.io/en/latest/features/requestaggregation.html)
@@ -45,46 +46,44 @@ A quick list of Ocelot's capabilities, for more information see the [Documentati
4546
* [Platform](https://ocelot.readthedocs.io/en/latest/building/building.html?highlight=Platform#building) & Cloud Agnostic [Building](https://ocelot.readthedocs.io/en/latest/building/building.html)
4647

4748
## Install
49+
Ocelot is designed to work with [ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/) and it targets `net8.0` [LTS](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core#release-types) and `net9.0` [STS](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core#release-types) target framework monikers ([TFMs](https://learn.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-frameworks)). [^4]
4850

49-
Ocelot is designed to work with ASP.NET Core and it targets `net6.0`, `net7.0` and `net8.0` frameworks. [^4]
50-
51-
Install [Ocelot package](https://www.nuget.org/packages/Ocelot) and its dependencies using NuGet Package Manager:
51+
Install [Ocelot](https://www.nuget.org/packages/Ocelot) package and its dependencies using NuGet package manager:
5252
```powershell
5353
Install-Package Ocelot
5454
```
5555
Or via the .NET CLI:
5656
```shell
5757
dotnet add package Ocelot
5858
```
59-
All versions can be found [on nuget](https://www.nuget.org/packages/Ocelot#versions-body-tab).
59+
All versions are available [on NuGet](https://www.nuget.org/packages/Ocelot#versions-body-tab).
6060

6161
## Documentation
62-
- [Ocelot documentation — Read the Docs](https://ocelot.readthedocs.io)
63-
<br/>This includes lots of information and will be helpful if you want to understand the features Ocelot currently offers.
64-
- [Ocelot RST Docs](https://github.com/ThreeMammals/Ocelot/tree/develop/docs)
65-
<br/>This includes source code of documentation as **.rst** files which are up to date for current development.
66-
- [Ask Ocelot Guru](https://gurubase.io/g/ocelot)
67-
<br/>It's a Ocelot-focused AI to answer your questions.
62+
- [RST-sources](https://github.com/ThreeMammals/Ocelot/tree/develop/docs):
63+
This includes the source code of the documentation as **.rst**-files, which are up to date for current development.
64+
- [Read the Docs](https://ocelot.readthedocs.io):
65+
This includes a lot of information and will be helpful if you want to understand the features Ocelot currently offers.
66+
- [Ask Ocelot Guru](https://gurubase.io/g/ocelot):
67+
It is an Ocelot-focused AI designed to answer your questions. [^5]
6868

6969
## Coming up
70-
You can see what we are working on in [backlog](https://github.com/ThreeMammals/Ocelot/issues).
70+
You can see what we are working on in the [backlog](https://github.com/ThreeMammals/Ocelot/issues).
7171

7272
## Contributing
73+
We love to receive contributions from the community, so please keep them coming.
74+
Pull requests, issues, and commentary welcome! <img src="https://raw.githubusercontent.com/ThreeMammals/Ocelot/refs/heads/assets/images/octocat.png" alt="octocat" height="20">
7375

74-
We love to receive contributions from the community, so please keep them coming :octocat:
75-
<br/>Pull requests, issues and commentary welcome!
76-
77-
Please complete the relevant [template](https://github.com/ThreeMammals/Ocelot/tree/main/.github) for [issues](https://github.com/ThreeMammals/Ocelot/blob/main/.github/ISSUE_TEMPLATE.md) and [PRs](https://github.com/ThreeMammals/Ocelot/blob/main/.github/PULL_REQUEST_TEMPLATE.md).
76+
Please complete the relevant [template](https://github.com/ThreeMammals/Ocelot/tree/main/.github) for [issues](https://github.com/ThreeMammals/Ocelot/blob/main/.github/ISSUE_TEMPLATE.md) and [pull requests](https://github.com/ThreeMammals/Ocelot/blob/main/.github/PULL_REQUEST_TEMPLATE.md).
7877
Sometimes it's worth getting in touch with us to [discuss](https://github.com/ThreeMammals/Ocelot/discussions) changes before doing any work in case this is something we are already doing or it might not make sense.
79-
We can also give advice on the easiest way to do things :octocat:
78+
We can also give advice on the easiest way to do things <img src="https://raw.githubusercontent.com/ThreeMammals/Ocelot/refs/heads/assets/images/octocat.png" alt="octocat" height="20">
8079

8180
Finally, we mark all existing issues as [![label: help wanted][~helpwanted]](https://github.com/ThreeMammals/Ocelot/labels/help%20wanted)
8281
[![label: small effort][~smalleffort]](https://github.com/ThreeMammals/Ocelot/labels/small%20effort)
8382
[![label: medium effort][~mediumeffort]](https://github.com/ThreeMammals/Ocelot/labels/medium%20effort)
84-
[![label: large effort][~largeeffort]](https://github.com/ThreeMammals/Ocelot/labels/large%20effort). [^5]
85-
<br/>If you want to contribute for the first time, we suggest looking at a [![label: help wanted][~helpwanted]](https://github.com/ThreeMammals/Ocelot/labels/help%20wanted)
83+
[![label: large effort][~largeeffort]](https://github.com/ThreeMammals/Ocelot/labels/large%20effort). [^6]
84+
If you want to contribute for the first time, we suggest looking at a [![label: help wanted][~helpwanted]](https://github.com/ThreeMammals/Ocelot/labels/help%20wanted)
8685
[![label: small effort][~smalleffort]](https://github.com/ThreeMammals/Ocelot/labels/small%20effort)
87-
[![label: good first issue][~goodfirstissue]](https://github.com/ThreeMammals/Ocelot/labels/good%20first%20issue) :octocat:
86+
[![label: good first issue][~goodfirstissue]](https://github.com/ThreeMammals/Ocelot/labels/good%20first%20issue) <img src="https://raw.githubusercontent.com/ThreeMammals/Ocelot/refs/heads/assets/images/octocat.png" alt="octocat" height="20">
8887

8988
[~helpwanted]: https://img.shields.io/badge/-help%20wanted-128A0C.svg
9089
[~smalleffort]: https://img.shields.io/badge/-small%20effort-fef2c0.svg
@@ -93,8 +92,9 @@ Finally, we mark all existing issues as [![label: help wanted][~helpwanted]](htt
9392
[~goodfirstissue]: https://img.shields.io/badge/-good%20first%20issue-ffc4d8.svg
9493

9594
### Notes
96-
[^1]: Ocelot doesn’t directly support [GraphQL](https://graphql.org/). Developers can easily integrate the [GraphQL for .NET](/graphql-dotnet/graphql-dotnet) library.
97-
[^2]: Ocelot does support [Consul](https://www.consul.io/), [Netflix Eureka](https://www.nuget.org/packages/Steeltoe.Discovery.Eureka), [Service Fabric](https://azure.microsoft.com/en-us/products/service-fabric/) service discovery providers, and special modes like [Dynamic Routing](/ThreeMammals/Ocelot/blob/main/docs/features/servicediscovery.rst#dynamic-routing) and [Custom Providers](/ThreeMammals/Ocelot/blob/main/docs/features/servicediscovery.rst#custom-providers).
95+
[^1]: Ocelot does not directly support [GraphQL](https://graphql.org/). Developers can easily integrate the [GraphQL for .NET](https://github.com/graphql-dotnet/graphql-dotnet) library.
96+
[^2]: Ocelot supports [Consul](https://www.consul.io/), [Netflix Eureka](https://www.nuget.org/packages/Steeltoe.Discovery.Eureka), [Service Fabric](https://azure.microsoft.com/en-us/products/service-fabric/) service discovery providers, as well as special modes like [Dynamic Routing](/ThreeMammals/Ocelot/blob/main/docs/features/servicediscovery.rst#dynamic-routing) and [Custom Providers](/ThreeMammals/Ocelot/blob/main/docs/features/servicediscovery.rst#custom-providers).
9897
[^3]: Retry policies only via [Polly](/App-vNext/Polly) library.
99-
[^4]: Starting with [v21.0](https://github.com/ThreeMammals/Ocelot/releases/tag/21.0.0), the solution's code base supports [Multitargeting](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-multitargeting-overview) as SDK-style projects. It should be easier for teams to move between (migrate to) .NET 6, 7 and 8 frameworks. Also, new features will be available for all .NET SDKs which we support via multitargeting. Find out more here: [Target frameworks in SDK-style projects](https://learn.microsoft.com/en-us/dotnet/standard/frameworks)
100-
[^5]: See all [labels](https://github.com/ThreeMammals/Ocelot/issues/labels) of the repository.
98+
[^4]: Starting with version [21.0](https://github.com/ThreeMammals/Ocelot/releases/tag/21.0.0), the solution's code base supports [Multitargeting](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-multitargeting-overview) as SDK-style projects. It should be easier for teams to migrate to the currently supported [.NET 8 and 9](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core#lifecycle) frameworks. Also, new features will be available for all .NET SDKs that we support via multitargeting. Find out more here: [Target frameworks in SDK-style projects](https://learn.microsoft.com/en-us/dotnet/standard/frameworks)
99+
[^5]: [Ocelot Guru](https://gurubase.io/g/ocelot) is an unofficial tool to get answers regarding Ocelot: please consider it an advanced search tool. Thus, we have an official [Questions & Answers](https://github.com/ThreeMammals/Ocelot/discussions/categories/q-a) category in the [Discussions](https://github.com/ThreeMammals/Ocelot/discussions) space.
100+
[^6]: See all [labels](https://github.com/ThreeMammals/Ocelot/issues/labels) for the repository, which are useful for searching and filtering.

docs/building/building.rst

-13
This file was deleted.

0 commit comments

Comments
 (0)