# An example config to validate JWTs issued by Firebase.
admin:
  address:
    socket_address:
      address: 0.0.0.0
      port_value: 9901
static_resources:
  listeners:
  - name: listener_0
    address:
      socket_address:
        protocol: TCP
        address: 0.0.0.0
        port_value: 10000
    filter_chains:
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"
          stat_prefix: ingress_http
          route_config:
            name: local_route
            virtual_hosts:
            - name: default
              domains:
              - "*"
              routes:
              - match:
                  prefix: "/"
                direct_response:
                  status: 200
                  body:
                    inline_string: "OK"
          http_filters:
          - name: envoy.extensions.filters.http.jwt_authn
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.JwtAuthentication
              providers:
                provider_name1:
                  issuer: https://example.com
                  from_headers:
                  - name: x-jwt-header
                    value_prefix: jwt_value
                  audiences:
                  - bookstore_android.apps.googleusercontent.com
                  - bookstore_web.apps.googleusercontent.com
                  remote_jwks:
                    http_uri:
                      uri: https://example.com/jwks.json
                      cluster: example_jwks_cluster
                      timeout: 1s
                    cache_duration: 300s
          - name: envoy.filters.http.router
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router

  clusters:
  - name: example_jwks_cluster
    type: STRICT_DNS
    lb_policy: ROUND_ROBIN
    load_assignment:
      cluster_name: example_jwks_cluster
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: example_jwks_cluster.example.com
                port_value: 443
    transport_socket:
      name: envoy.transport_sockets.tls
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
        sni: example_jwks_cluster.example.com
