feat: v2.0 Phase 1 foundation + bastion-restart identity fix + Dockerfile + BASTION_DIR #14
Reference in New Issue
Block a user
Delete Branch "feat/v2-phase1-foundation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Lands the v2.0 Phase 1 foundation along with three smaller fixes that complete the in-flight work on this branch.
v2.0 Phase 1 foundation (commit
04faa07)New
@lab/corepackage: Resource types,Output<T>(Pulumi), audit/auth/environment/account types, resource kind registry.New Prisma schema (mcpctl pattern): User/Session/Group/GroupMember, ServiceAccount, RbacDefinition, AuditEvent (with correlation IDs), Environment/Account/Binding, generic Resource model, Secret/Fleet/FleetMember/GitSource. Keeps v1.0 models (Server/Agent/Bastion/Cluster/JoinToken).
New labd services:
AuthService(bearer login, bootstrap, 30-day sessions),RbacService(env-scoped permission checks, group membership, role hierarchy),AuditService(fire-and-forget batch 50 / flush 5s with correlation IDs),ResourceStore(CRUD with origin/managedBy + RBAC).New labd routes:
/api/auth/login,/api/auth/logout, RBAC-enforced/api/resourcesCRUD,/api/environments,/api/accounts,/api/accounts/bind,/api/bindings,/api/events. Bearer auth middleware.fix(labd): preserve machine identity across bastion restarts (
d6e1f3c)The worker0-k8s0 bug. When labd restarted, the next DHCP/PXE re-discovery overwrote
status="discovered"on top of an already-installed DB record, erasing hostname/role identity from the CLI view. Two changes plus three vitest cases.build(labd): include @lab/core in the Dockerfile build chain (
37a3b51)The v2.0 Phase 1 commit added
@lab/corebut the Dockerfile only copied@lab/sharedand@lab/labd. Both build stages updated; build order isshared→core→labdto match TS project references.feat(cli): honor BASTION_DIR env var (
98b0ccc)bastion serve/stop--dirdefaults toprocess.env.BASTION_DIR ?? "/tmp/lab-bastion"so a deployed daemon can run from a persistent directory without callers passing--direvery time.Test plan
vitest --run src/labd— 52 pass (incl. 3 new bastions-machines cases)pnpm --filter {@lab/shared,@lab/core,@lab/labd} build— all clean in Dockerfile orderPOST /api/auth/loginwith no users seeds the admin/api/events