Add scoped authorization for AgentTemplate, Harness, and ModelConfig - #2683
Draft
iplay88keys wants to merge 5 commits into
Draft
Add scoped authorization for AgentTemplate, Harness, and ModelConfig#2683iplay88keys wants to merge 5 commits into
iplay88keys wants to merge 5 commits into
Conversation
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
…thorization Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io> # Conflicts: # go/core/cmd/controller-v2/main.go
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
Signed-off-by: Jeremy Alvis <jeremy.alvis@solo.io>
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
CollectionAuthorizercontract for scoped resource access.AgentTemplate,Harness, andModelConfig.Authorization contract
The contract supports
ALL,NONE, and composableANY_OFscopes withINpredicates.Kagent supplies trusted
namespaceandnameattributes. An authorizer defines policies, identities, roles, and catalog keys.The shared Kubernetes matcher validates each scope. It denies malformed scope output.
Single-resource operations authorize stored or validated resource data. Update operations authorize both the stored and proposed resources.
List operations apply the scope before sorting and response construction.
ScopeNonereturns an empty protected collection.The no-op authorizer returns
ScopeAll. This behavior keeps current OSS visibility and write access unchanged.Response capabilities
Each protected list response includes
can_create.Each returned
AgentTemplateandModelConfigincludescan_updateandcan_delete.Each returned
Harnessincludescan_delete. TheHarnessservice has no update RPC.The UI uses these fields to disable create, edit, and delete controls. The RPC handlers still enforce every action.
The list response does not include
can_list. A Boolean cannot represent access to only part of a collection.The applied list scope defines visible resources.
can_createreports a separate action that the UI must control.Scope
The protected resource types are
AgentTemplate,Harness, andModelConfig.AgentHarness,SandboxAgent,AgentInstance, andModelProviderConfigremain outside this change.ListConfiguredProvidersremains unchanged. It readsModelProviderConfig, notModelConfig.Validation
make proto-generatemake proto-lintgo test ./internal/grpcserver ./internal/service/kubecrud ./internal/service/modelcorepack yarn typecheckcorepack yarn test