mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-03 07:23:33 +00:00
* fix(security): hash the publicly known master key Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * docs: replace weak master key examples and regenerate artifacts Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: replace weak key fixtures with generated test keys Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * ci: generate master keys for proxy startup Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve lens dev key entropy Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: restore proxy key compatibility in scrub examples Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: scrub merged SSO fixture and refresh dashboard bundle Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ci): stabilize test keys and metadata collection Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * chore: drop the rebuilt dashboard bundle Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: mateo <mateo@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import {
|
|
ADMIN_STORAGE_PATH,
|
|
ADMIN_VIEWER_STORAGE_PATH,
|
|
E2E_SEEDED_USER_PASSWORD,
|
|
INTERNAL_USER_STORAGE_PATH,
|
|
INTERNAL_VIEWER_STORAGE_PATH,
|
|
TEAM_ADMIN_STORAGE_PATH,
|
|
} from "../constants";
|
|
import { masterKey } from "../helpers/traffic";
|
|
|
|
export enum Role {
|
|
ProxyAdmin = "proxy_admin",
|
|
ProxyAdminViewer = "proxy_admin_viewer",
|
|
InternalUser = "internal_user",
|
|
InternalUserViewer = "internal_user_viewer",
|
|
TeamAdmin = "team_admin",
|
|
}
|
|
|
|
export type SeedApiRole = "proxy_admin_viewer" | "internal_user" | "internal_user_viewer";
|
|
|
|
export const users: Record<Role, { email: string; password: string; seedApiRole?: SeedApiRole }> = {
|
|
[Role.ProxyAdmin]: {
|
|
email: "admin",
|
|
password: masterKey(),
|
|
},
|
|
[Role.ProxyAdminViewer]: {
|
|
email: "adminviewer@test.local",
|
|
password: E2E_SEEDED_USER_PASSWORD,
|
|
seedApiRole: "proxy_admin_viewer",
|
|
},
|
|
[Role.InternalUser]: {
|
|
email: "internal@test.local",
|
|
password: E2E_SEEDED_USER_PASSWORD,
|
|
seedApiRole: "internal_user",
|
|
},
|
|
[Role.InternalUserViewer]: {
|
|
email: "viewer@test.local",
|
|
password: E2E_SEEDED_USER_PASSWORD,
|
|
seedApiRole: "internal_user_viewer",
|
|
},
|
|
[Role.TeamAdmin]: {
|
|
email: "teamadmin@test.local",
|
|
password: E2E_SEEDED_USER_PASSWORD,
|
|
seedApiRole: "internal_user",
|
|
},
|
|
};
|
|
|
|
// Re-exported from constants so the paths have one definition; they must honor
|
|
// ARTIFACT_DIR, since the suite runs from a read-only cwd in the e2e image.
|
|
export const STORAGE_PATHS: Record<Role, string> = {
|
|
[Role.ProxyAdmin]: ADMIN_STORAGE_PATH,
|
|
[Role.ProxyAdminViewer]: ADMIN_VIEWER_STORAGE_PATH,
|
|
[Role.InternalUser]: INTERNAL_USER_STORAGE_PATH,
|
|
[Role.InternalUserViewer]: INTERNAL_VIEWER_STORAGE_PATH,
|
|
[Role.TeamAdmin]: TEAM_ADMIN_STORAGE_PATH,
|
|
};
|