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

Refactor webhook validation #510

Merged
merged 6 commits into from
Apr 4, 2023
Merged

Conversation

pleshakov
Copy link
Contributor

@pleshakov pleshakov commented Mar 27, 2023

Refactor Webhook validation code

@pleshakov pleshakov requested a review from a team as a code owner March 27, 2023 20:55
@github-actions github-actions bot added the chore Pull requests for routine tasks label Mar 27, 2023
@pleshakov pleshakov marked this pull request as draft March 27, 2023 20:56
internal/state/store.go Outdated Show resolved Hide resolved
@pleshakov pleshakov force-pushed the chore/refactor-webhook-validation branch 2 times, most recently from a381fed to 5aa8070 Compare March 28, 2023 22:46
Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

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

The approach looks good to me. Just a couple comments.

One other thing. Can we remove the type switch from propagateUpsert and propagateDelete in handler.go?

internal/state/change_processor.go Outdated Show resolved Hide resolved
internal/state/store.go Show resolved Hide resolved
- Move webhook validation code to the state package so that the package 
is responsible for enforcing it. As a result, it will not need require 
the users of that package to validate the supplied Gateway API
resources, which will make it easier to use the package and reduce
the number of possible bugs. Fixes
#416
- Fix Webhook Validation is bypassed for existing resources when NKG
starts. Fixes
#433
@pleshakov pleshakov force-pushed the chore/refactor-webhook-validation branch from 5aa8070 to 183ed5d Compare March 30, 2023 02:45
@pleshakov pleshakov marked this pull request as ready for review March 30, 2023 02:47
internal/state/change_processor.go Outdated Show resolved Hide resolved
internal/state/change_processor.go Outdated Show resolved Hide resolved
internal/state/change_processor_test.go Outdated Show resolved Hide resolved
internal/state/change_processor_test.go Outdated Show resolved Hide resolved
internal/state/graph/graph.go Show resolved Hide resolved
internal/state/graph/graph.go Outdated Show resolved Hide resolved
internal/state/graph/graph.go Outdated Show resolved Hide resolved
internal/state/store.go Show resolved Hide resolved
internal/state/store.go Outdated Show resolved Hide resolved
@pleshakov pleshakov merged commit d121ff1 into main Apr 4, 2023
@pleshakov pleshakov deleted the chore/refactor-webhook-validation branch April 4, 2023 21:49
@pleshakov pleshakov changed the title Chore/refactor webhook validation Refactor webhook validation Apr 19, 2023
@pleshakov pleshakov added tech-debt Short-term pain, long-term benefit and removed chore Pull requests for routine tasks labels Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt Short-term pain, long-term benefit
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants