Skip to content

Commit 290fbde

Browse files
authored
Release 23.0 | Artifacts | +semver: breaking (ThreeMammals#1962)
* Review & update docs and fix build warnings * Update ReleaseNotes.md: Draft template for build script * Final version of Release Notes
1 parent a1607f5 commit 290fbde

9 files changed

+124
-63
lines changed

ReleaseNotes.md

+58-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,63 @@
1-
## Hotfix release (version {0})
2-
> Default timeout vs the [Quality of Service](https://ocelot.readthedocs.io/en/latest/features/qualityofservice.html) feature
1+
## November-December 2023 (version {0}) aka [Sunny Koliada](https://www.google.com/search?q=winter+solstice) release
2+
> Codenamed as **[Sunny Koliada](https://www.bing.com/search?q=winter+solstice)**
33
4-
Special thanks to **Alvin Huang**, @huanguolin!
4+
### Focus On
55

6-
### About
7-
The bug is related to the **Quality of Service** feature (aka **QoS**) and the [HttpClient.Timeout](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.timeout) property.
8-
- If JSON `QoSOptions` section is defined in the route config, then the bug is masked rather than active, and the timeout value is assigned from the [QoS TimeoutValue](https://ocelot.readthedocs.io/en/latest/features/qualityofservice.html#quality-of-service:~:text=%22TimeoutValue%22%3A%205000) property.
9-
- If the `QoSOptions` section **is not** defined in the route config or the [TimeoutValue](https://ocelot.readthedocs.io/en/latest/features/qualityofservice.html#quality-of-service:~:text=%22TimeoutValue%22%3A%205000) property is missing, then the bug is **active** and affects downstream requests that **never time out**.
6+
<details>
7+
<summary><b>System performance</b>. System core performance review, redesign of system core related to routing and content streaming</summary>
108

11-
### Technical info
12-
In version [22.0](https://github.com/ThreeMammals/Ocelot/releases/tag/22.0.0), the bug was found in the explicit default constructor of the [FileQoSOptions](https://github.com/ThreeMammals/Ocelot/blob/main/src/Ocelot/Configuration/File/FileQoSOptions.cs) class with a maximum [TimeoutValue](https://github.com/ThreeMammals/Ocelot/blob/main/src/Ocelot/Configuration/File/FileQoSOptions.cs#L9). Previously, the default constructor was implicit with the default assignment of zero `0` to all `int` properties.
9+
- Modification of the `RequestMapper` with a brand new `StreamHttpContent` class, in `Ocelot.Request.Mapper` namespace. The request body is no longer copied when it is handled by the API gateway, avoiding Out-of-Memory issues in pods/containers. This significantly reduces the gateway's memory consumption, and allows you to transfer content larger than 2 GB in streaming scenarios.
10+
- Introduction of a new Message Invoker pool, in `Ocelot.Requester` namespace. We have replaced the [HttpClient](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) class with [HttpMessageInvoker](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpmessageinvoker), which is the base class for `HttpClient`. The overall logic for managing the pool has been simplified, resulting in a reduction in the number of CPU cycles.
11+
- Full HTTP content buffering is deactivated, resulting in a 50% reduction in memory consumption and a performance improvement of around 10%. Content is no longer copied on the API gateway, avoiding Out-of-Memory issues.
12+
- **TODO** Include screenshots from Production...
13+
</details>
1314

14-
The new explicit default constructor breaks the old implementation of [QoS TimeoutValue](https://github.com/ThreeMammals/Ocelot/blob/main/src/Ocelot/Requester/HttpClientBuilder.cs#L53-L55) logic, as our [QoS documentation](https://ocelot.readthedocs.io/en/latest/features/qualityofservice.html#quality-of-service:~:text=If%20you%20do%20not%20add%20a%20QoS%20section%2C%20QoS%20will%20not%20be%20used%2C%20however%20Ocelot%20will%20default%20to%20a%2090%20seconds%20timeout%20on%20all%20downstream%20requests.) states:
15-
![image](https://github.com/ThreeMammals/Ocelot/assets/12430413/2c6b2cd3-e1c6-4510-9e46-883468c140ec) <br/>
16-
**Finally**, the "default 90 second" logic for `HttpClient` breaks down when there are no **QoS** options and all requests on those routes are infinite, if, for example, downstream services are down or stuck.
15+
<details>
16+
<summary><b>Ocelot extra packages</b>. Total 3 Ocelot packs were updated</summary>
17+
18+
- [Ocelot.Cache.CacheManager](https://github.com/ThreeMammals/Ocelot/tree/main/src/Ocelot.Cache.CacheManager): Introduced default cache key generator with improved performance (the `DefaultCacheKeyGenerator` class). Old version of `CacheKeyGenerator` had significant performance issue when reading full content of HTTP request for caching key calculation of MD5 hash value. This hash value was excluded from the caching key.
19+
- [Ocelot.Provider.Kubernetes](https://github.com/ThreeMammals/Ocelot/tree/main/src/Ocelot.Provider.Kubernetes): Fixed long lasting breaking change being added in version [15.0.0](https://github.com/ThreeMammals/Ocelot/releases/tag/15.0.0), see commit https://github.com/ThreeMammals/Ocelot/commit/6e5471a714dddb0a3a40fbb97eac2810cee1c78d. The bug persisted for more than 3 years in versions **15.0.0-22.0.1**, being masked multiple times via class renaming! **Special Thanks to @ZisisTsatsas** who once again brought this issue to our attention, and our team finally realized that we had a breaking change and the provider was broken.
1720

18-
#### The Bug Artifacts
19-
- Reported bug issue: [1833](https://github.com/ThreeMammals/Ocelot/issues/1833) by @huanguolin
20-
- Hotfix PR: [1834](https://github.com/ThreeMammals/Ocelot/pull/1834) by @huanguolin
21+
- [Ocelot.Provider.Polly](https://github.com/ThreeMammals/Ocelot/tree/main/src/Ocelot.Provider.Polly): A minor changes without feature delivery. We are preparing for a major update to the package in the next release.
22+
</details>
23+
24+
<details>
25+
<summary><b>Middlewares</b>. Total 8 Ocelot middlewares were updated</summary>
26+
27+
- `AuthenticationMiddleware`: Added new [Multiple Authentication Schemes](https://github.com/ThreeMammals/Ocelot/pull/1870) feature by @MayorSheFF
28+
- `OutputCacheMiddleware`, `RequestIdMiddleware`: Added new [Cache by Header Value](https://github.com/ThreeMammals/Ocelot/pull/1172) by @EngRajabi, and redesigned as [Default CacheKeyGenerator](https://github.com/ThreeMammals/Ocelot/pull/1849) feature by @raman-m
29+
- `DownstreamUrlCreatorMiddleware`: Fixed [bug](https://github.com/ThreeMammals/Ocelot/issues/748) for ending/omitting slash in path templates aka [Empty placeholders](https://github.com/ThreeMammals/Ocelot/pull/1911) feature by @AlyHKafoury
30+
- `ConfigurationMiddleware`, `HttpRequesterMiddleware`, `ResponderMiddleware`: System upgrade for [Custom HttpMessageInvoker pooling](https://github.com/ThreeMammals/Ocelot/pull/1824) feature by @ggnaegi
31+
- `DownstreamRequestInitialiserMiddleware`: System upgrade for [Performance of Request Mapper](https://github.com/ThreeMammals/Ocelot/pull/1724) feature by @ggnaegi
32+
</details>
33+
34+
<details>
35+
<summary>Documentation for <b>Authentication</b>, <b>Caching</b>, <b>Kubernetes</b> and <b>Routing</b></summary>
36+
37+
- [Authentication](https://ocelot.readthedocs.io/en/latest/features/authentication.html)
38+
- [Caching](https://ocelot.readthedocs.io/en/latest/features/caching.html)
39+
- [Kubernetes](https://ocelot.readthedocs.io/en/latest/features/kubernetes.html)
40+
- [Routing](https://ocelot.readthedocs.io/en/latest/features/routing.html)
41+
</details>
42+
43+
<details>
44+
<summary><b>Stabilization</b> aka bug fixing</summary>
45+
46+
- See [all bugs](https://github.com/ThreeMammals/Ocelot/issues?q=is%3Aissue+milestone%3ANov-December%2723+is%3Aclosed+label%3Abug) of the [Nov-December'23](https://github.com/ThreeMammals/Ocelot/milestone/2) milestone
47+
</details>
48+
49+
<details>
50+
<summary><b>Testing</b></summary>
51+
52+
- The `Ocelot.Benchmarks` testing project has been updated with new `PayloadBenchmarks` and `ResponseBenchmarks` by @ggnaegi
53+
- The `Ocelot.AcceptanceTests` testing project has been refactored by @raman-m using the new `AuthenticationSteps` class, and more refactoring will be done in future releases
54+
</details>
55+
56+
### Roadmap
57+
We would like to share our team's plans for the future regarding: development trends, ideas, community expectations, etc.
58+
- **Code Review and Performance Improvements**. Without a doubt, we care about code quality every day, following best development practices. And we review, test, refactor, and redesign features with overall performance in mind. In the next few releases (versions 23.x-24.0) we will take care of: generic providers, multiplexing middleware (Aggregation feature), memory management.
59+
- **Server-Sent Events protocol support**. There is a lot of community interest in this HTTP-based protocol.
60+
- **Long Polling for Consul provider**. [Consul](https://www.consul.io/) is our leading technology for service discovery. We are constantly improving the use cases for the `Ocelot.Provider.Consul` package and trying to improve the code inside the package.
61+
- **QoS feature refactoring**. [Polly](https://github.com/App-vNext/Polly/) was released with the new v.8.2+ after .NET 8. So we have to update `Ocelot.Provider.Polly` package taking into account new Polly behavior of redesigned features.
62+
- **Brainstorming** to redesign Rate Limiting, Websockets. More details in future release notes.
63+
- **Planning** of support for Swagger and gRPC proto. More details in future release notes.

docs/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
88

99
project = 'Ocelot'
10-
copyright = ' 2023 ThreeMammals Ocelot team'
10+
copyright = ' 2016-2024 ThreeMammals Ocelot team'
1111
author = 'Tom Pallister, Ocelot Core team at ThreeMammals'
12-
release = '22.0'
12+
release = '23.0'
1313

1414
# -- General configuration ---------------------------------------------------
1515
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

docs/features/authentication.rst

+13-13
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ users must register authentication services in their **Startup.cs** as usual but
2121
In this example ``MyKey`` is `the scheme <https://learn.microsoft.com/en-us/aspnet/core/security/authentication/#authentication-scheme>`_ that this provider has been registered with.
2222
We then map this to a Route in the configuration using the following `AuthenticationOptions <https://github.com/search?q=repo%3AThreeMammals%2FOcelot%20AuthenticationOptions&type=code>`_ properties:
2323

24-
* ``AuthenticationProviderKey`` is a string object, obsolete. [#f1]_ This is legacy definition when you define :ref:`authentication-single` (scheme).
24+
* ``AuthenticationProviderKey`` is a string object, obsolete [#f1]_. This is legacy definition when you define :ref:`authentication-single`.
2525
* ``AuthenticationProviderKeys`` is an array of strings, the recommended definition of :ref:`authentication-multiple` feature.
2626

27-
.. authentication-single:
27+
.. _authentication-single:
2828

29-
Single Key [#f1]_
30-
-----------------
29+
Single Key aka Authentication Scheme [#f1]_
30+
-------------------------------------------
3131

3232
| Property: ``AuthenticationOptions.AuthenticationProviderKey``
3333
@@ -46,7 +46,7 @@ If there isn't then Ocelot will not start up. If there is then the Route will us
4646
If a Route is authenticated, Ocelot will invoke whatever scheme is associated with it while executing the authentication middleware.
4747
If the request fails authentication, Ocelot returns a HTTP status code `401 Unauthorized <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401>`_.
4848

49-
.. authentication-multiple:
49+
.. _authentication-multiple:
5050

5151
Multiple Authentication Schemes [#f2]_
5252
--------------------------------------
@@ -55,7 +55,7 @@ Multiple Authentication Schemes [#f2]_
5555
5656
In real world of ASP.NET, apps may need to support multiple types of authentication by single Ocelot app instance.
5757
To register `multiple authentication schemes <https://learn.microsoft.com/en-us/aspnet/core/security/authorization/limitingidentitybyscheme#use-multiple-authentication-schemes>`_
58-
(authentication provider keys) for each appropriate authentication provider, use and develop this abstract configuration of two or more schemes:
58+
(`authentication provider keys <https://github.com/search?q=repo%3AThreeMammals%2FOcelot%20AuthenticationProviderKey&type=code>`_) for each appropriate authentication provider, use and develop this abstract configuration of two or more schemes:
5959

6060
.. code-block:: csharp
6161
@@ -68,8 +68,8 @@ To register `multiple authentication schemes <https://learn.microsoft.com/en-us/
6868
.AddMyProvider("MyKey", options => { /* Custom auth setup */ });
6969
}
7070
71-
In this example, the schemes ``MyKey`` and ``Bearer`` represent the keys which these providers have been registered with.
72-
We then map these schemes to a Route in the configuration, as shown below
71+
In this example, the ``MyKey`` and ``Bearer`` schemes represent the keys with which these providers were registered.
72+
We then map these schemes to a Route in the configuration as shown below.
7373

7474
.. code-block:: json
7575
@@ -83,9 +83,8 @@ Afterward, Ocelot applies all steps that are specified for ``AuthenticationProvi
8383
**Note** that the order of the keys in an array definition does matter! We use a "First One Wins" authentication strategy.
8484

8585
Finally, we would say that registering providers, initializing options, forwarding authentication artifacts can be a "real" coding challenge.
86-
If you're stuck or don't know what to do, just find inspiration in our `acceptance tests <https://github.com/search?q=repo%3AThreeMammals%2FOcelot%20MultipleAuthSchemesFeatureTests&type=code>`_
87-
(currently for `Identity Server 4 <https://identityserver4.readthedocs.io/>`_ only).
88-
We would appreciate any new PRs to add extra acceptance tests for your custom scenarios with `multiple authentication schemes <https://learn.microsoft.com/en-us/aspnet/core/security/authorization/limitingidentitybyscheme#use-multiple-authentication-schemes>`__. [#f2]_
86+
If you're stuck or don't know what to do, just find inspiration in our `acceptance tests <https://github.com/search?q=repo%3AThreeMammals%2FOcelot+MultipleAuthSchemesFeatureTests+language%3AC%23&type=code&l=C%23>`_
87+
(currently for `Identity Server 4 <https://identityserver4.readthedocs.io/>`_ only) [#f3]_.
8988

9089
JWT Tokens
9190
----------
@@ -210,5 +209,6 @@ Please, open `Show and tell <https://github.com/ThreeMammals/Ocelot/discussions/
210209

211210
""""
212211

213-
.. [#f1] Use the ``AuthenticationProviderKeys`` property instead of ``AuthenticationProviderKey`` one. We supports this obsolete property because of backward compatibility and allowing migrations. In future releases the property can be removed as a breaking change.
214-
.. [#f2] `Multiple authentication schemes <https://learn.microsoft.com/en-us/aspnet/core/security/authorization/limitingidentitybyscheme#use-multiple-authentication-schemes>`__ feature was requested in issues `740 <https://github.com/ThreeMammals/Ocelot/issues/740>`_, `1580 <https://github.com/ThreeMammals/Ocelot/issues/1580>`_ and delivered as a part of `23.0 <https://github.com/ThreeMammals/Ocelot/releases/tag/23.0.0>`_ release.
212+
.. [#f1] Use the ``AuthenticationProviderKeys`` property instead of ``AuthenticationProviderKey`` one. We support this ``[Obsolete]`` property for backward compatibility and migration reasons. In future releases, the property may be removed as a breaking change.
213+
.. [#f2] "`Multiple authentication schemes <https://learn.microsoft.com/en-us/aspnet/core/security/authorization/limitingidentitybyscheme#use-multiple-authentication-schemes>`__" feature was requested in issues `740 <https://github.com/ThreeMammals/Ocelot/issues/740>`_, `1580 <https://github.com/ThreeMammals/Ocelot/issues/1580>`_ and delivered as a part of `23.0 <https://github.com/ThreeMammals/Ocelot/releases/tag/23.0.0>`_ release.
214+
.. [#f3] We would appreciate any new PRs to add extra acceptance tests for your custom scenarios with `multiple authentication schemes <https://learn.microsoft.com/en-us/aspnet/core/security/authorization/limitingidentitybyscheme#use-multiple-authentication-schemes>`__.

docs/features/caching.rst

+11-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ This is an amazing project that is solving a lot of caching problems. We would r
66

77
The following example shows how to add **CacheManager** to Ocelot so that you can do output caching.
88

9+
Install
10+
-------
11+
912
First of all, add the following `NuGet package <https://www.nuget.org/packages/Ocelot.Cache.CacheManager>`_:
1013

1114
.. code-block:: powershell
@@ -26,11 +29,18 @@ The second thing you need to do something like the following to your ``Configure
2629
.AddCacheManager(x => x.WithDictionaryHandle());
2730
});
2831
32+
Configuration
33+
-------------
34+
2935
Finally, in order to use caching on a route in your Route configuration add this setting:
3036

3137
.. code-block:: json
3238
33-
"FileCacheOptions": { "TtlSeconds": 15, "Region": "europe-central", "Header": "Authorization" }
39+
"FileCacheOptions": {
40+
"TtlSeconds": 15,
41+
"Region": "europe-central",
42+
"Header": "Authorization"
43+
}
3444
3545
In this example **TtlSeconds** is set to 15 which means the cache will expire after 15 seconds.
3646
The **Region** represents a region of caching.

docs/features/kubernetes.rst

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
|K8s Logo| Kubernetes [#f1]_ aka K8s
66
====================================
77

8-
A part of feature: :doc:`../features/servicediscovery`
9-
10-
About [#f2]_
11-
------------
8+
A part of feature: :doc:`../features/servicediscovery` [#f2]_
129

1310
Ocelot will call the `K8s <https://kubernetes.io/>`_ endpoints API in a given namespace to get all of the endpoints for a pod and then load balance across them.
1411
Ocelot used to use the services API to send requests to the `K8s <https://kubernetes.io/>`__ service but this was changed in `PR 1134 <https://github.com/ThreeMammals/Ocelot/pull/1134>`_ because the service did not load balance as expected.
@@ -75,10 +72,10 @@ The example here shows a typical configuration:
7572
}
7673
}
7774
78-
Service deployment in **Namespace** ``Dev``, **ServiceDiscoveryProvider** type is ``Kube``, you also can set :ref:`kubernetes-pollkube-provider` type.
75+
Service deployment in **Namespace** ``Dev``, **ServiceDiscoveryProvider** type is ``Kube``, you also can set :ref:`k8s-pollkube-provider` type.
7976
Note: **Host**, **Port** and **Token** are no longer in use.
8077

81-
.. kubernetes-pollkube-provider:
78+
.. _k8s-pollkube-provider:
8279

8380
PollKube provider
8481
^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)