Skip to content

feat: migrate AuthBridge demo from demo realm to kagenti realm - #148

Closed
mrsabath wants to merge 0 commit into
rossoctl:mainfrom
mrsabath:feat/demo-kagenti-realm
Closed

mrsabath wants to merge 0 commit into
rossoctl:mainfrom
mrsabath:feat/demo-kagenti-realm

Conversation

@mrsabath

Copy link
Copy Markdown
Member

Summary

  • Migrates all GitHub Issue Agent demo files from the Keycloak demo realm to the shared kagenti realm
  • This aligns the demo with the platform-wide realm migration (kagenti#764) so that UI-issued tokens and demo tokens share the same issuer
  • With UI and demos on the same realm, UI chat with AuthBridge-protected agents should work end-to-end (resolves kagenti-extensions#147)

Files changed

File Changes
k8s/configmaps.yaml KEYCLOAK_REALM, TOKEN_URL, ISSUER → kagenti
k8s/github-tool-deployment.yaml ISSUER, JWKS_URL → realms/kagenti
k8s/git-issue-agent-deployment.yaml JWKS_URI → realms/kagenti
setup_keycloak.py Default KEYCLOAK_REALM → kagenti
demo-manual.md All realm references in docs and commands

Part of: kagenti#767

Test plan

  • Run setup_keycloak.py — verify it creates the kagenti realm (not demo)
  • Deploy agent and tool with updated manifests
  • Verify ConfigMap shows KEYCLOAK_REALM: kagenti
  • Verify inbound validation works (wrong-issuer test now rejects master-realm tokens against kagenti issuer)
  • Verify end-to-end token exchange succeeds with kagenti realm URLs
  • Verify UI chat with AuthBridge-protected agent works (same realm)

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ✓

Comment thread docs/create_presentation.py Outdated
@@ -0,0 +1,1332 @@
#!/usr/bin/env python3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This UI issue spec is unrelated to the realm migration. Consider filing it as a GitHub issue or moving it to a separate PR.

@mrsabath mrsabath closed this Mar 9, 2026
@mrsabath
mrsabath force-pushed the feat/demo-kagenti-realm branch from 45ce0d9 to 61c4bdb Compare March 9, 2026 14:51
anatolykoyfman added a commit that referenced this pull request Aug 26, 2026
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]>
anatolykoyfman added a commit that referenced this pull request Aug 26, 2026
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]>
anatolykoyfman added a commit that referenced this pull request Aug 26, 2026
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]>
anatolykoyfman added a commit that referenced this pull request Aug 26, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feat: go-processor should support multiple JWKS URLs for inbound validation

2 participants