Skip to content

Commit 3439be8

Browse files
authored
Rename all ReRoute to Route to move closer to YARP +semver: breaking
1 parent fe3e8bd commit 3439be8

File tree

269 files changed

+23587
-23601
lines changed

Some content is hidden

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

269 files changed

+23587
-23601
lines changed

docs/features/authentication.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Authentication
22
==============
33

4-
In order to authenticate ReRoutes and subsequently use any of Ocelot's claims based features such as authorisation or modifying the request with values from the token. Users must register authentication services in their Startup.cs as usual but they provide a scheme (authentication provider key) with each registration e.g.
4+
In order to authenticate Routes and subsequently use any of Ocelot's claims based features such as authorisation or modifying the request with values from the token. Users must register authentication services in their Startup.cs as usual but they provide a scheme (authentication provider key) with each registration e.g.
55

66
.. code-block:: csharp
77
@@ -16,11 +16,11 @@ In order to authenticate ReRoutes and subsequently use any of Ocelot's claims ba
1616
}
1717
1818
19-
In this example TestKey is the scheme that this provider has been registered with. We then map this to a ReRoute in the configuration e.g.
19+
In this example TestKey is the scheme that this provider has been registered with. We then map this to a Route in the configuration e.g.
2020

2121
.. code-block:: json
2222
23-
"ReRoutes": [{
23+
"Routes": [{
2424
"DownstreamHostAndPorts": [
2525
{
2626
"Host": "localhost",
@@ -30,17 +30,17 @@ In this example TestKey is the scheme that this provider has been registered wit
3030
"DownstreamPathTemplate": "/",
3131
"UpstreamPathTemplate": "/",
3232
"UpstreamHttpMethod": ["Post"],
33-
"ReRouteIsCaseSensitive": false,
33+
"RouteIsCaseSensitive": false,
3434
"DownstreamScheme": "http",
3535
"AuthenticationOptions": {
3636
"AuthenticationProviderKey": "TestKey",
3737
"AllowedScopes": []
3838
}
3939
}]
4040
41-
When Ocelot runs it will look at this ReRoutes AuthenticationOptions.AuthenticationProviderKey and check that there is an Authentication provider registered with the given key. If there isn't then Ocelot will not start up, if there is then the ReRoute will use that provider when it executes.
41+
When Ocelot runs it will look at this Routes AuthenticationOptions.AuthenticationProviderKey and check that there is an Authentication provider registered with the given key. If there isn't then Ocelot will not start up, if there is then the Route will use that provider when it executes.
4242

43-
If a ReRoute is authenticated Ocelot will invoke whatever scheme is associated with it while executing the authentication middleware. If the request fails authentication Ocelot returns a http status code 401.
43+
If a Route is authenticated Ocelot will invoke whatever scheme is associated with it while executing the authentication middleware. If the request fails authentication Ocelot returns a http status code 401.
4444

4545
JWT Tokens
4646
^^^^^^^^^^
@@ -63,11 +63,11 @@ If you want to authenticate using JWT tokens maybe from a provider like Auth0 yo
6363
services.AddOcelot();
6464
}
6565
66-
Then map the authentication provider key to a ReRoute in your configuration e.g.
66+
Then map the authentication provider key to a Route in your configuration e.g.
6767

6868
.. code-block:: json
6969
70-
"ReRoutes": [{
70+
"Routes": [{
7171
"DownstreamHostAndPorts": [
7272
{
7373
"Host": "localhost",
@@ -77,7 +77,7 @@ Then map the authentication provider key to a ReRoute in your configuration e.g.
7777
"DownstreamPathTemplate": "/",
7878
"UpstreamPathTemplate": "/",
7979
"UpstreamHttpMethod": ["Post"],
80-
"ReRouteIsCaseSensitive": false,
80+
"RouteIsCaseSensitive": false,
8181
"DownstreamScheme": "http",
8282
"AuthenticationOptions": {
8383
"AuthenticationProviderKey": "TestKey",
@@ -111,11 +111,11 @@ In order to use IdentityServer bearer tokens, register your IdentityServer servi
111111
services.AddOcelot();
112112
}
113113
114-
Then map the authentication provider key to a ReRoute in your configuration e.g.
114+
Then map the authentication provider key to a Route in your configuration e.g.
115115

116116
.. code-block:: json
117117
118-
"ReRoutes": [{
118+
"Routes": [{
119119
"DownstreamHostAndPorts": [
120120
{
121121
"Host": "localhost",
@@ -125,7 +125,7 @@ Then map the authentication provider key to a ReRoute in your configuration e.g.
125125
"DownstreamPathTemplate": "/",
126126
"UpstreamPathTemplate": "/",
127127
"UpstreamHttpMethod": ["Post"],
128-
"ReRouteIsCaseSensitive": false,
128+
"RouteIsCaseSensitive": false,
129129
"DownstreamScheme": "http",
130130
"AuthenticationOptions": {
131131
"AuthenticationProviderKey": "TestKey",
@@ -176,4 +176,4 @@ Allowed Scopes
176176

177177
If you add scopes to AllowedScopes Ocelot will get all the user claims (from the token) of the type scope and make sure that the user has all of the scopes in the list.
178178

179-
This is a way to restrict access to a ReRoute on a per scope basis.
179+
This is a way to restrict access to a Route on a per scope basis.

docs/features/authorisation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Authorisation
22
=============
33

4-
Ocelot supports claims based authorisation which is run post authentication. This means if you have a route you want to authorise you can add the following to you ReRoute configuration.
4+
Ocelot supports claims based authorisation which is run post authentication. This means if you have a route you want to authorise you can add the following to you Route configuration.
55

66
.. code-block:: json
77

docs/features/caching.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The second thing you need to do something like the following to your ConfigureSe
2121
x.WithDictionaryHandle();
2222
})
2323
24-
Finally in order to use caching on a route in your ReRoute configuration add this setting.
24+
Finally in order to use caching on a route in your Route configuration add this setting.
2525

2626
.. code-block:: json
2727

docs/features/claimstransformation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Ocelot allows the user to access claims and transform them into headers, query s
55

66
After the user is authenticated we run the claims to claims transformation middleware. This allows the user to transform claims before the authorisation middleware is called. After the user is authorised first we call the claims to headers middleware, thenthe claims to query string parameters middleware, and Finally the claims to downstream pathmiddleware.
77

8-
The syntax for performing the transforms is the same for each process. In the ReRoute configuration a json dictionary is added with a specific name either AddClaimsToRequest, AddHeadersToRequest, AddQueriesToRequest, or ChangeDownstreamPathTemplate.
8+
The syntax for performing the transforms is the same for each process. In the Route configuration a json dictionary is added with a specific name either AddClaimsToRequest, AddHeadersToRequest, AddQueriesToRequest, or ChangeDownstreamPathTemplate.
99

1010
Note: I'm not a hotshot programmer so have no idea if this syntax is good...
1111

docs/features/configuration.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
Configuration
22
============
33

4-
An example configuration can be found `here <https://github.com/ThreeMammals/Ocelot/blob/master/test/Ocelot.ManualTest/ocelot.json>`_. There are two sections to the configuration. An array of ReRoutes and a GlobalConfiguration. The ReRoutes are the objects that tell Ocelot how to treat an upstream request. The Global configuration is a bit hacky and allows overrides of ReRoute specific settings. It's useful if you don't want to manage lots of ReRoute specific settings.
4+
An example configuration can be found `here <https://github.com/ThreeMammals/Ocelot/blob/master/test/Ocelot.ManualTest/ocelot.json>`_. There are two sections to the configuration. An array of Routes and a GlobalConfiguration. The Routes are the objects that tell Ocelot how to treat an upstream request. The Global configuration is a bit hacky and allows overrides of Route specific settings. It's useful if you don't want to manage lots of Route specific settings.
55

66
.. code-block:: json
77
88
{
9-
"ReRoutes": [],
9+
"Routes": [],
1010
"GlobalConfiguration": {}
1111
}
1212
13-
Here is an example ReRoute configuration, You don't need to set all of these things but this is everything that is available at the moment:
13+
Here is an example Route configuration, You don't need to set all of these things but this is everything that is available at the moment:
1414

1515
.. code-block:: json
1616
@@ -31,7 +31,7 @@ Here is an example ReRoute configuration, You don't need to set all of these thi
3131
"TtlSeconds": 0,
3232
"Region": ""
3333
},
34-
"ReRouteIsCaseSensitive": false,
34+
"RouteIsCaseSensitive": false,
3535
"ServiceName": "",
3636
"DownstreamScheme": "http",
3737
"DownstreamHostAndPorts": [
@@ -112,7 +112,7 @@ Instead of adding the configuration directly e.g. AddJsonFile("ocelot.json") you
112112
113113
In this scenario Ocelot will look for any files that match the pattern (?i)ocelot.([a-zA-Z0-9]*).json and then merge these together. If you want to set the GlobalConfiguration property you must have a file called ocelot.global.json.
114114

115-
The way Ocelot merges the files is basically load them, loop over them, add any ReRoutes, add any AggregateReRoutes and if the file is called ocelot.global.json add the GlobalConfiguration aswell as any ReRoutes or AggregateReRoutes. Ocelot will then save the merged configuration to a file called ocelot.json and this will be used as the source of truth while ocelot is running.
115+
The way Ocelot merges the files is basically load them, loop over them, add any Routes, add any AggregateRoutes and if the file is called ocelot.global.json add the GlobalConfiguration aswell as any Routes or AggregateRoutes. Ocelot will then save the merged configuration to a file called ocelot.json and this will be used as the source of truth while ocelot is running.
116116

117117
At the moment there is no validation at this stage it only happens when Ocelot validates the final merged configuration. This is something to be aware of when you are investigating problems. I would advise always checking what is in ocelot.json if you have any problems.
118118

@@ -195,7 +195,7 @@ If you do not set the ConfigurationKey Ocelot will use the string InternalConfig
195195
Follow Redirects / Use CookieContainer
196196
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
197197

198-
Use HttpHandlerOptions in ReRoute configuration to set up HttpHandler behavior:
198+
Use HttpHandlerOptions in Route configuration to set up HttpHandler behavior:
199199

200200
1. AllowAutoRedirect is a value that indicates whether the request should follow redirection responses. Set it true if the request should automatically follow redirection responses from the Downstream resource; otherwise false. The default value is false.
201201

@@ -204,7 +204,7 @@ Use HttpHandlerOptions in ReRoute configuration to set up HttpHandler behavior:
204204
SSL Errors
205205
^^^^^^^^^^
206206

207-
If you want to ignore SSL warnings / errors set the following in your ReRoute config.
207+
If you want to ignore SSL warnings / errors set the following in your Route config.
208208

209209
.. code-block:: json
210210
@@ -215,7 +215,7 @@ I don't recommend doing this, I suggest creating your own certificate and then g
215215
MaxConnectionsPerServer
216216
^^^^^^^^^^^^^^^^^^^^^^^
217217

218-
This controls how many connections the internal HttpClient will open. This can be set at ReRoute or global level.
218+
This controls how many connections the internal HttpClient will open. This can be set at Route or global level.
219219

220220
React to Configuration Changes
221221
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

docs/features/delegatinghandlers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Next you must add the handlers to Ocelot's container like below...
3131
.AddDelegatingHandler<FakeHandler>()
3232
.AddDelegatingHandler<FakeHandlerTwo>()
3333
34-
Both of these Add methods have a default parameter called global which is set to false. If it is false then the intent of the DelegatingHandler is to be applied to specific ReRoutes via ocelot.json (more on that later). If it is set to true
35-
then it becomes a global handler and will be applied to all ReRoutes.
34+
Both of these Add methods have a default parameter called global which is set to false. If it is false then the intent of the DelegatingHandler is to be applied to specific Routes via ocelot.json (more on that later). If it is set to true
35+
then it becomes a global handler and will be applied to all Routes.
3636

3737
e.g.
3838

@@ -43,7 +43,7 @@ As below...
4343
services.AddOcelot()
4444
.AddDelegatingHandler<FakeHandler>(true)
4545
46-
Finally if you want ReRoute specific DelegatingHandlers or to order your specific and / or global (more on this later) DelegatingHandlers then you must add the following json to the specific ReRoute in ocelot.json. The names in the array must match the class names of your
46+
Finally if you want Route specific DelegatingHandlers or to order your specific and / or global (more on this later) DelegatingHandlers then you must add the following json to the specific Route in ocelot.json. The names in the array must match the class names of your
4747
DelegatingHandlers for Ocelot to match them together.
4848

4949
.. code-block:: json

docs/features/headerstransformation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Add to Request
88

99
This feature was requestes in `GitHub #313 <https://github.com/ThreeMammals/Ocelot/issues/313>`_.
1010

11-
If you want to add a header to your upstream request please add the following to a ReRoute in your ocelot.json:
11+
If you want to add a header to your upstream request please add the following to a Route in your ocelot.json:
1212

1313
.. code-block:: json
1414
@@ -25,15 +25,15 @@ Add to Response
2525

2626
This feature was requested in `GitHub #280 <https://github.com/ThreeMammals/Ocelot/issues/280>`_.
2727

28-
If you want to add a header to your downstream response please add the following to a ReRoute in ocelot.json..
28+
If you want to add a header to your downstream response please add the following to a Route in ocelot.json..
2929

3030
.. code-block:: json
3131
3232
"DownstreamHeaderTransform": {
3333
"Uncle": "Bob"
3434
},
3535
36-
In the example above a header with the key Uncle and value Bob would be returned by Ocelot when requesting the specific ReRoute.
36+
In the example above a header with the key Uncle and value Bob would be returned by Ocelot when requesting the specific Route.
3737

3838
If you want to return the Butterfly APM trace id then do something like the following..
3939

@@ -57,7 +57,7 @@ The key is "Test" and the value is "http://www.bbc.co.uk/, http://ocelot.com/".
5757
Pre Downstream Request
5858
^^^^^^^^^^^^^^^^^^^^^^
5959

60-
Add the following to a ReRoute in ocelot.json in order to replace http://www.bbc.co.uk/ with http://ocelot.com/. This header will be changed before the request downstream and will be sent to the downstream server.
60+
Add the following to a Route in ocelot.json in order to replace http://www.bbc.co.uk/ with http://ocelot.com/. This header will be changed before the request downstream and will be sent to the downstream server.
6161

6262
.. code-block:: json
6363
@@ -68,7 +68,7 @@ Add the following to a ReRoute in ocelot.json in order to replace http://www.bbc
6868
Post Downstream Request
6969
^^^^^^^^^^^^^^^^^^^^^^^
7070

71-
Add the following to a ReRoute in ocelot.json in order to replace http://www.bbc.co.uk/ with http://ocelot.com/. This transformation will take place after Ocelot has received the response from the downstream service.
71+
Add the following to a Route in ocelot.json in order to replace http://www.bbc.co.uk/ with http://ocelot.com/. This transformation will take place after Ocelot has received the response from the downstream service.
7272

7373
.. code-block:: json
7474

docs/features/kubernetes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ You can replicate a Permissive. Using RBAC role bindings.
3030
.. code-block::bash
3131
kubectl create clusterrolebinding permissive-binding --clusterrole=cluster-admin --user=admin --user=kubelet --group=system:serviceaccounts
3232

33-
The following example shows how to set up a ReRoute that will work in kubernetes. The most important thing is the ServiceName which is made up of the kubernetes service name. We also need to set up the ServiceDiscoveryProvider in GlobalConfiguration. The example here shows a typical configuration.
33+
The following example shows how to set up a Route that will work in kubernetes. The most important thing is the ServiceName which is made up of the kubernetes service name. We also need to set up the ServiceDiscoveryProvider in GlobalConfiguration. The example here shows a typical configuration.
3434

3535

3636
.. code-block:: json
3737
3838
{
39-
"ReRoutes": [
39+
"Routes": [
4040
{
4141
"DownstreamPathTemplate": "/api/values",
4242
"DownstreamScheme": "http",
@@ -76,13 +76,13 @@ The polling interval is in milliseconds and tells Ocelot how often to call kuber
7676

7777
Please note there are tradeoffs here. If you poll kubernetes it is possible Ocelot will not know if a service is down depending on your polling interval and you might get more errors than if you get the latest services per request. This really depends on how volatile your services are. I doubt it will matter for most people and polling may give a tiny performance improvement over calling kubernetes per request. There is no way for Ocelot to work these out for you.
7878

79-
If your downstream service resides in a different namespace you can override the global setting at the ReRoute level by specifying a ServiceNamespace.
79+
If your downstream service resides in a different namespace you can override the global setting at the Route level by specifying a ServiceNamespace.
8080

8181

8282
.. code-block:: json
8383
8484
{
85-
"ReRoutes": [
85+
"Routes": [
8686
{
8787
"DownstreamPathTemplate": "/api/values",
8888
"DownstreamScheme": "http",

0 commit comments

Comments
 (0)