-
Notifications
You must be signed in to change notification settings - Fork 0
feat(auth): Add RBAC user interface for users and API keys #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add frontend support for multi-user authentication with RBAC: - UsersView: User management with deployment assignment panel - APIKeysView: API key creation, listing, and revocation - LoginView: Toggle between username/password and API key login - DashboardLayout: User info display, role-based nav items Updated stores and services: - auth store: currentUser, permissions, hasPermission() - users store: User and API key state management - api service: usersApi, apiKeysApi, deploymentUsersApi Types added for User, APIKey, UserDeploymentAccess, Permission. Signed-off-by: nfebe <fenn25.fn@gmail.com>
Deploying flatrun-ui with
|
| Latest commit: |
0bca360
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ede40ecf.flatrun-ui.pages.dev |
| Branch Preview URL: | https://feat-api-key-rbac.flatrun-ui.pages.dev |
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
Code Review SummaryThis pull request introduces a comprehensive role-based access control (RBAC) system, enhancing the application's security and user management capabilities. Key changes include a new 🚀 Key Improvements
💡 Minor Suggestions
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review complete. See the overview comment for a summary.
Add resource-specific permission gates to router, sidebar, and all view components for containers, images, volumes, databases, infrastructure, scheduler, system, dns, registries, templates, and traffic. Add PermissionPicker component for editing user and API key permissions. Rework UsersView with tabbed dialog (Profile, Permissions, Deployments) and table columns showing permission and deployment status. Read deployment stats from authenticated /stats endpoint instead of public /health to reflect per-user filtered counts. Add PermissionPicker component tests and permission denial tests for DeploymentsView, DeploymentDetailView, CronJobsView, and SettingsView to verify write/delete buttons are hidden when the user lacks the required permissions. Signed-off-by: nfebe <fenn25.fn@gmail.com>
🔍 Code Review💡 1. **src/stores/auth.ts** (Lines 53-65) - BUGThe original implementation of Suggested Code: Current Code: if (healthRes.data.stats) {
deployments.total = healthRes.data.stats.total_deployments || 0;
deployments.running = healthRes.data.stats.running || 0;
deployments.stopped = healthRes.data.stats.stopped || 0;
deployments.error = healthRes.data.stats.error || 0;
}
const statsRes = await healthApi.stats();
if (statsRes.data) {
containers.total = statsRes.data.containers?.total || 0;
containers.running = statsRes.data.containers?.running || 0;
containers.stopped = statsRes.data.containers?.stopped || 0;
docker.images = statsRes.data.images?.total || 0;
docker.volumes = statsRes.data.volumes?.total || 0;
docker.networks = statsRes.data.networks?.total || 0;
docker.ports = statsRes.data.ports?.total || 0;Verdict: APPROVE Posted as a comment because posting a review failed. |
Add frontend support for multi-user authentication with RBAC:
Updated stores and services:
Types added for User, APIKey, UserDeploymentAccess, Permission.