mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-24 03:59:49 +02:00
config: remove source, remove deadcode, fix linting issues (#4118)
* remove source, remove deadcode, fix linting issues * use github action for lint * fix missing envoy
This commit is contained in:
parent
34c1e44c7e
commit
bbed421cd8
122 changed files with 438 additions and 998 deletions
|
@ -198,7 +198,12 @@ func (b *Builder) buildPolicyRoutes(
|
|||
|
||||
for i, p := range options.GetAllPolicies() {
|
||||
policy := p
|
||||
if !urlMatchesHost(policy.Source.URL, host) {
|
||||
fromURL, err := urlutil.ParseAndValidateURL(policy.From)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !urlMatchesHost(fromURL, host) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -335,7 +340,8 @@ func (b *Builder) buildPolicyRouteRouteAction(options *config.Options, policy *c
|
|||
Enabled: &wrappers.BoolValue{Value: policy.AllowSPDY},
|
||||
},
|
||||
}
|
||||
if urlutil.IsTCP(policy.Source.URL) {
|
||||
|
||||
if policy.IsTCP() {
|
||||
upgradeConfigs = append(upgradeConfigs, &envoy_config_route_v3.RouteAction_UpgradeConfig{
|
||||
UpgradeType: "CONNECT",
|
||||
Enabled: &wrappers.BoolValue{Value: true},
|
||||
|
@ -407,7 +413,7 @@ func toEnvoyHeaders(headers map[string]string) []*envoy_config_core_v3.HeaderVal
|
|||
func mkRouteMatch(policy *config.Policy) *envoy_config_route_v3.RouteMatch {
|
||||
match := &envoy_config_route_v3.RouteMatch{}
|
||||
switch {
|
||||
case urlutil.IsTCP(policy.Source.URL):
|
||||
case policy.IsTCP():
|
||||
match.PathSpecifier = &envoy_config_route_v3.RouteMatch_ConnectMatcher_{
|
||||
ConnectMatcher: &envoy_config_route_v3.RouteMatch_ConnectMatcher{},
|
||||
}
|
||||
|
@ -473,7 +479,7 @@ func getRouteIdleTimeout(policy *config.Policy) *durationpb.Duration {
|
|||
|
||||
func shouldDisableStreamIdleTimeout(policy *config.Policy) bool {
|
||||
return policy.AllowWebsockets ||
|
||||
urlutil.IsTCP(policy.Source.URL) ||
|
||||
policy.IsTCP() ||
|
||||
policy.IsForKubernetes() // disable for kubernetes so that tailing logs works (#2182)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue