static_resources:
  listeners:
  - address:
      socket_address:
        address: 0.0.0.0
        port_value: 8000
    filter_chains:
    - filters:
      - name: "http"
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          codec_type: HTTP2
          stat_prefix: "config_test"
          route_config:
            name: "route_config_0"
            virtual_hosts:
            - name: "integration"
              domains: ["*"]
              routes:
              - match:
                  prefix: "/"
                route:
                  cluster: "cluster_0"
          http_filters:
          - name: "envoy.filters.http.gcp_authn"
            typed_config:
              "@type": type.googleapis.com/net.envoy.source.extensions.filters.http.metadata.GcpAuthnFilterConfig
            http_uri:
              uri: "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=[AUDIENCE]"
              cluster: "gcp_authn"
              timeout:
                seconds: 10
          http_filters:
          - name: envoy.filters.http.router
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
  clusters:
  - name: cluster_0
    # Cluster for fake destination service which has typed metadata that contains the audience information.
    load_assignment:
      cluster_name: cluster_0
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 0.0.0.0
                port_value: 8000
    typed_extension_protocol_options:
      envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
        "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
        explicit_http_config:
          http2_protocol_options:
            {}
    metadata:
      typed_filter_metadata:
        envoy.filters.http.gcp_authn:
          "@type": type.googleapis.com/envoy.extensions.filters.http.gcp_authn.v3.Audience
          url: http://test.com
  # Cluster for GCE metadata server
  - name: gcp_authn
    type: STRICT_DNS
    connect_timeout: 5s
    dns_lookup_family: V4_ONLY
    load_assignment:
      cluster_name: "gcp_authn"
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: "metadata.google.internal"
                port_value: 80

