accounts+frontend: user/team/session CRUD, RLS-scope fixes, settings - #2
Conversation
…ke, settings Backend (accounts): UpdateUser honors target uuid w/ self-or-admin gate; add UpdateTeam/DeleteTeam + RevokeSession RPCs (proto + Go + connect handlers, regenerated); fix RLS-scoping on self-writes (consent/settings/user CRUD now wrap store.As(Identity).Within, team writes WithOrgTx, session revoke WithBypass) so they don't silently no-op under RLS; fix UserSettings store using WHERE id vs uuid; fix buf.gen go_package_prefix (api->accounts). Frontend: user edit/delete dialogs, team rename/delete, session force-logout, notification-settings wired to real UserSettings.notifications, settings mutation takes a MessageInitShape. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
💳 Subscription Requiredcodefly-dev has used all free reviews this month. |
|
Warning Review limit reached
Next review available in: 38 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds Team update/delete and platform session revocation across proto, OpenAPI, Go backend (handlers, business logic, Postgres store), plus frontend mutations/UI for team rename/delete, session force-logout, user edit/delete, and rewires notification settings to persist via backend user settings API. Also scopes several existing writes within identity-based transactions. ChangesBackend: proto/API contracts and Go implementation for team & session management
Estimated code review effort: 4 (Complex) | ~60 minutes Frontend: team management, session revocation, user edit/delete, and notification settings UI
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ConnectHandler as teamConnectHandler
participant TeamServer
participant Service
participant Store as PostgresStore
Client->>ConnectHandler: UpdateTeam(request)
ConnectHandler->>TeamServer: UpdateTeam(ctx, req)
TeamServer->>TeamServer: requireTeamAdmin(teamId)
TeamServer->>Service: UpdateTeam(ctx, actorID, req)
Service->>Service: resolveTeamOrg(teamId)
Service->>Store: WithOrgTx -> UpdateTeam(teamId, name, description)
Store-->>Service: updated Team
Service-->>TeamServer: UpdateTeamResponse
TeamServer-->>ConnectHandler: UpdateTeamResponse
ConnectHandler-->>Client: Connect Response
sequenceDiagram
participant Admin
participant SessionsPage
participant useRevokeSession
participant PlatformAdminService
Admin->>SessionsPage: click Force logout
SessionsPage->>SessionsPage: set revokeTarget
Admin->>SessionsPage: confirm in AlertDialog
SessionsPage->>useRevokeSession: revoke.mutate({sessionId, reason})
useRevokeSession->>PlatformAdminService: revokeSession(sessionId, reason)
PlatformAdminService-->>useRevokeSession: success
useRevokeSession->>useRevokeSession: invalidate ["sessions"]
useRevokeSession-->>SessionsPage: toast success, clear target
Related issues: None specified. Related PRs: None specified. Suggested labels: backend, frontend, feature, api-change Suggested reviewers: None specified. 🐰 A team renamed, a session cast out, Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
💳 Subscription Requiredcodefly-dev has used all free reviews this month. |
…fest The build matrix still pointed at the deleted module/services/api/code path (renamed to accounts), so that job failed on a missing dir; point it at accounts/code. Regenerate the base-file manifest for the edited base files so base-integrity passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d3c6599 to
c521d18
Compare
💳 Subscription Requiredcodefly-dev has used all free reviews this month. |
Generic saas-starter features flowed back from the warden-platform consumer.
Backend (accounts):
UpdateUserhonors the target uuid with a self-or-admin gate; newUpdateTeam/DeleteTeam+RevokeSessionRPCs (proto + Go + connect handlers, regenerated). Systemic RLS fix: self-writes (consent, user settings, user CRUD) now wrapstore.As(Identity).Within(team writesWithOrgTx, platform-admin session revokeWithBypass) so they stop silently no-op'ing under RLS. Also:UserSettingsstore usedWHERE idinstead ofuuid;buf.gengo_package_prefixwas stale (api→accounts).Frontend: user edit/delete dialogs, team rename/delete, session force-logout, notification-settings wired to the real
UserSettings.notifications, settings mutation takes aMessageInitShape.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
UI Improvements