envoy icon indicating copy to clipboard operation
envoy copied to clipboard

uhv: header validators for H1 and H2 codecs

Open ameily opened this issue 3 years ago • 26 comments

Commit Message: uhv: header validators for H1 and H2 codecs Additional Description: This PR builds off the foundation laid in #21974 to add validators for H1 and H2. H3 and path normalization are intentionally out of scope for this PR and will be completed later. Risk Level: Low Testing: Build Envoy with --define uhv=enabled, configure a service with UHV enabled, and then test a valid and invalid request.

# config.yml, in the HCM section
typed_header_validation_config:
  name: envoy.http.header_validators.envoy_default
  typed_config:
      "@type": type.googleapis.com/envoy.extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig
      #
      # UHV configuration
      # uncomment any of the following:
      #
      # restrict_http_methods: true
      # reject_headers_with_underscores: true
      # http1_protocol_options: {allow_chunked_length: true}
      #

# run tests
# valid request
http GET http://localhost:10000 X-Valid:ok
# invalid request
http GET http://localhost:10000 "X Invalid":bad

Fixes #19753 Docs Changes: Release Notes: Platform Specific Features:

ameily avatar Aug 03 '22 12:08 ameily

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/). envoyproxy/api-shepherds assignee is @markdroth CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

:cat:

Caused by: https://github.com/envoyproxy/envoy/pull/22537 was opened by ameily.

see: more, trace.

/wait on CI

alyssawilk avatar Aug 03 '22 18:08 alyssawilk

@alyssawilk Can you rerun the failed CI job? CI is passing for me locally and I think the current failure is because a package couldn't be downloaded.

ameily avatar Aug 05 '22 15:08 ameily

you should be able to yourself with /retest

alyssawilk avatar Aug 08 '22 13:08 alyssawilk

Retrying Azure Pipelines: Retried failed jobs in: envoy-presubmit

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/22537#issuecomment-1208165595 was created by @alyssawilk.

see: more, trace.

/assign-from @envoyproxy/api-shepherds

kyessenov avatar Aug 08 '22 18:08 kyessenov

@envoyproxy/api-shepherds assignee is @markdroth

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/22537#issuecomment-1208492167 was created by @kyessenov.

see: more, trace.

@yanavlasov @adisuissa this looks ready for another round of review.

jmarantz avatar Aug 17 '22 13:08 jmarantz

Looks good. A couple more comments I missed last time.

/wait

yanavlasov avatar Aug 17 '22 15:08 yanavlasov

Amazing work here!

high level question: are we hooking these up to see where there are going to be behavioral differences? I feel like if we had this turned on for e2e a bunch of Yan and my comments would be obsoleted by test failures :-)

Yes, I think I can do PR that enables the default UHV based on the build flag. We can then merge that PR here and see the results.

yanavlasov avatar Aug 26 '22 13:08 yanavlasov

/wait for Yan's toggle patch

wrowe avatar Aug 26 '22 18:08 wrowe

/wait

yanavlasov avatar Aug 26 '22 18:08 yanavlasov

/retest

yanavlasov avatar Sep 09 '22 17:09 yanavlasov

Retrying Azure Pipelines: Retried failed jobs in: envoy-presubmit

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/22537#issuecomment-1242239706 was created by @yanavlasov.

see: more, trace.

/retest

alyssawilk avatar Sep 12 '22 12:09 alyssawilk

Retrying Azure Pipelines: Retried failed jobs in: envoy-presubmit

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/22537#issuecomment-1243688529 was created by @alyssawilk.

see: more, trace.

Looks like CI is still unhappy?

alyssawilk avatar Sep 13 '22 12:09 alyssawilk

/retest

ameily avatar Sep 13 '22 12:09 ameily

Retrying Azure Pipelines: Retried failed jobs in: envoy-presubmit

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/22537#issuecomment-1245354496 was created by @ameily.

see: more, trace.

/retest

yanavlasov avatar Sep 13 '22 15:09 yanavlasov

Retrying Azure Pipelines: Retried failed jobs in: envoy-presubmit

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/22537#issuecomment-1245572951 was created by @yanavlasov.

see: more, trace.

/retest

yanavlasov avatar Sep 13 '22 16:09 yanavlasov

Retrying Azure Pipelines: Retried failed jobs in: envoy-presubmit

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/22537#issuecomment-1245623670 was created by @yanavlasov.

see: more, trace.

/retest

ameily avatar Sep 16 '22 15:09 ameily

Retrying Azure Pipelines: Retried failed jobs in: envoy-presubmit

:cat:

Caused by: a https://github.com/envoyproxy/envoy/pull/22537#issuecomment-1249479073 was created by @ameily.

see: more, trace.

@lizan could you give this an API stamp for the docs update?

wrowe avatar Sep 19 '22 17:09 wrowe

@envoyproxy/api-shepherds - This optional validator (default, not enabled) has been approved by Yan, but who is willing to review this for an api stamp of approval?

wrowe avatar Oct 06 '22 15:10 wrowe

I'm submitting this PR so we can proceed with follow-up work. If you have any more comments, please open Issues.

yanavlasov avatar Oct 06 '22 16:10 yanavlasov

Looks like all comments were addressed. If we missed anything, please file an Issue and we will address in a followup PR.

yanavlasov avatar Oct 11 '22 20:10 yanavlasov