mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 08:50:42 +02:00
config: add support for http3 advertise port (#5466)
This commit is contained in:
parent
2754d20a2d
commit
1e9a09269b
9 changed files with 309 additions and 219 deletions
59
config/envoyconfig/quic_test.go
Normal file
59
config/envoyconfig/quic_test.go
Normal file
|
@ -0,0 +1,59 @@
|
|||
package envoyconfig
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
envoy_config_common_mutation_rules_v3 "github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3"
|
||||
envoy_config_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
|
||||
envoy_extensions_filters_http_header_mutation_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/header_mutation/v3"
|
||||
"github.com/volatiletech/null/v9"
|
||||
|
||||
"github.com/pomerium/pomerium/config"
|
||||
"github.com/pomerium/pomerium/internal/testutil"
|
||||
)
|
||||
|
||||
func Test_newQUICAltSvcHeaderFilter(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testutil.AssertProtoEqual(t,
|
||||
HTTPHeaderMutationsFilter(&envoy_extensions_filters_http_header_mutation_v3.HeaderMutation{
|
||||
Mutations: &envoy_extensions_filters_http_header_mutation_v3.Mutations{
|
||||
ResponseMutations: []*envoy_config_common_mutation_rules_v3.HeaderMutation{{
|
||||
Action: &envoy_config_common_mutation_rules_v3.HeaderMutation_Append{
|
||||
Append: &envoy_config_core_v3.HeaderValueOption{
|
||||
Header: &envoy_config_core_v3.HeaderValue{
|
||||
Key: "alt-svc",
|
||||
Value: `h3=":443"; ma=86400`,
|
||||
},
|
||||
},
|
||||
},
|
||||
}},
|
||||
},
|
||||
}),
|
||||
newQUICAltSvcHeaderFilter(&config.Config{
|
||||
Options: &config.Options{
|
||||
Addr: ":443",
|
||||
},
|
||||
}))
|
||||
testutil.AssertProtoEqual(t,
|
||||
HTTPHeaderMutationsFilter(&envoy_extensions_filters_http_header_mutation_v3.HeaderMutation{
|
||||
Mutations: &envoy_extensions_filters_http_header_mutation_v3.Mutations{
|
||||
ResponseMutations: []*envoy_config_common_mutation_rules_v3.HeaderMutation{{
|
||||
Action: &envoy_config_common_mutation_rules_v3.HeaderMutation_Append{
|
||||
Append: &envoy_config_core_v3.HeaderValueOption{
|
||||
Header: &envoy_config_core_v3.HeaderValue{
|
||||
Key: "alt-svc",
|
||||
Value: `h3=":443"; ma=86400`,
|
||||
},
|
||||
},
|
||||
},
|
||||
}},
|
||||
},
|
||||
}),
|
||||
newQUICAltSvcHeaderFilter(&config.Config{
|
||||
Options: &config.Options{
|
||||
Addr: ":8443",
|
||||
HTTP3AdvertisePort: null.Uint32From(443),
|
||||
},
|
||||
}))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue