istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/config/xds/deprecated.go (about)

     1  // Copyright Istio Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package xds
    16  
    17  import "istio.io/istio/pkg/wellknown"
    18  
    19  var (
    20  	// DeprecatedFilterNames is to support both canonical filter names
    21  	// and deprecated filter names for backward compatibility. Istiod
    22  	// generates canonical filter names.
    23  	DeprecatedFilterNames = map[string]string{
    24  		wellknown.Buffer:                      "envoy.buffer",
    25  		wellknown.CORS:                        "envoy.cors",
    26  		"envoy.filters.http.csrf":             "envoy.csrf",
    27  		wellknown.Dynamo:                      "envoy.http_dynamo_filter",
    28  		wellknown.HTTPExternalAuthorization:   "envoy.ext_authz",
    29  		wellknown.Fault:                       "envoy.fault",
    30  		wellknown.GRPCHTTP1Bridge:             "envoy.grpc_http1_bridge",
    31  		wellknown.GRPCJSONTranscoder:          "envoy.grpc_json_transcoder",
    32  		wellknown.GRPCWeb:                     "envoy.grpc_web",
    33  		wellknown.Gzip:                        "envoy.gzip",
    34  		wellknown.HealthCheck:                 "envoy.health_check",
    35  		wellknown.IPTagging:                   "envoy.ip_tagging",
    36  		wellknown.Lua:                         "envoy.lua",
    37  		wellknown.HTTPRateLimit:               "envoy.rate_limit",
    38  		wellknown.Router:                      "envoy.router",
    39  		wellknown.Squash:                      "envoy.squash",
    40  		wellknown.HTTPInspector:               "envoy.listener.http_inspector",
    41  		wellknown.OriginalDestination:         "envoy.listener.original_dst",
    42  		"envoy.filters.listener.original_src": "envoy.listener.original_src",
    43  		wellknown.ProxyProtocol:               "envoy.listener.proxy_protocol",
    44  		wellknown.TLSInspector:                "envoy.listener.tls_inspector",
    45  		wellknown.ClientSSLAuth:               "envoy.client_ssl_auth",
    46  		wellknown.ExternalAuthorization:       "envoy.ext_authz",
    47  		wellknown.HTTPConnectionManager:       "envoy.http_connection_manager",
    48  		wellknown.MongoProxy:                  "envoy.mongo_proxy",
    49  		wellknown.RateLimit:                   "envoy.ratelimit",
    50  		wellknown.RedisProxy:                  "envoy.redis_proxy",
    51  		wellknown.TCPProxy:                    "envoy.tcp_proxy",
    52  	}
    53  
    54  	ReverseDeprecatedFilterNames = reverse(DeprecatedFilterNames)
    55  )
    56  
    57  func reverse(names map[string]string) map[string]string {
    58  	resp := make(map[string]string, len(names))
    59  	for k, v := range names {
    60  		resp[v] = k
    61  	}
    62  	return resp
    63  }