feat(api-server): user-scoped queries for multi-tenant isolation#899
Draft
feat(api-server): user-scoped queries for multi-tenant isolation#899
Conversation
…0.0.23 Upgrade rh-trex-ai from v0.0.19 to v0.0.23 and wire up user-scoped query filtering for multi-tenant isolation. Framework upgrade (v0.0.23 breaking changes): - Migrate JwkCertFile/JwkCertURL from ServerConfig to AuthConfig in development and production environments - NewAuthzMiddleware signature change handled by upstream routebuilder User-scoped queries: - Register UserScopeConfig for Session kind, filtering List queries by created_by_user_id with admin/platform-admin role bypass - Pass actual JWT username (via auth.GetUsernameFromContext) instead of hardcoded "id" in all HTTP and gRPC List handlers - Update code generator template to use auth context for new plugins Jira: RHOAIENG-52960 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
Regenerated OpenAPI Go client using openapi-generator v7.16.0. No schema changes — cosmetic diffs only (doc formatting, API scaffolding). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
UserScopeConfigfor Sessions, filtering List queries bycreated_by_user_idwith admin role bypassauth.GetUsernameFromContextinstead of hardcoded"id"in all 8 List handlers (4 HTTP + 4 gRPC)User scoping is applied to Sessions only — Projects, ProjectSettings, and Users are not scoped. Project/org-level scoping (likely via
org_idfrom JWT) is deferred to a follow-up.Blocked on
replacedirective ingo.modwith the published versionJira: RHOAIENG-52960
Test plan
go build ./...passes with replace directivego vet ./...cleanreplacedirective after upstream merge + tag🤖 Generated with Claude Code