Repository navigation
feat(AJDA-3680): rls and cls rules select readers by subjects, not by email - #923
Open
Matovidlo wants to merge 1 commit into
Conversation
… email Query Service RFC decision 34 (go-monorepo #668): a rule of a new rls-policy or cls-policy selects readers by `subjects` (`<idp>|<sub>`) or IdP `groups`, never by email. kbagent only authors the policies, so it follows. - `rls|cls create|update --rules` refuse `principal` / `principals` with INVALID_ARGUMENT (exit 2) before any read or write, naming `subjects`; the stored rules of an update that keeps them (a `--default` change) are not refused - validation: `subjects` entries are `<idp>|<sub>` (the schema pattern) or `*`, exactly one of subjects/groups per rule, `*` the only entry; `subjects` against a metastore older than schema 1.2.0 is refused locally with a clear message - list/detail/dry-run show `subjects:` / `groups:`; a stored 1.0.0/1.1.0 policy still shows its email selector, flagged as legacy - `rls setup` asks for subjects, groups or everyone (never an email) - tests rewritten for the new selectors, new tests for the refusal, the schema version gate, the legacy display and the guided prompt - docs: AGENT_CONTEXT, CLAUDE.md, manifest, commands-reference, gotchas (vNEXT), rls-workflow, keboola-expert, error-codes, web-server-endpoints Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Matovidlo
marked this pull request as ready for review
October 27, 2026 15:39
Matovidlo
requested review from
keboola-pr-reviewer-bot and
soustruh
as code owners
October 27, 2026 15:39
keboola-pr-reviewer-bot
left a comment
There was a problem hiding this comment.
Verdict: needs_human (risk 3/5) · profile _default
Needs human: a backward-incompatible change to a published CLI/SDK security-policy contract, gated on a backend deployment that must land first.
Impact flags: possible rollback re-introduction — see Check Run summary.
This branch has not been deployed
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.
Why
Query Service rules no longer select readers by email: an identity provider can assert any email, so a rule of a new
rls-policy/cls-policy(schema 1.2.0, go-monorepo #668, Query Service RFC decision 34) selects bysubjects(<idp>|<sub>) or by IdPgroups. kbagent authors these policies, sokbagent rls/kbagent clsfollow. Linear: AJDA-3680. Stacked on #778; retarget tomainonce it merges.What changes
rls|cls create|update --rulesrefuseprincipal/principalswithINVALID_ARGUMENT(exit 2) before anything is read or written; the message namessubjectsand says how to find one. The stored rules of anupdatethat keeps them (for example a--defaultchange on a 1.1.0 policy) are not refused.subjects/groupsper rule; asubjectsentry is<idp>|<sub>(the schema pattern, at most 1024 characters) or*;*is the only entry of its list.subjectsagainst a metastore older than 1.2.0 is refused locally (--dry-runtoo) with a message that says so; the live schema is the source of truth, kbagent does not guess the version.list/detail/--dry-runshowsubjects:/groups:; a policy stored at 1.0.0 / 1.1.0 still shows its email selector, flaggedlegacy email selector (not allowed in a new policy).rls setupasks for subjects, groups or everyone (never an email).kbagent context(AGENT_CONTEXT),CLAUDE.md,docs/cli-manifest.json,commands-reference.md,gotchas.md(a new(since vNEXT)entry),rls-workflow.md,keboola-expert.md,docs/error-codes.md,docs/web-server-endpoints.md. No version bump, no changelog entry.Assumptions (to confirm)
keboola|<user id>(RFC decision 34); the id is the memberidofkbagent project member-list(needs a Manage token). There is no new command for it: the help and the workflow say it.<idp>|<sub>as apps-proxy sends it and cannot be read off the identity provider, so group rules and["*"]are the practical selectors until user discovery exists (AJDA-3565).principal(s)keep working in the enforcement; there is no automatic migration (an email cannot be turned into a subject). To change their rules, recreate the policy.Checks
tests/test_rls_service.py,test_rls_cli.py,test_cls_cli.py,test_cls_service.py,test_server_rls.py,test_server_cls.py, the bindings tests,test_check_command_sync.pyandtest_skill_frontmatter.pypass (394 passed);ruff check,ruff format --check,check_command_sync,check_version_gates,check_file_size,check_sentinel_guards,check_error_codespass.check_cli_spec.pyreports 17target.project-not-requiredproblems forrls/clscommands: they exist on the feat(CLI-17): add kbagent rls command group + guided setup skill #778 branch already (that rule came with main) and are not touched here.🤖 Generated with Claude Code