Skip to content

feat: ui experiment#397

Draft
trevex wants to merge 32 commits into
mainfrom
feat/ui-experiment
Draft

feat: ui experiment#397
trevex wants to merge 32 commits into
mainfrom
feat/ui-experiment

Conversation

@trevex
Copy link
Copy Markdown
Contributor

@trevex trevex commented Apr 11, 2026

No description provided.

trevex and others added 26 commits April 10, 2026 10:02
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2af6508b-53df-45d5-98f2-1659826dd9d5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ui-experiment

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread pkg/ui/server.go

return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Try to serve the file directly
f, err := fsys.Open(r.URL.Path)
rebEllieous and others added 4 commits May 6, 2026 00:23
#499)

… helm-template and ui-e2e test

## What
Implements user impersonation ("Preview as") in the solar-ui BFF and
frontend.
Closes #432 

## Why
Platform admins need to preview the UI as other users to validate that
RBAC restrictions are working correctly, without logging out and back in
as a different user.

## Testing
- Manual: logged in as admin@solar.local against `make ui-dev` cluster,
verified /api/auth/impersonation-targets returns the configured
personas, impersonation activates/clears correctly, permissions reflect
the persona's RBAC, and isAdmin remains true on the real identity while
impersonating
- Playwright e2e: new impersonation.spec.ts covering unauthenticated
401s, admin access, the activate → check permissions → clear lifecycle,
and invalid input rejection. run via `make ui-test-e2e`

## Notes for reviewers
**How admin access works:**
The BFF uses its own service-account credentials to list
ClusterRoleBindings labeled solar.opendefense.cloud/admin=true and
checks the session's username/groups against subjects. This avoids
issuing a SelfSubjectAccessReview as the logged-in user (which would
fail in impersonate auth-mode) and is immune to active impersonation
state.
**New RBAC resources (via Helm):**
- admin-clusterrolebinding.yaml: solar-ui:admin ClusterRole + CRB,
populated from values.ui.admin.subjects with admin label used to
distinguish admins in the BFF
- impersonation-clusterrolebinding.yaml: solar-ui:impersonate:$username
ClusterRoles + CRBs, populated from values.ui.impersonation.targets with
impersonatable label
- rbac.yaml: grants the BFF SA list on clusterroles and
clusterrolebindings (needed for admin check and impersonatable
discovery)

## Checklist
- [*] Tests added/updated
- [*] No breaking changes (or upgrade path documented above)
- [*] Readable commit history (squashed and cleaned up as desired)
- [*] AI code review considered and comments resolved

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Administrators can now impersonate other users to preview and test
their experience
  * Admin role support integrated with Kubernetes RBAC
  * Routes and navigation now protected based on user permissions

* **Documentation**
  * Added UI access control configuration guide

* **Tests**
  * Added impersonation workflow tests

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants