You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: toc/rfc/rfc-draft-generic-per-route-features.md
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,22 +10,21 @@
10
10
11
11
## Problem
12
12
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.
17
16
18
17
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).
21
20
22
21
## Proposal
23
22
24
23
To reduce the overall overhead of implementing new per-route features we propose to add a generic
25
24
key-value map to the definition of a route across all components. All components handling the map
26
25
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.
29
28
30
29
The following constraints apply (types are as specified in [RFC 8259](https://rfc-editor.org/rfc/rfc8259)):
31
30
* The map MUST be representable as an object.
@@ -41,11 +40,11 @@ pairs for the `map-route` sub-command.
41
40
42
41
#### Cloud Controller
43
42
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
46
45
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.
49
48
50
49
Support for a generic map MUST be added to the manifest. The updated routes section in a manifest
51
50
MAY look like this:
@@ -78,25 +77,24 @@ error.
78
77
79
78
### Route-Registrar
80
79
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.
83
81
84
82
#### Gorouter
85
83
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.
92
90
93
91
It MAY be decided to implement one feature as part of this RFC which would be implemented together
94
92
with the generic logic for supporting the new map.
95
93
96
94
As new features are specified they MUST be implemented in gorouter.
97
95
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):
100
98
101
99
```json
102
100
{
@@ -131,10 +129,10 @@ To-Do:
131
129
132
130
### Specifying Features
133
131
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.
138
136
139
137
### Features Which Could be Implemented
140
138
@@ -144,11 +142,13 @@ per-route features:
144
142
- Custom Load-Balancing Algorithm
145
143
- Custom Connection Limits
146
144
- 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)
148
148
149
149
To-Do:
150
150
* Collect more feedback and extend the list.
151
151
152
152
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