istio: istio.io/istio/pilot/pkg/xds/filters Index | Files

package filters

import "istio.io/istio/pilot/pkg/xds/filters"

Index

Package Files

filters.go

Constants

const (
    OriginalSrcFilterName = "envoy.filters.listener.original_src"
    // Alpn HTTP filter name which will override the ALPN for upstream TLS connection.
    AlpnFilterName = "istio.alpn"

    TLSTransportProtocol       = "tls"
    RawBufferTransportProtocol = "raw_buffer"

    MxFilterName = "istio.metadata_exchange"
)

Variables

var (
    Cors = &hcm.HttpFilter{
        Name: wellknown.CORS,
        ConfigType: &hcm.HttpFilter_TypedConfig{
            TypedConfig: util.MessageToAny(&cors.Cors{}),
        },
    }
    Fault = &hcm.HttpFilter{
        Name: wellknown.Fault,
        ConfigType: &hcm.HttpFilter_TypedConfig{
            TypedConfig: util.MessageToAny(&fault.HTTPFault{}),
        },
    }
    Router = &hcm.HttpFilter{
        Name: wellknown.Router,
        ConfigType: &hcm.HttpFilter_TypedConfig{
            TypedConfig: util.MessageToAny(&router.Router{}),
        },
    }
    GrpcWeb = &hcm.HttpFilter{
        Name: wellknown.GRPCWeb,
        ConfigType: &hcm.HttpFilter_TypedConfig{
            TypedConfig: util.MessageToAny(&grpcweb.GrpcWeb{}),
        },
    }
    GrpcStats = &hcm.HttpFilter{
        Name: wellknown.HTTPGRPCStats,
        ConfigType: &hcm.HttpFilter_TypedConfig{
            TypedConfig: util.MessageToAny(&grpcstats.FilterConfig{
                EmitFilterState: true,
                PerMethodStatSpecifier: &grpcstats.FilterConfig_StatsForAllMethods{
                    StatsForAllMethods: &wrapperspb.BoolValue{Value: false},
                },
            }),
        },
    }
    TLSInspector = &listener.ListenerFilter{
        Name: wellknown.TlsInspector,
        ConfigType: &listener.ListenerFilter_TypedConfig{
            TypedConfig: util.MessageToAny(&tlsinspector.TlsInspector{}),
        },
    }
    HTTPInspector = &listener.ListenerFilter{
        Name: wellknown.HttpInspector,
        ConfigType: &listener.ListenerFilter_TypedConfig{
            TypedConfig: util.MessageToAny(&httpinspector.HttpInspector{}),
        },
    }
    OriginalDestination = &listener.ListenerFilter{
        Name: wellknown.OriginalDestination,
        ConfigType: &listener.ListenerFilter_TypedConfig{
            TypedConfig: util.MessageToAny(&originaldst.OriginalDst{}),
        },
    }
    OriginalSrc = &listener.ListenerFilter{
        Name: OriginalSrcFilterName,
        ConfigType: &listener.ListenerFilter_TypedConfig{
            TypedConfig: util.MessageToAny(&originalsrc.OriginalSrc{
                Mark: 1337,
            }),
        },
    }
    Alpn = &hcm.HttpFilter{
        Name: AlpnFilterName,
        ConfigType: &hcm.HttpFilter_TypedConfig{
            TypedConfig: util.MessageToAny(&alpn.FilterConfig{
                AlpnOverride: []*alpn.FilterConfig_AlpnOverride{
                    {
                        UpstreamProtocol: alpn.FilterConfig_HTTP10,
                        AlpnOverride:     mtlsHTTP10ALPN,
                    },
                    {
                        UpstreamProtocol: alpn.FilterConfig_HTTP11,
                        AlpnOverride:     mtlsHTTP11ALPN,
                    },
                    {
                        UpstreamProtocol: alpn.FilterConfig_HTTP2,
                        AlpnOverride:     mtlsHTTP2ALPN,
                    },
                },
            }),
        },
    }

    TCPMx = &listener.Filter{
        Name: MxFilterName,

        ConfigType: &listener.Filter_TypedConfig{TypedConfig: util.MessageToAny(&udpa.TypedStruct{
            TypeUrl: "type.googleapis.com/envoy.tcp.metadataexchange.config.MetadataExchange",
            Value: &structpb.Struct{
                Fields: map[string]*structpb.Value{
                    "protocol": {
                        Kind: &structpb.Value_StringValue{StringValue: "istio-peer-exchange"},
                    }},
            },
        })},
    }

    HTTPMx = buildHTTPMxFilter()
)

Define static filters to be reused across the codebase. This avoids duplicate marshaling/unmarshaling This should not be used for filters that will be mutated

Package filters imports 23 packages (graph) and is imported by 8 packages. Updated 2020-12-31. Refresh now. Tools for package owners.