Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CORS ir and xds translation #2016

Merged
merged 2 commits into from
Oct 22, 2023
Merged

Conversation

zhaohuabing
Copy link
Member

@zhaohuabing zhaohuabing commented Oct 19, 2023

This PR does the following:

  • Adds ir and xds translation for CORS.
    The CORS will be part of the SecurityPolicy API. The API and translation to ir will be included in a subsequent PR after the SecurityPolicy PR has been completed.

  • Sorts the HTTP filter in a rational order after patching all filters to the HCM filter chain, so each individual filter translator doesn't have to care about its own order anymore.

Relates to #567

@zhaohuabing zhaohuabing requested a review from a team as a code owner October 19, 2023 08:16
@zhaohuabing zhaohuabing marked this pull request as draft October 19, 2023 08:16
@zhaohuabing zhaohuabing force-pushed the xds-ir-cors branch 2 times, most recently from 57e53c5 to 40e41fe Compare October 19, 2023 09:12
@zhaohuabing zhaohuabing marked this pull request as ready for review October 19, 2023 09:12
@zhaohuabing zhaohuabing requested a review from arkodg October 19, 2023 09:13
@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #2016 (fa3b523) into main (c59ced0) will increase coverage by 0.03%.
The diff coverage is 55.92%.

@@            Coverage Diff             @@
##             main    #2016      +/-   ##
==========================================
+ Coverage   65.33%   65.36%   +0.03%     
==========================================
  Files          93       95       +2     
  Lines       13727    13929     +202     
==========================================
+ Hits         8968     9105     +137     
- Misses       4205     4259      +54     
- Partials      554      565      +11     
Files Coverage Δ
internal/ir/xds.go 74.10% <ø> (ø)
internal/xds/translator/listener.go 82.64% <0.00%> (-0.22%) ⬇️
internal/xds/translator/route.go 92.14% <0.00%> (+0.97%) ⬆️
internal/xds/translator/httpfilters.go 78.26% <78.26%> (ø)
internal/xds/translator/cors.go 65.97% <65.97%> (ø)
internal/ir/zz_generated.deepcopy.go 11.97% <0.00%> (-0.56%) ⬇️

... and 2 files with indirect coverage changes

@zhaohuabing zhaohuabing force-pushed the xds-ir-cors branch 2 times, most recently from 2466e33 to 51517c5 Compare October 19, 2023 13:46
@zhaohuabing zhaohuabing marked this pull request as draft October 19, 2023 14:28
internal/ir/xds.go Outdated Show resolved Hide resolved
internal/ir/xds.go Outdated Show resolved Hide resolved
internal/ir/xds.go Outdated Show resolved Hide resolved
@arkodg
Copy link
Contributor

arkodg commented Oct 19, 2023

thanks for picking this one up @zhaohuabing, added some minor comments

@zhaohuabing zhaohuabing marked this pull request as ready for review October 20, 2023 01:22
@zhaohuabing zhaohuabing force-pushed the xds-ir-cors branch 4 times, most recently from 0bdc33d to 1d7f30f Compare October 20, 2023 03:24
@zhaohuabing zhaohuabing requested a review from arkodg October 20, 2023 03:25
@zhaohuabing zhaohuabing requested review from a team, kflynn, Alice-Lilith and Xunzhuo and removed request for a team October 20, 2023 04:18
@zhaohuabing zhaohuabing requested a review from a team October 20, 2023 04:18
internal/ir/xds.go Outdated Show resolved Hide resolved
internal/ir/xds.go Outdated Show resolved Hide resolved
@zhaohuabing zhaohuabing force-pushed the xds-ir-cors branch 2 times, most recently from 596400e to b8fc9d7 Compare October 21, 2023 12:03
@zhaohuabing zhaohuabing requested a review from arkodg October 21, 2023 12:03
Signed-off-by: huabing zhao <[email protected]>

sort HTTP filters

Signed-off-by: huabing zhao <[email protected]>

address comments

Signed-off-by: huabing zhao <[email protected]>

refactor route filter config

Signed-off-by: huabing zhao <[email protected]>

address comments

Signed-off-by: huabing zhao <[email protected]>
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm thanks !

@arkodg arkodg merged commit c1d03de into envoyproxy:main Oct 22, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants