Repository navigation
Conversation
pdettori
left a comment
There was a problem hiding this comment.
Review Summary
The core realm rename (demo → kagenti) across the AuthBridge demo files is clean, consistent, and complete — no leftover references. Nice work on the migration itself.
However, the PR bundles several unrelated additions (~1,300 lines) that significantly inflate scope and make it harder to review:
| Unrelated addition | Lines | Concern |
|---|---|---|
docs/create_presentation.py |
+1,332 | Presentation generator, not related to realm rename |
| 3 binary PPTX files | binary | Cannot be code-reviewed, inflates repo size |
docs/issue-kagenti-ui-import-consistency.md |
+54 | UI issue spec, not related to realm rename |
Recommendation: Split the unrelated docs/presentation files into a separate PR so this one stays focused on the realm migration (~32 lines across 5 files).
Areas reviewed: Python, K8s YAML, Docs, Binary files, Commit conventions, Security
Commits: 2 commits, all signed-off ✓
CI: passing ✓
Security: No hardcoded secrets or tokens ✓
| @@ -0,0 +1,1332 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
This 1,332-line presentation generator script is unrelated to the realm rename stated in the PR title/description. Please move it to a separate PR to keep this one focused and reviewable.
| @@ -0,0 +1,54 @@ | |||
| # Kagenti UI: Consistent look and feel for import Agents and Tools | |||
There was a problem hiding this comment.
This UI issue spec is unrelated to the realm migration. Consider filing it as a GitHub issue or moving it to a separate PR.
45ce0d9 to
61c4bdb
Compare
Add the pure-data Policy-B ('denyworld') oracle
(test/integration/scenario_uc1_denyworld.py) for the default_effect=ALLOW
full-deployment integration test, plus fixture-independent oracle-contract
tests that pin the handoff §6 matrix directly.
The oracle is a sibling of scenario_uc1 (not a parametrization): it reuses
scenario_uc1's deployment-fixed constants (USERS, USER_ROLES, TOOL_SCOPES,
bare, ...) and expresses Policy B's truth as DENY sets over a permissive
default. It provides the mounted Policy-B prose, the 6-entry prefixed
OUTBOUND_SUBJECT_DENY_PAIRS, empty inbound/target deny lists, the bare-name
deny set derived via the shared bare(), and the expected_inbound_denyworld /
expected_outbound_denyworld_bare oracle functions that compute verdicts from
the deny sets under default=ALLOW (never from the Rego under test).
The contract tests pin §6 (inbound: all three roles allow; outbound: the
6-deny / 6-allow table incl. the devops→issues-* default-flip tracer) and the
oracle's internal single-source-of-truth invariants. They carry no
integration marker, so they run in the -m 'not integration' unit lane with no
cluster / Keycloak / LLM.
Scope is the oracle + contract tests only (issue #148); the full integration
test module and the uc1_onboard harness changes are separate tasks.
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Anatoly Koyfman <[email protected]>
Add test/integration/test_policy_pipeline_denyworld.py, the ALLOW-default sibling of test_policy_pipeline.py (#151, epic #142). It onboards Policy B (permissive-default prose with prohibitions + exclusive scoping) through the real UC-1 pipeline via the #149 policy-agnostic harness (onboarded_stack(..., policy_md=POLICY_DENYWORLD, default_effect=ALLOW, ready_signals=...)), drives real HTTP through AuthBridge, and asserts the deployed OPA plugin enforces the §6 allow/deny matrix from the #148 oracle. Why default_effect=ALLOW: under deny-by-default an explicit DENY is invisible at the enforced seam (an ungranted pair is already denied), so flipping the default makes each DENY the only thing that can deny a pair — proving DENY enforcement end-to-end through PRB -> PCE -> Rego -> bundle -> OPA. The devops -> issues-* = allow cells are the default-flip tracer (deny under Policy A). - pytestmark = pytest.mark.integration (excluded from the keep-green lane). - Expected verdicts computed from the #148 oracle functions (expected_inbound_denyworld / expected_outbound_denyworld_bare) — no second copy of the matrix; the fixture-independent §6 contract stays in the #148 test_scenario_uc1_denyworld.py unit module. - Policy-B-aware convergence signals (dev-user inbound allow; devops-user issues-read allow tracer; test-user source-read deny). - Negative controls resolved against the ALLOW-mode Rego: an unmatched tool name is in no deny map, so no deny gate fires and it falls through to the permissive default = allow (the mirror of the deny-by-default control). - Teardown (in the harness) resets default_effect to Deny + cleans Keycloak so a subsequent Policy-A run on the shared stack is unaffected. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Anatoly Koyfman <[email protected]>
Add the pure-data Policy-B ('denyworld') oracle
(test/integration/scenario_uc1_denyworld.py) for the default_effect=ALLOW
full-deployment integration test, plus fixture-independent oracle-contract
tests that pin the handoff §6 matrix directly.
The oracle is a sibling of scenario_uc1 (not a parametrization): it reuses
scenario_uc1's deployment-fixed constants (USERS, USER_ROLES, TOOL_SCOPES,
bare, ...) and expresses Policy B's truth as DENY sets over a permissive
default. It provides the mounted Policy-B prose, the 6-entry prefixed
OUTBOUND_SUBJECT_DENY_PAIRS, empty inbound/target deny lists, the bare-name
deny set derived via the shared bare(), and the expected_inbound_denyworld /
expected_outbound_denyworld_bare oracle functions that compute verdicts from
the deny sets under default=ALLOW (never from the Rego under test).
The contract tests pin §6 (inbound: all three roles allow; outbound: the
6-deny / 6-allow table incl. the devops→issues-* default-flip tracer) and the
oracle's internal single-source-of-truth invariants. They carry no
integration marker, so they run in the -m 'not integration' unit lane with no
cluster / Keycloak / LLM.
Scope is the oracle + contract tests only (issue #148); the full integration
test module and the uc1_onboard harness changes are separate tasks.
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Anatoly Koyfman <[email protected]>
Add test/integration/test_policy_pipeline_denyworld.py, the ALLOW-default sibling of test_policy_pipeline.py (#151, epic #142). It onboards Policy B (permissive-default prose with prohibitions + exclusive scoping) through the real UC-1 pipeline via the #149 policy-agnostic harness (onboarded_stack(..., policy_md=POLICY_DENYWORLD, default_effect=ALLOW, ready_signals=...)), drives real HTTP through AuthBridge, and asserts the deployed OPA plugin enforces the §6 allow/deny matrix from the #148 oracle. Why default_effect=ALLOW: under deny-by-default an explicit DENY is invisible at the enforced seam (an ungranted pair is already denied), so flipping the default makes each DENY the only thing that can deny a pair — proving DENY enforcement end-to-end through PRB -> PCE -> Rego -> bundle -> OPA. The devops -> issues-* = allow cells are the default-flip tracer (deny under Policy A). - pytestmark = pytest.mark.integration (excluded from the keep-green lane). - Expected verdicts computed from the #148 oracle functions (expected_inbound_denyworld / expected_outbound_denyworld_bare) — no second copy of the matrix; the fixture-independent §6 contract stays in the #148 test_scenario_uc1_denyworld.py unit module. - Policy-B-aware convergence signals (dev-user inbound allow; devops-user issues-read allow tracer; test-user source-read deny). - Negative controls resolved against the ALLOW-mode Rego: an unmatched tool name is in no deny map, so no deny gate fires and it falls through to the permissive default = allow (the mirror of the deny-by-default control). - Teardown (in the harness) resets default_effect to Deny + cleans Keycloak so a subsequent Policy-A run on the shared stack is unaffected. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Anatoly Koyfman <[email protected]>
Summary
demorealm to the sharedkagentirealmFiles changed
k8s/configmaps.yamlKEYCLOAK_REALM,TOKEN_URL,ISSUER→kagentik8s/github-tool-deployment.yamlISSUER,JWKS_URL→realms/kagentik8s/git-issue-agent-deployment.yamlJWKS_URI→realms/kagentisetup_keycloak.pyKEYCLOAK_REALM→kagentidemo-manual.mdPart of: kagenti#767
Test plan
setup_keycloak.py— verify it creates thekagentirealm (notdemo)KEYCLOAK_REALM: kagentikagentiissuer)kagentirealm URLs