New packages: - @lab/core: Resource types, Output<T> (Pulumi), audit event types, auth types, environment/account types, resource kind registry New Prisma schema (mcpctl pattern): - User (email/password/bcrypt), Session (bearer tokens), Group, GroupMember - ServiceAccount, RbacDefinition (JSON subjects + roleBindings) - AuditEvent (correlation IDs, causal chains, fire-and-forget batching) - Environment, Account (driver config, Infisical secret path), Binding - Resource (generic, kind/name/env unique, origin/managedBy tracking) - Secret, Fleet, FleetMember, GitSource - Keeps v1.0 models: Server, Agent, Bastion, Cluster, JoinToken New services: - AuthService: bearer token login, bootstrap (first login creates admin), session management with 30-day expiry - RbacService: environment-scoped permission checks, group membership, role hierarchy (admin > edit > view) - AuditService: fire-and-forget event collection, batch 50 / flush 5s, correlation IDs for causal chains - ResourceStore: CRUD with origin/managedBy, RBAC-enforced routes New routes: - POST /api/auth/login, POST /api/auth/logout (bearer token auth) - GET/POST/PUT/DELETE /api/resources (RBAC-enforced CRUD) - GET/POST /api/environments, GET/POST /api/accounts - POST /api/accounts/bind, GET /api/bindings - GET /api/events (audit query with --last, --kind, --env, --correlation) New middleware: - Bearer token auth (validates Authorization header, resolves user identity) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
504 B
TypeScript
25 lines
504 B
TypeScript
// Environment and Account types.
|
|
// An Environment is a logical boundary (production, staging, dev).
|
|
// An Account is a configured driver instance with credentials.
|
|
|
|
export interface Environment {
|
|
id: string;
|
|
name: string;
|
|
status: "active" | "archived";
|
|
createdAt: Date;
|
|
}
|
|
|
|
export interface Account {
|
|
id: string;
|
|
name: string;
|
|
driver: string;
|
|
config: Record<string, unknown>;
|
|
createdAt: Date;
|
|
}
|
|
|
|
export interface Binding {
|
|
id: string;
|
|
environmentId: string;
|
|
accountId: string;
|
|
}
|