Repository navigation
[EE] User accounts, teams and roles - #226
Merged
Merged
Conversation
A shared instance listens on every interface, so anyone on the LAN could change providers, models and settings. With a license, an administrator now creates user accounts; once the first one exists, remote callers must sign in or present an API key and act as an administrator, member or viewer. - Sign-in page, session cookie, password change and login throttling. - Users and Teams page with seats from quota.lite.max_users and a locked state when unlicensed; the first gated feature, feature.lite.team_management. - API keys, conversations and image jobs belong to their creator; members no longer see upstream provider credentials. - Requests from the machine itself keep administrator access, so the CLI and desktop app are unaffected; proxied requests are treated as remote. - Sign-in keeps working after a license lapses, so the instance never reopens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reworks the account flows after LiteLLM and OpenRouter: - First administrator: from the machine itself, a one-time setup token (kept in a file, never logged) for remote setup, CSGHUB_LITE_ADMIN_* environment variables applied once at start-up, or `csghub-lite user`. - Members join through a 7-day one-time invitation link; a password an administrator sets must be changed at first sign-in. - Roles are administrator, auditor (reads everything, changes nothing) and member; legacy viewers load as members. - Configurable session length and lockout, and `csghub-lite user reset-password` to recover on the host whatever the license state. - Sidebar grouped into Workspace, Models & Data and Management, with an account menu (my API keys, password, language, sign out); members get a My API Keys page and no management pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sidebar foot now holds only the profile menu, which also shows while accounts are off so these pages stay reachable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any instance can now require a sign-in without a license: listing users and creating one are no longer gated, and the community seat cap of 1 stops an unlicensed instance at its administrator. The environment bootstrap and the offline CLI follow the same rule. Inviting more people, roles, teams and sign-in settings stay Enterprise features. The Teams page shows an unlicensed instance the administrator form, or the account and a note that sign-in is on, with the Enterprise features below, and the sidebar entry loses its lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in EE As in LiteLLM's open-source proxy, users, invitations, teams and the administrator and member roles now work without a license and with no limit on the number of users. feature.lite.team_management gates the auditor role (when it is given) and changes to the sign-in policy; the seat quota is removed. The Teams page is the same with or without a license; the auditor role and the sign-in policy carry an Enterprise badge and an unlock card. The page is titled Teams to match the sidebar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Accounts are free, so their code now lives in internal/team under Apache-2.0. ee/team holds just AuditorAllowed, the Enterprise auditor role's rules, which the accounts middleware consults for auditors. The design doc becomes docs/guides/team-management.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without accounts the menu now shows the role and a generic avatar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ganisback
added a commit
that referenced
this pull request
Oct 22, 2026
This reverts commit 4db8a0e. The design followed LiteLLM too closely; accounts will be redone in our own way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
E1 of the Enterprise gateway plan. Design:
docs/guides/team-management.md, modeled on LiteLLM Proxy and OpenRouter Organizations.Free vs Enterprise, aligned with LiteLLM's open-source proxy: users, invitations, teams, the administrator and member roles, and per-user keys, conversations and images are free, with no limit on the number of users.
feature.lite.team_managementgates only the auditor role and changes to the sign-in policy; E2–E5 (key budgets, spend reports, audit logs, SSO) will add to the Enterprise side.Today the server listens on
:11435on every interface, so anyone on the LAN can change providers, models and settings. With this change, once the first account exists, remote callers must sign in or present an API key.Setting up the first administrator (no window for someone on the LAN to claim the instance):
~/.csghub-lite/team-setup-token(0600) and never to the log, because the log is readable over the network before accounts exist.CSGHUB_LITE_ADMIN_USERNAMEplusCSGHUB_LITE_ADMIN_PASSWORDor_PASSWORD_FILE. They are applied once at start-up while no account exists and never reset a password. The UI warns while they are still set.csghub-lite user create admin --role admin.Members joining:
Roles: administrator; auditor (reads everything, including logs, usage and all keys, but changes nothing and cannot call models); member (calls models and manages their own keys, conversations and images). Everything except an administrator's actions is checked against an allowlist in
internal/team/policy.go(the auditor's inee/team/auditor.go), so new routes are protected by default.Code layout: accounts are free, so they live in
internal/teamunder Apache-2.0; only the Enterprise auditor rules are inee/team. Design doc:docs/guides/team-management.md.Ownership:
Security details:
csghub-lite user reset-passwordworks on the host whatever the license state.UI:
Docs and API: OpenAPI documents
/api/auth/*(including invitations) and/api/team/*(users, reinvite, teams, settings). Also updated: environment variables, Docker, the newdocs/cli/user.md, andee-license-design.md(drops the "no per-user permissions" non-goal and answers the seats question).Release note
CSGHUB_LITE_ADMIN_*orcsghub-lite user).Test plan
go test ./...internal/team: invitations, expiry, forced password change, host reset, settings, the last-administrator rule, migration of legacy viewers, cache coherence, the policy table;ee/team: the auditor rules.internal/server: setup token, environment bootstrap (including the unlicensed case), invitations, forced password change, sign-in settings and lockout, roles including auditor, ownership, seat cap, license lapse.vitest(95 tests) andtsc --noEmit./api/logsuser create/list/reset-password, offline and with and without a licensesafefile.Write.🤖 Generated with Claude Code