solo-io / gloo

The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy
https://docs.solo.io/
Apache License 2.0
4.09k stars 442 forks source link

RouteTable Schema not validating RouteAction correctly #6479

Open kevin-shelaga opened 2 years ago

kevin-shelaga commented 2 years ago

Gloo Edge Version

1.9.x

Kubernetes Version

1.22.x

Describe the bug

invalid config is accepted by gloo

Steps to reproduce the bug

gloo.gateway.validation.alwaysAcceptResources=false

      routeAction:
        options:
          headerManipulation:
            responseHeadersToAdd:
              - header:
                  key: Set-Cookie
                  value: >-
                    propProtectDevCap=stable; max-age=300; Domain=.usaa.com;
                    Path=/; Secure; HttpOnly; SameSite=None

Expected Behavior

Schema rejects invalid config

Additional Context

Customer convo: https://solo-io-corp.slack.com/archives/CV592S7HD/p1652799372319069

kevin-shelaga commented 2 years ago

https://github.com/solo-io/gloo/issues/2797

zf-roose commented 2 years ago

Similar to this is eg a mistake by our devs recently, like a missing patch specifier:

    - matchers:
      - methods:
        - POST
      - regex: /v1/alarms
      name: alarm1
      options:

where the first matcher does not include any regex/prefix/exact field

Here the regex should not have been a new matcher but part of the first matcher in the list.

github-actions[bot] commented 5 months ago

This issue has been marked as stale because of no activity in the last 180 days. It will be closed in the next 180 days unless it is tagged "no stalebot" or other activity occurs.