-
Notifications
You must be signed in to change notification settings - Fork 591
Open
Description
Create a comprehensive identity details page matching the Key Details pattern, showing verification analytics and logs across all keys associated with the identity. This page should mirror the functionality of the Key Details page but aggregate data for all keys belonging to the identity.
Acceptance Criteria
Page Structure & Navigation
- Identity details page at route
/[workspaceSlug]/identities/[identityId] - Breadcrumb navigation: Workspace > Identities > [External ID]
- Page header showing:
- Identity ID badge with copy button
- External ID badge with copy button
- Context menu (3-dot) with all actions
- Main content area with analytics and logs (matches Key Details layout)
Analytics Chart Component
- Time-series chart showing verification counts over time
- Aggregates data from ALL keys associated with this identity
- Chart shows:
- Success verifications (green)
- Failed verifications (red/orange)
- Rate limited verifications (if applicable)
- Time range selector:
- Last 24 hours
- Last 7 days (default)
- Last 30 days
- Last 90 days
- Custom date range
- Chart updates when time range changes
- Loading state while fetching data
- Empty state when no verification data exists
Summary Stats
- Stats cards displayed above or alongside chart:
- Total Verifications (all time or filtered range)
- Success Rate % (successes / total × 100)
- Total Keys using this identity
- Last Used timestamp
- Stats update based on selected time range
Verification Logs Table
- Table showing individual verification events
- Columns:
- Timestamp (with relative time)
- Key ID (clickable link to key details, truncated with hover tooltip)
- Outcome (success/denied/rate_limited badge with color coding)
- Region
- Response time/latency (optional)
- Sortable columns (timestamp, outcome)
- Pagination (50 logs per page)
- Click on row to open detailed log drawer
- Filter controls:
- Filter by outcome (success/denied/rate_limited)
- Filter by specific key ID
- Search by request ID
- Real-time updates toggle (optional)
Log Details Drawer
- Drawer slides in from right when log is selected
- Shows complete verification details:
- Request ID
- Timestamp
- Key ID with link
- Identity information (external ID, meta if relevant)
- Outcome with explanation
- Region and IP address (if available)
- Response time
- Request metadata
- Ratelimit information (if applicable)
- Close button and ESC key support
- Click outside to close
Metadata & Ratelimits Section
- Collapsible section showing:
- Metadata (JSON code block, expandable)
- Ratelimits (table with: Name, Limit, Duration, Auto-apply)
- Associated Keys (table with: Key ID, Name, Created, Last Used)
- Edit buttons for metadata and ratelimits (opens dialogs from Ticket 2 & 3)
- "Create Key" button to create new key with this identity
Empty States
- When identity has no verification data:
- Message: "No verification data yet"
- Explanation: "Verification logs will appear here once keys associated with this identity are used"
- When identity has no keys:
- Message: "No keys associated with this identity"
- "Create Key" button
Loading States
- Skeleton loaders for:
- Chart area
- Stats cards
- Logs table
- Smooth transitions when data loads
Technical Details
Component Structure
- Create
apps/dashboard/app/(app)/[workspaceSlug]/identities/[identityId]/page.tsx - Follow Key Details pattern from
apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/keys/[keyAuthId]/[keyId]/ - Create similar component structure to Keys
Data Fetching
- Query ClickHouse
key_verifications_raw_v2table - Filter by
identity_id = [identityId] - Aggregates across all keys for this identity
- Use existing clickhouse service at
lib/clickhouse - Create tRPC query:
trpc.identity.queryVerificationLogs - Create tRPC query:
trpc.identity.queryVerificationTimeseries
Reusable Components
- Reuse chart components from Key Details where possible
- Reuse table components with identity-specific adaptations
- Reuse drawer component with identity context
- Reuse time range selector
- Reuse filter controls
Performance Considerations
- Implement virtualization for logs table if >100 rows
- Debounce filter changes
- Cache chart data for selected time ranges
- Lazy load drawer content
Metadata
Metadata
Assignees
Labels
No labels