This repository was archived by the owner on Jun 19, 2026. It is now read-only.
[ENGMP-365] Add ProtectionEngine and sample Noop protection implementation - #316
Open
yishi3-db wants to merge 12 commits into
Open
[ENGMP-365] Add ProtectionEngine and sample Noop protection implementation#316yishi3-db wants to merge 12 commits into
yishi3-db wants to merge 12 commits into
Conversation
yishi3-db
marked this pull request as ready for review
March 17, 2026 16:23
yishi3-db
force-pushed
the
yi-shi_data/yishi3-db/query-protection
branch
from
March 20, 2026 17:33
bfe1cd1 to
89a5c0a
Compare
Base automatically changed from
yi-shi_data/yishi3-db/query-protection
to
db_main
March 20, 2026 17:35
yishi3-db
force-pushed
the
yi-shi_data/yishi3-db/query-protection-engine
branch
from
March 20, 2026 17:38
7d00f92 to
bfd7d5e
Compare
…gine Signed-off-by: Yi Shi <yi.shi@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProtectionEnginethat evaluates a list of rules in order; the first matching rule wins. It's the core logic of protection middleware.Protectioninterface andRulestruct.NoopProtectionas a sample implementation that always matches, along withprotectionRegistryandLookupProtectionfor future config-driven rule loading.Test plan
New tests
protection_engine_test.go— unit tests forProtectionEngine.Evaluate:verifies that
ProtectionEngine.Evaluatecorrectly filters, prioritizes, and evaluates rules against query requestsprotection_impls_test.go— unit tests for protection implementations and registry:Existing tests
go test ./pkg/queryfrontend/...passes