Repository navigation
feat: admin sessions overview - #3420
Conversation
…useAsyncData handler
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR adds authenticated admin session list and detail pages. It expands session relation includes, adds session-token UI and translations, supports filtering and deletion, and documents the new session surfaces. ChangesSession administration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Admin
participant SessionsPage
participant session-store
participant SessionDetail
participant ASessionTokens
Admin->>SessionsPage: open /sessions
SessionsPage->>session-store: query sessions with user/client relations
session-store-->>SessionsPage: return filtered session list
Admin->>SessionDetail: open a session
SessionDetail->>session-store: load session and token collection
session-store-->>SessionDetail: return session metadata and tokens
SessionDetail->>ASessionTokens: render paginated token inventory
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/client-admin-console/pages/sessions/index/index.vue (1)
23-28: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winImport and register
VCTableandVCTimeagoexplicitly.The changed page relies on global registration for these components. Import them from their packages and add them to
components. This keeps the dependency visible and enables local prop type checks.Proposed fix
import type { TableColumn } from '`@vuecs/table`'; +import { VCTable } from '`@vuecs/table`'; import type { FormOption } from '`@vuecs/forms`'; import { VCFormSelect } from '`@vuecs/forms`'; import { VCIcon } from '`@vuecs/icon`'; import { VCLink } from '`@vuecs/link`'; +import { VCTimeago } from '`@vuecs/timeago`'; ... VCLink, + VCTable, + VCTimeago,As per coding guidelines, follow the documented architecture. The structure guide requires explicit imports for new or changed app code.
Also applies to: 33-41, 192-255
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/client-admin-console/pages/sessions/index/index.vue` around lines 23 - 28, Import VCTable and VCTimeago explicitly from their respective packages alongside the existing component imports, then register both in the page component’s components option. Update the table and timeago usage in the sessions page to resolve through these locally registered components, preserving the existing behavior and enabling local prop type checks.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/client-admin-console/pages/sessions/index/index.vue`:
- Around line 58-62: Update the query computed in the sessions collection to use
the documented top-level filter shape, setting realmId to include both the
active realm ID and null for global sessions. Preserve the existing relations
and seenAt descending sort.
---
Nitpick comments:
In `@apps/client-admin-console/pages/sessions/index/index.vue`:
- Around line 23-28: Import VCTable and VCTimeago explicitly from their
respective packages alongside the existing component imports, then register both
in the page component’s components option. Update the table and timeago usage in
the sessions page to resolve through these locally registered components,
preserving the existing behavior and enabling local prop type checks.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e9180bdb-eeb1-4555-ac5a-33e771ad2fa6
📒 Files selected for processing (28)
.agents/architecture.md.agents/structure.mdapps/client-admin-console/config/layout/contants.tsapps/client-admin-console/pages/sessions/[id]/index.vueapps/client-admin-console/pages/sessions/index.vueapps/client-admin-console/pages/sessions/index/index.vueapps/server-core/src/core/entities/session/schema.tsapps/server-core/test/unit/http/controllers/entities/session-include.spec.tspackages/client-web-kit/src/components/entities/index.tspackages/client-web-kit/src/components/entities/session-token/ASessionTokens.tspackages/client-web-kit/src/components/entities/session-token/index.tspackages/i18n/src/catalogs/de/app.tspackages/i18n/src/catalogs/de/common.tspackages/i18n/src/catalogs/de/entity.tspackages/i18n/src/catalogs/de/field.tspackages/i18n/src/catalogs/en/app.tspackages/i18n/src/catalogs/en/common.tspackages/i18n/src/catalogs/en/entity.tspackages/i18n/src/catalogs/en/field.tspackages/i18n/src/catalogs/es/app.tspackages/i18n/src/catalogs/es/common.tspackages/i18n/src/catalogs/es/entity.tspackages/i18n/src/catalogs/es/field.tspackages/i18n/src/catalogs/fr/app.tspackages/i18n/src/catalogs/fr/common.tspackages/i18n/src/catalogs/fr/entity.tspackages/i18n/src/catalogs/fr/field.tspackages/i18n/src/constants.ts
authup
@authup/client-account-console
@authup/client-admin-console
@authup/client-auth-console
@authup/server-core
@authup/access
@authup/client-web-kit
@authup/client-web-kit-theme
@authup/client-web-nuxt
@authup/client-web-theme
@authup/core-http-kit
@authup/core-kit
@authup/core-realtime-kit
@authup/errors
@authup/i18n
@authup/kit
@authup/server-adapter-kit
@authup/server-adapter-node
@authup/server-adapter-socket-io
@authup/server-adapter-web
@authup/server-kit
@authup/server-test-kit
@authup/specs
commit: |
|
@coderabbitai pause |
✅ Action performedReviews paused. |
Summary
Adds a dedicated top-level Sessions surface to the admin console, so an admin can oversee every active session across all subjects (users and clients) instead of only the per-user tab.
GET /sessionsschema:relations.allowedextended from['realm']to['realm', 'user', 'client']. Both new includes are gated per target by the relations read gate (Include-authorization gating via schema relations.validate at decode time (#3286 phase 3, part 4) #3295) on theUSER_READ/CLIENT_READdisjunctions; self-service readers get the include silently stripped. The joined client stays covered by the client schema'ssecretfield gate and the universalredactFieldConditionssweep. No other server changes.@authup/client-web-kit: newASessionTokenscollection component (mirror ofASessionsoverEntityType.SESSION_TOKEN).@authup/i18n:sessionTokenentity noun,authMethod/kind/subject/refreshedAt/mfaAtfield labels,allcommon label and token-status copy, authored in en/de/fr/es./sessionspage group, gated onSESSION_READ:/sessions/:id): general card, guarded subject resolution (falls back to thesubuuid), read-only token inventory viaGET /session-tokens?filter[sessionId]=...&include=clientwith per-application attribution and a derived status (revoked / consumed / expired / active), revoke button guarded onSESSION_DELETEand the current session.agents/docs updated (session UI surfaces, page-placement examples).Verification
session-include.spec.ts: admininclude=user,realmhydration, client-subjectinclude=clienthydration, silent strip for a reader withoutUSER_READ.check:types -w apps/server-coregreen on the final tree.SelectItemvalue on the filter; a seconduseAsyncDataafterawaitlosing the Nuxt context) which are fixed on the branch.Notes
users/[id]/sessionsremains the parent-scoped lens.Summary by CodeRabbit