mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-05 20:32:57 +02:00
add rewrite_response_headers to protobuf (#1962)
This commit is contained in:
parent
7f6107051f
commit
46ae3cf358
3 changed files with 708 additions and 563 deletions
|
@ -249,6 +249,14 @@ func NewPolicyFromProto(pb *configpb.Route) (*Policy, error) {
|
||||||
p.EnvoyOpts.Name = pb.Name
|
p.EnvoyOpts.Name = pb.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, rwh := range pb.RewriteResponseHeaders {
|
||||||
|
p.RewriteResponseHeaders = append(p.RewriteResponseHeaders, RewriteHeader{
|
||||||
|
Header: rwh.GetHeader(),
|
||||||
|
Prefix: rwh.GetPrefix(),
|
||||||
|
Value: rwh.GetValue(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
for _, sp := range pb.GetPolicies() {
|
for _, sp := range pb.GetPolicies() {
|
||||||
p.SubPolicies = append(p.SubPolicies, SubPolicy{
|
p.SubPolicies = append(p.SubPolicies, SubPolicy{
|
||||||
ID: sp.GetId(),
|
ID: sp.GetId(),
|
||||||
|
@ -335,6 +343,16 @@ func (p *Policy) ToProto() (*configpb.Route, error) {
|
||||||
pb.LoadBalancingWeights = weights
|
pb.LoadBalancingWeights = weights
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, rwh := range p.RewriteResponseHeaders {
|
||||||
|
pb.RewriteResponseHeaders = append(pb.RewriteResponseHeaders, &configpb.RouteRewriteHeader{
|
||||||
|
Header: rwh.Header,
|
||||||
|
Matcher: &configpb.RouteRewriteHeader_Prefix{
|
||||||
|
Prefix: rwh.Prefix,
|
||||||
|
},
|
||||||
|
Value: rwh.Value,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return pb, nil
|
return pb, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -14,6 +14,12 @@ message Config {
|
||||||
Settings settings = 3;
|
Settings settings = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message RouteRewriteHeader {
|
||||||
|
string header = 1;
|
||||||
|
oneof matcher { string prefix = 3; }
|
||||||
|
string value = 2;
|
||||||
|
}
|
||||||
|
|
||||||
message RouteRedirect {
|
message RouteRedirect {
|
||||||
optional bool https_redirect = 1;
|
optional bool https_redirect = 1;
|
||||||
optional string scheme_redirect = 2;
|
optional string scheme_redirect = 2;
|
||||||
|
@ -74,6 +80,7 @@ message Route {
|
||||||
|
|
||||||
map<string, string> set_request_headers = 22;
|
map<string, string> set_request_headers = 22;
|
||||||
repeated string remove_request_headers = 23;
|
repeated string remove_request_headers = 23;
|
||||||
|
repeated RouteRewriteHeader rewrite_response_headers = 40;
|
||||||
|
|
||||||
bool preserve_host_header = 24;
|
bool preserve_host_header = 24;
|
||||||
bool pass_identity_headers = 25;
|
bool pass_identity_headers = 25;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue