feat: add batched catalog access review - #2864
Draft
codyhartsook wants to merge 6 commits into
Draft
codyhartsook wants to merge 6 commits into
codyhartsook wants to merge 6 commits into
Conversation
Signed-off-by: Cody Hartsook <[email protected]>
Signed-off-by: Cody Hartsook <[email protected]>
Signed-off-by: Cody Hartsook <[email protected]>
Signed-off-by: Cody Hartsook <[email protected]>
Signed-off-by: Cody Hartsook <[email protected]>
Signed-off-by: Cody Hartsook <[email protected]>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
AuthorizationService.CheckAccessRPC for advisory catalog permissionsCloses #2860.
Contract
Each request contains one catalog resource type, 1–4 unique verbs, and 1–100 targets:
{namespace, name}reviews that exact resource identity without loading the resource{namespace}reviews whether some valid resource name could be allowed in that namespaceSupported resources are AgentTemplate, Harness, and ModelConfig. Harness reviews are limited to create and delete.
Evaluation and security
The server calls
CollectionAuthorizer.Scopeonce per verb, compiles the existingkubeauth.Matcher, and applies it locally to every target. A 100-row update/delete review is therefore one browser RPC, two scope evaluations, and 200 local matches rather than 200 authorization requests.Reviews are advisory. Every real catalog operation reauthorizes its actual input, so cached or stale UI results cannot bypass enforcement. The server does not cache decisions, load reviewed resources, return denial reasons, or expose roles, policies, or raw scopes.
Exact review results require
Scopeand operation-timeCheckto derive from the same policy decision.UI behavior
The enterprise UI can batch candidate namespaces to decide whether to show Create and which namespace choices to enable, then batch the visible named rows for item actions. The OSS UI does not call this RPC.
Testing
make proto-lintmake proto-generatemake proto-checkmake -C go lintgo test -short ./...go test -race ./core/internal/service/kubeauth ./core/internal/grpcserver ./core/pkg/app./node_modules/.bin/tsc --noEmittest-e2e