Skip to content

Commit

Permalink
Add response_header_modifier outbound http filter (#251)
Browse files Browse the repository at this point in the history
The `responseHeaderModifier` filter is an Extended level feature:

https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io%2fv1beta1.HTTPRouteFilter

We add this filter to the outbound proxy-api.

Signed-off-by: Alex Leong <[email protected]>
  • Loading branch information
adleong authored Jul 5, 2023
1 parent 07f41de commit f1598b4
Show file tree
Hide file tree
Showing 6 changed files with 594 additions and 431 deletions.
263 changes: 180 additions & 83 deletions go/http_route/http_route.pb.go

Large diffs are not rendered by default.

718 changes: 371 additions & 347 deletions go/outbound/outbound.pb.go

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions proto/http_route.proto
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,24 @@ message RequestHeaderModifier {
repeated string remove = 3;
}

// Configures a route to modify a response's headers.
//
// Modifications are to be applied in the order they are described here:
// additions apply first, then sets, and then removals.
message ResponseHeaderModifier {
// A list of headers name-value pairs to set on responses, augmenting any
// existing values for the header.
io.linkerd.proxy.http_types.Headers add = 1;

// A list of headers name-value pairs to set on responses, replacing any
// existing values for the header.
io.linkerd.proxy.http_types.Headers set = 2;

// A list of headers names to be removed from responses.
repeated string remove = 3;
}


// Configures a route to respond with a redirect response. The `location` header
// is set with the given URL parameters.
message RequestRedirect {
Expand Down
1 change: 1 addition & 0 deletions proto/outbound.proto
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ message HttpRoute {
io.linkerd.proxy.http_route.HttpFailureInjector failure_injector = 1;
io.linkerd.proxy.http_route.RequestHeaderModifier request_header_modifier = 2;
io.linkerd.proxy.http_route.RequestRedirect redirect = 3;
io.linkerd.proxy.http_route.ResponseHeaderModifier response_header_modifier = 4;
}
}

Expand Down
19 changes: 19 additions & 0 deletions src/gen/io.linkerd.proxy.http_route.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/gen/io.linkerd.proxy.outbound.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f1598b4

Please sign in to comment.