Skip to content

Commit 039db8f

Browse files
committed
rfc: reflow document
1 parent d0d4029 commit 039db8f

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

toc/rfc/rfc-draft-generic-per-route-features.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,21 @@
1010

1111
## Problem
1212

13-
Implementing per-route features in Cloud Foundry is a tedious process because it requires
14-
changes to multiple components in multiple working groups. Most components will only need to be
15-
made aware of new fields without adding any significant logic but the overhead of making the
16-
change still exists.
13+
Implementing per-route features in Cloud Foundry is a tedious process because it requires changes to
14+
multiple components in multiple working groups. Most components will only need to be made aware of
15+
new fields without adding any significant logic but the overhead of making the change still exists.
1716

1817
On the other side are the components that actually need to be aware of the change. Mostly the
19-
routing components (gorouter, maybe route-emitter / -registrar), the API (cloud controller)
20-
and UIs (CLI).
18+
routing components (gorouter, maybe route-emitter / -registrar), the API (cloud controller) and
19+
UIs (CLI).
2120

2221
## Proposal
2322

2423
To reduce the overall overhead of implementing new per-route features we propose to add a generic
2524
key-value map to the definition of a route across all components. All components handling the map
2625
SHOULD ignore the contents of the map except gorouter, cloud controller and cf CLI which MUST handle
27-
the map and its values accordingly. Other components MAY limit the size of the map or size of
28-
keys / values for technical reasons.
26+
the map and its values accordingly. Other components MAY limit the size of the map or size of keys /
27+
values for technical reasons.
2928

3029
The following constraints apply (types are as specified in [RFC 8259](https://rfc-editor.org/rfc/rfc8259)):
3130
* The map MUST be representable as an object.
@@ -41,11 +40,11 @@ pairs for the `map-route` sub-command.
4140

4241
#### Cloud Controller
4342

44-
The API MUST specify and implement a new field to carry the map inside the route object. The API
45-
MUST implement per-field validations as features of the map are specified. The route MUST be
43+
The API MUST specify and implement a new field to carry the map inside the route object. The
44+
API MUST implement per-field validations as features of the map are specified. The route MUST be
4645
rejected with an appropriate error message if the provided map is invalid and MUST be passed on
47-
as-is otherwise. The API also MUST store the map as a generic key-value map to ensure changes to
48-
the map do not require a change to the database schema.
46+
as-is otherwise. The API also MUST store the map as a generic key-value map to ensure changes to the
47+
map do not require a change to the database schema.
4948

5049
Support for a generic map MUST be added to the manifest. The updated routes section in a manifest
5150
MAY look like this:
@@ -78,25 +77,24 @@ error.
7877
7978
### Route-Registrar
8079
81-
Route-registrar MUST offer the new features in its config as they are added to the other
82-
components.
80+
Route-registrar MUST offer the new features in its config as they are added to the other components.
8381
8482
#### Gorouter
8583
86-
Gorouter MUST accept the new field and parse its contents. If the map cannot be parsed it MUST
87-
be ignored. If individual key-value pairs are invalid those MUST be ignored and other key-value
88-
pairs MUST still be parsed and acted upon. For any option which could not be parsed gorouter MUST
89-
NOT fail but fall back to the value provided in the gorouter config. When encountering an invalid
90-
option gorouter MUST log the error at least once, the log SHOULD indicate what it tried to parse,
91-
why it failed and which value will come into effect.
84+
Gorouter MUST accept the new field and parse its contents. If the map cannot be parsed it MUST be
85+
ignored. If individual key-value pairs are invalid those MUST be ignored and other key-value pairs
86+
MUST still be parsed and acted upon. For any option which could not be parsed gorouter MUST NOT
87+
fail but fall back to the value provided in the gorouter config. When encountering an invalid option
88+
gorouter MUST log the error at least once, the log SHOULD indicate what it tried to parse, why it
89+
failed and which value will come into effect.
9290
9391
It MAY be decided to implement one feature as part of this RFC which would be implemented together
9492
with the generic logic for supporting the new map.
9593
9694
As new features are specified they MUST be implemented in gorouter.
9795
98-
Example `router.register` NATS message containing additional options (field names and values are not
99-
final):
96+
Example `router.register` NATS message containing additional options (field names and values are
97+
not final):
10098

10199
```json
102100
{
@@ -131,10 +129,10 @@ To-Do:
131129

132130
### Specifying Features
133131

134-
It's the responsibility of the App Runtime Platform Working Group (ARP-WG) to specify new
135-
features based on what is specified in this RFC. When a new feature is proposed the ARP-WG uses
136-
the process it would use for any new feature to decide whether and how it should be implemented. It
137-
MAY involve other working groups in the process.
132+
It's the responsibility of the App Runtime Platform Working Group (ARP-WG) to specify new features
133+
based on what is specified in this RFC. When a new feature is proposed the ARP-WG uses the process
134+
it would use for any new feature to decide whether and how it should be implemented. It MAY involve
135+
other working groups in the process.
138136

139137
### Features Which Could be Implemented
140138

@@ -144,11 +142,13 @@ per-route features:
144142
- Custom Load-Balancing Algorithm
145143
- Custom Connection Limits
146144
- Custom session cookie name (currently set on platform level, mostly to `JSESSIONID`)
147-
- Option to trim path mapping on request (i.e. an app mapped to `/some-path/` receiving a request `GET /some-path/books` will see the request as `GET /books` if the `trim-path` option is set, instead of the full path)
145+
- Option to trim path mapping on request (i.e. an app mapped to `/some-path/` receiving a request
146+
`GET /some-path/books` will see the request as `GET /books` if the `trim-path` option is set,
147+
instead of the full path)
148148

149149
To-Do:
150150
* Collect more feedback and extend the list.
151151

152152
All of these options are already (or could easily be made) configurable for the entire CF
153-
installation. Changing them will almost certainly break existing scenarios which is why we
154-
are looking for a cheap way to gradually allow for more configuration per route.
153+
installation. Changing them will almost certainly break existing scenarios which is why we are
154+
looking for a cheap way to gradually allow for more configuration per route.

0 commit comments

Comments
 (0)