-
Notifications
You must be signed in to change notification settings - Fork 0
feat: make multiuser support production-ready #48
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
base: lstein-master
Are you sure you want to change the base?
feat: make multiuser support production-ready #48
Conversation
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
|
@copilot The frontend is still asking for my login credentials, even when |
|
@copilot There are a few python regression test errors: Here's another: |
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Fixed in commit 3c5ee94. The frontend now checks the |
Auth tests were failing because the login and setup endpoints now return 403 when multiuser mode is disabled (the default). Updated test fixtures to enable multiuser mode for all auth-related tests. Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
... Fixed in commit 61b0379. The test failures were caused by my changes blocking |
lstein
left a comment
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.
@copilot When not running in multiuser mode, the model manager UI for adding, deleting and modifying models is hidden. The desired behavior is for this UI to be available when running in legacy single user mode, for it to be hidden in multiuser mode when an unprivileged user is logged in, and for it to be available when running in multiuser mode and an Administrator is logged in.
Model manager UI for adding, deleting and modifying models is now: - Visible in single-user mode (multiuser: false, the default) - Hidden in multiuser mode for non-admin users - Visible in multiuser mode for admin users Created useIsModelManagerEnabled hook that checks multiuser_enabled status and returns true when multiuser is disabled OR when user is admin. Updated all model manager components to use this hook instead of direct is_admin checks. Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Fixed in commit 0ba2924. Created a
|
Summary
Production-readiness for multiuser support: JWT secret now stored in database with cryptographically secure generation, multiuser mode gated behind config flag (default off), and reduced log noise. Frontend now properly bypasses authentication in single-user mode. Model manager UI visibility fixed to work correctly in both single-user and multiuser modes.
JWT Secret Management
app_settingstable for app-level configurationsecrets.token_hex(32))AppSettingsServicemanages persistent key-value storagetoken_service.pyrefactored: module-level secret initialized at startup from databaseMultiuser Configuration
multiuser(default:false)multiuser_enabledfield to/auth/statusendpoint response/auth/login,/auth/setup) return 403multiuser: true):Example usage in
invokeai.yaml:Frontend Authentication Handling
SetupCheckercomponent checksmultiuser_enabledfield and routes directly to app when disabledProtectedRoutecomponent allows access without authentication in single-user modemultiuser_enabledfieldModel Manager UI Visibility
useIsModelManagerEnabledhook that checks multiuser status and user permissionsLogging
infotodebuginsockets.pyTest Updates
test_security.py,test_auth.py,test_boards_multiuser.py, andtest_client_state_multiuser.pyRelated Issues / Discussions
N/A
QA Instructions
Test single-user mode (default):
multiuser: false)/auth/loginand/auth/setupreturn 403Test multi-user mode:
multiuser: trueininvokeai.yamlTest migration:
app_settingstableMerge Plan
N/A - migration 27 is additive and backward compatible
Checklist
What's Newcopy (if doing a release after this PR)Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.