Skip to content

Commit d3a623e

Browse files
authored
Merge pull request #1755 from ThreeMammals/release/20.0
Documentation release 20.0.1 -------------------------------- Guillaume Gnaegi (1): #1731 Read the Docs configuration file v2 (#1733) Raman Maksimchuk (1): #1731 Docs for 20.0 release (#1754) raman-m (2): Prepare for the 20.0.1 release Trigger new build...
2 parents 637fde8 + 028e257 commit d3a623e

Some content is hidden

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

49 files changed

+1978
-2661
lines changed

.readthedocs.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the OS, Python version and other tools you might need
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.11"
13+
# You can also specify other tool versions:
14+
# nodejs: "19"
15+
# rust: "1.64"
16+
# golang: "1.19"
17+
18+
# Build documentation in the "docs/" directory with Sphinx
19+
sphinx:
20+
configuration: docs/conf.py
21+
22+
# Optionally build your docs in additional formats such as PDF and ePub
23+
formats:
24+
- pdf
25+
- epub
26+
27+
# Optional but recommended, declare the Python requirements required to build your documentation
28+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
29+
python:
30+
install:
31+
- requirements: docs/requirements.txt

Ocelot.sln

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1010
.dockerignore = .dockerignore
1111
.editorconfig = .editorconfig
1212
.gitignore = .gitignore
13+
.readthedocs.yaml = .readthedocs.yaml
1314
build.cake = build.cake
1415
build.ps1 = build.ps1
1516
codeanalysis.ruleset = codeanalysis.ruleset

README.md

+60-42
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
[![CircleCI](https://circleci.com/gh/ThreeMammals/Ocelot/tree/main.svg?style=svg)](https://circleci.com/gh/ThreeMammals/Ocelot/tree/main)
44

5-
[![Coverage Status](https://coveralls.io/repos/github/ThreeMammals/Ocelot/badge.svg)](https://coveralls.io/github/ThreeMammals/Ocelot)
5+
<!-- [![Coverage Status](https://coveralls.io/repos/github/ThreeMammals/Ocelot/badge.svg)](https://coveralls.io/github/ThreeMammals/Ocelot) -->
66

7-
# Ocelot
7+
## About
88

99
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 and run on any platform that ASP.NET Core supports.
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.
1111

12-
In particular I want easy integration with IdentityServer reference and bearer tokens.
13-
14-
We have been unable to find this in my current workplace without having to write our own Javascript middlewares to handle the IdentityServer reference tokens. We would rather use the IdentityServer code that already exists to do this.
12+
In particular we want easy integration with [IdentityServer](https://github.com/IdentityServer) reference and [Bearer](https://oauth.net/2/bearer-tokens/) tokens.
13+
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.
14+
We would rather use the IdentityServer code that already exists to do this.
1515

1616
Ocelot is a bunch of middlewares in a specific order.
1717

@@ -23,56 +23,74 @@ That is basically it with a bunch of other features!
2323

2424
## Features
2525

26-
A quick list of Ocelot's capabilities for more information see the [documentation](https://ocelot.readthedocs.io/en/latest/).
27-
28-
* Routing
29-
* Request Aggregation
30-
* Service Discovery with Consul & Eureka
31-
* Service Fabric
32-
* Kubernetes
33-
* WebSockets
34-
* Authentication
35-
* Authorization
36-
* Rate Limiting
37-
* Caching
38-
* Retry policies / QoS
39-
* Load Balancing
40-
* Logging / Tracing / Correlation
41-
* Headers / Method / Query String / Claims Transformation
42-
* Custom Middleware / Delegating Handlers
43-
* Configuration / Administration REST API
44-
* Platform / Cloud Agnostic
26+
A quick list of Ocelot's capabilities, for more information see the [Documentation](#documentation).
27+
28+
* [Routing](https://ocelot.readthedocs.io/en/latest/features/routing.html)
29+
* [Request Aggregation](https://ocelot.readthedocs.io/en/latest/features/requestaggregation.html)
30+
* [GraphQL](https://ocelot.readthedocs.io/en/latest/features/graphql.html) [^1]
31+
* [Service Discovery](https://ocelot.readthedocs.io/en/latest/features/servicediscovery.html) [^2]
32+
* [Service Fabric](https://ocelot.readthedocs.io/en/latest/features/servicefabric.html)
33+
* [Kubernetes](https://ocelot.readthedocs.io/en/latest/features/kubernetes.html)
34+
* [Websockets](https://ocelot.readthedocs.io/en/latest/features/websockets.html)
35+
* [Authentication](https://ocelot.readthedocs.io/en/latest/features/authentication.html)
36+
* [Authorization](https://ocelot.readthedocs.io/en/latest/features/authorization.html)
37+
* [Rate Limiting](https://ocelot.readthedocs.io/en/latest/features/ratelimiting.html)
38+
* [Caching](https://ocelot.readthedocs.io/en/latest/features/caching.html)
39+
* [Quality of Service](https://ocelot.readthedocs.io/en/latest/features/qualityofservice.html) [^3]
40+
* [Load Balancer](https://ocelot.readthedocs.io/en/latest/features/loadbalancer.html)
41+
* [Logging](https://ocelot.readthedocs.io/en/latest/features/logging.html) / [Tracing](https://ocelot.readthedocs.io/en/latest/features/tracing.html) / [Correlation](https://ocelot.readthedocs.io/en/latest/features/requestid.html)
42+
* [Headers](https://ocelot.readthedocs.io/en/latest/features/headerstransformation.html) / [Method](https://ocelot.readthedocs.io/en/latest/features/methodtransformation.html) / [Query String](https://ocelot.readthedocs.io/en/latest/search.html?q=Query+String&check_keywords=yes&area=default) / [Claims](https://ocelot.readthedocs.io/en/latest/features/claimstransformation.html) Transformation
43+
* [Custom Middleware](https://ocelot.readthedocs.io/en/latest/features/middlewareinjection.html) / [Delegating Handlers](https://ocelot.readthedocs.io/en/latest/features/delegatinghandlers.html)
44+
* [Configuration](https://ocelot.readthedocs.io/en/latest/features/configuration.html) / [Administration](https://ocelot.readthedocs.io/en/latest/features/administration.html) REST API
45+
* [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)
4546

4647
## Install
4748

48-
Ocelot is designed to work with ASP.NET and it targets `net7.0`.
49-
50-
Install Ocelot and its dependencies using NuGet Package Manager:
49+
Ocelot is designed to work with ASP.NET Core and it targets `net7.0` framework.
50+
Install [Ocelot package](https://www.nuget.org/packages/Ocelot) and its dependencies using NuGet Package Manager:
5151
```powershell
5252
Install-Package Ocelot
5353
```
54-
5554
Or via the .NET CLI:
5655
```shell
5756
dotnet add package Ocelot
5857
```
59-
60-
All versions can be found [here](https://www.nuget.org/packages/Ocelot/).
58+
All versions can be found [on nuget](https://www.nuget.org/packages/Ocelot#versions-body-tab).
6159

6260
## Documentation
63-
64-
Please click [here](https://ocelot.readthedocs.io/en/latest/) for the Ocelot documentation. This includes lots of information and will be helpful if you want to understand the features Ocelot currently offers.
61+
- [Ocelot documentation — Read the Docs](https://ocelot.readthedocs.io)
62+
<br/>This includes lots of information and will be helpful if you want to understand the features Ocelot currently offers.
63+
- [Ocelot RST Docs](https://github.com/ThreeMammals/Ocelot/tree/develop/docs)
64+
<br/>This includes source code of documentation as **.rst** files which are up to date for current development.
6565

6666
## Coming up
67-
68-
You can see what we are working on [here](https://github.com/ThreeMammals/Ocelot/issues).
67+
You can see what we are working on in [backlog](https://github.com/ThreeMammals/Ocelot/issues).
6968

7069
## Contributing
7170

72-
We love to receive contributions from the community so please keep them coming :)
73-
74-
Pull requests, issues and commentary welcome!
75-
76-
Please complete the relevant template for issues and PRs. Sometimes it's worth getting in touch with us to discuss changes before doing any work in case this is something we are already doing or it might not make sense. We can also give advice on the easiest way to do things :)
77-
78-
Finally we mark all existing issues as help wanted, small, medium and large effort. If you want to contribute for the first time I suggest looking at a help wanted & small effort issue :)
71+
We love to receive contributions from the community, so please keep them coming :octocat:
72+
<br/>Pull requests, issues and commentary welcome!
73+
74+
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).
75+
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.
76+
We can also give advice on the easiest way to do things :octocat:
77+
78+
Finally, we mark all existing issues as [![label: help wanted][~helpwanted]](https://github.com/ThreeMammals/Ocelot/labels/help%20wanted)
79+
[![label: small effort][~smalleffort]](https://github.com/ThreeMammals/Ocelot/labels/small%20effort)
80+
[![label: medium effort][~mediumeffort]](https://github.com/ThreeMammals/Ocelot/labels/medium%20effort)
81+
[![label: large effort][~largeeffort]](https://github.com/ThreeMammals/Ocelot/labels/large%20effort) [^4].
82+
<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: small effort][~smalleffort]](https://github.com/ThreeMammals/Ocelot/labels/small%20effort)
84+
[![label: good first issue][~goodfirstissue]](https://github.com/ThreeMammals/Ocelot/labels/good%20first%20issue) :octocat:
85+
86+
[~helpwanted]: https://img.shields.io/badge/-help%20wanted-128A0C.svg
87+
[~smalleffort]: https://img.shields.io/badge/-small%20effort-fef2c0.svg
88+
[~mediumeffort]: https://img.shields.io/badge/-medium%20effort-e0f42c.svg
89+
[~largeeffort]: https://img.shields.io/badge/-large%20effort-10526b.svg
90+
[~goodfirstissue]: https://img.shields.io/badge/-good%20first%20issue-ffc4d8.svg
91+
92+
### Notes
93+
[^1]: Ocelot doesn’t directly support [GraphQL](https://graphql.org/). Developers can easily integrate the [GraphQL for .NET](/graphql-dotnet/graphql-dotnet) library.
94+
[^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+
[^3]: Retry policies only via [Polly](/App-vNext/Polly) library.
96+
[^4]: See all [labels](https://github.com/ThreeMammals/Ocelot/issues/labels) of the repository.

ReleaseNotes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
## September 2023 (version {0}) aka [Polish Apple](https://www.google.com/search?q=Polish+Apple) release
2-
> Codenamed as **[Polish Apple](https://www.google.com/search?q=Polish+Apple)**
1+
## Documentation release {0} for [Polish Apple](https://www.google.com/search?q=Polish+Apple), v{1}
2+
Special thanks to @ggnaegi!

build.cake

+43-45
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ Task("Release")
8585
.IsDependentOn("Build")
8686
.IsDependentOn("CreateReleaseNotes")
8787
.IsDependentOn("CreateArtifacts")
88-
.IsDependentOn("PublishGitHubRelease")
89-
.IsDependentOn("PublishToNuget");
88+
.IsDependentOn("PublishGitHubRelease");
89+
// .IsDependentOn("PublishToNuget");
9090

9191
Task("Compile")
9292
.IsDependentOn("Clean")
@@ -138,11 +138,6 @@ Task("CreateReleaseNotes")
138138
{
139139
Information($"Generating release notes at {releaseNotesFile}");
140140

141-
var releaseVersion = versioning.NuGetVersion;
142-
// Read main header from Git file, substitute version in header, and add content further...
143-
var releaseHeader = string.Format(System.IO.File.ReadAllText("./ReleaseNotes.md"), releaseVersion);
144-
var releaseNotes = new List<string> { releaseHeader };
145-
146141
// local helper function
147142
Func<string, IEnumerable<string>> GitHelper = (command) =>
148143
{
@@ -160,6 +155,11 @@ Task("CreateReleaseNotes")
160155
var lastRelease = lastReleaseTags.First(t => !t.StartsWith("net")); // skip 'net*-vX.Y.Z' tag and take 'major.minor.build'
161156
Information("Last release tag is " + lastRelease);
162157

158+
var releaseVersion = versioning.NuGetVersion;
159+
// Read main header from Git file, substitute version in header, and add content further...
160+
var releaseHeader = string.Format(System.IO.File.ReadAllText("./ReleaseNotes.md"), releaseVersion, lastRelease);
161+
var releaseNotes = new List<string> { releaseHeader };
162+
163163
var shortlogSummary = GitHelper($"shortlog --no-merges --numbered --summary {lastRelease}..HEAD");
164164
var re = new Regex(@"^[\s\t]*(?'commits'\d+)[\s\t]+(?'author'.*)$");
165165
var summary = shortlogSummary
@@ -296,9 +296,9 @@ Task("CreateReleaseNotes")
296296
}
297297
}
298298
} // END of Top 3
299-
releaseNotes.Add("### Honoring :medal_sports: aka Top Contributors :clap:");
300-
releaseNotes.AddRange(topContributors);
301-
releaseNotes.Add("");
299+
//releaseNotes.Add("### Honoring :medal_sports: aka Top Contributors :clap:");
300+
//releaseNotes.AddRange(topContributors);
301+
//releaseNotes.Add("");
302302
releaseNotes.Add("### Starring :star: aka Release Influencers :bowtie:");
303303
releaseNotes.AddRange(starring);
304304
releaseNotes.Add("");
@@ -409,26 +409,31 @@ Task("CreateArtifacts")
409409
{
410410
EnsureDirectoryExists(packagesDir);
411411

412-
CopyFiles("./src/**/Release/Ocelot.*.nupkg", packagesDir);
412+
System.IO.File.AppendAllLines(artifactsFile, new[] { "ReleaseNotes.md" });
413+
CopyFiles("./ReleaseNotes.md", packagesDir);
413414

414-
var projectFiles = GetFiles("./src/**/Release/Ocelot.*.nupkg");
415-
416-
foreach(var projectFile in projectFiles)
417-
{
418-
System.IO.File.AppendAllLines(
419-
artifactsFile,
420-
new[] { projectFile.GetFilename().FullPath, "ReleaseNotes.md" }
421-
);
422-
}
415+
// CopyFiles("./src/**/Release/Ocelot.*.nupkg", packagesDir);
416+
// var projectFiles = GetFiles("./src/**/Release/Ocelot.*.nupkg");
417+
// foreach(var projectFile in projectFiles)
418+
// {
419+
// System.IO.File.AppendAllLines(
420+
// artifactsFile,
421+
// new[] { projectFile.GetFilename().FullPath }
422+
// );
423+
// }
423424

424425
var artifacts = System.IO.File.ReadAllLines(artifactsFile)
425426
.Distinct();
426427

427428
foreach(var artifact in artifacts)
428429
{
429430
var codePackage = packagesDir + File(artifact);
430-
431-
Information("Created package " + codePackage);
431+
if (FileExists(codePackage))
432+
{
433+
Information("Created package " + codePackage);
434+
} else {
435+
Information("Package does not exist: " + codePackage);
436+
}
432437
}
433438
});
434439

@@ -586,14 +591,12 @@ private void CreateGitHubRelease()
586591

587592
var content = new System.Net.Http.StringContent(json, System.Text.Encoding.UTF8, "application/json");
588593

589-
using(var client = new System.Net.Http.HttpClient())
594+
using (var client = new System.Net.Http.HttpClient())
590595
{
591-
client.DefaultRequestHeaders.Authorization =
592-
new System.Net.Http.Headers.AuthenticationHeaderValue(
593-
"Basic", Convert.ToBase64String(
594-
System.Text.ASCIIEncoding.ASCII.GetBytes(
595-
$"{gitHubUsername}:{gitHubPassword}")));
596-
596+
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(
597+
"Basic",
598+
Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes($"{gitHubUsername}:{gitHubPassword}"))
599+
);
597600
client.DefaultRequestHeaders.Add("User-Agent", "Ocelot Release");
598601

599602
var result = client.PostAsync("https://api.github.com/repos/ThreeMammals/Ocelot/releases", content).Result;
@@ -618,14 +621,12 @@ private void UploadFileToGitHubRelease(FilePath file)
618621
var content = new System.Net.Http.ByteArrayContent(data);
619622
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
620623

621-
using(var client = new System.Net.Http.HttpClient())
624+
using (var client = new System.Net.Http.HttpClient())
622625
{
623-
client.DefaultRequestHeaders.Authorization =
624-
new System.Net.Http.Headers.AuthenticationHeaderValue(
625-
"Basic", Convert.ToBase64String(
626-
System.Text.ASCIIEncoding.ASCII.GetBytes(
627-
$"{gitHubUsername}:{gitHubPassword}")));
628-
626+
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(
627+
"Basic",
628+
Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes($"{gitHubUsername}:{gitHubPassword}"))
629+
);
629630
client.DefaultRequestHeaders.Add("User-Agent", "Ocelot Release");
630631

631632
var result = client.PostAsync($"https://uploads.github.com/repos/ThreeMammals/Ocelot/releases/{releaseId}/assets?name={file.GetFilename()}", content).Result;
@@ -642,25 +643,22 @@ private void CompleteGitHubRelease()
642643
var request = new System.Net.Http.HttpRequestMessage(new System.Net.Http.HttpMethod("Patch"), $"https://api.github.com/repos/ThreeMammals/Ocelot/releases/{releaseId}");
643644
request.Content = new System.Net.Http.StringContent(json, System.Text.Encoding.UTF8, "application/json");
644645

645-
using(var client = new System.Net.Http.HttpClient())
646+
using (var client = new System.Net.Http.HttpClient())
646647
{
647-
client.DefaultRequestHeaders.Authorization =
648-
new System.Net.Http.Headers.AuthenticationHeaderValue(
649-
"Basic", Convert.ToBase64String(
650-
System.Text.ASCIIEncoding.ASCII.GetBytes(
651-
$"{gitHubUsername}:{gitHubPassword}")));
652-
648+
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(
649+
"Basic",
650+
Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes($"{gitHubUsername}:{gitHubPassword}"))
651+
);
653652
client.DefaultRequestHeaders.Add("User-Agent", "Ocelot Release");
654653

655654
var result = client.SendAsync(request).Result;
656-
if(result.StatusCode != System.Net.HttpStatusCode.OK)
655+
if (result.StatusCode != System.Net.HttpStatusCode.OK)
657656
{
658657
throw new Exception("CompleteGitHubRelease result.StatusCode = " + result.StatusCode);
659658
}
660659
}
661660
}
662661

663-
664662
/// gets the resource from the specified url
665663
private async Task<string> GetResourceAsync(string url)
666664
{

0 commit comments

Comments
 (0)