Elevate MiroFish/CrowdSight from single-container dev to a SaaS foundation: - Local memory backend (Zep-compatible): memory services/models, local graph builder + updater, AgentActivity seam, import-boundary isolation; Zep stays default, local is opt-in behind MEMORY_BACKEND. Semantic parity not yet proven. - Durable product persistence: projects/simulations/reports schema (migration 0007) + tenant/owner-scoped ProductRepository + dual-write + scoped_project read-first + ArtifactStore abstraction; durable JobQueue + worker.py. - SaaS hardening: durable RateLimiter (wired to login), UsageService (LLM accounting), redacted AuditService, idempotency, CORS allowlist, safe API errors, single-use PasswordResetService + endpoints (covers invite-pending). - Exactly 3 roles (super_admin/admin/user) with tenant authz policy. - Admin UI: GET/POST/PATCH /api/admin/users + GET/PUT /api/admin/settings (super-admin only, encrypted/masked); AdminView.vue + SettingsView.vue with admin/super-admin route guards, th/en i18n. - Production deploy topology: multi-stage Dockerfile (frontend build + gunicorn wsgi + nginx SPA-proxy + supervisord worker), backend/wsgi.py, gunicorn dep. Backend 197 passed; frontend 10 tests + build green. ruff unavailable (gap). No commit of credentials; secrets handled via env/.env.example. Deferred: Zep semantic A/B parity, object storage cutover, mobile QA, EasyPanel container build of deploy topology.
23 lines
960 B
JavaScript
23 lines
960 B
JavaScript
import assert from 'node:assert/strict'
|
|
import fs from 'node:fs'
|
|
import path from 'node:path'
|
|
import test from 'node:test'
|
|
|
|
const repoRoot = path.resolve(import.meta.dirname, '../..')
|
|
const read = relative => fs.readFileSync(path.join(repoRoot, relative), 'utf8')
|
|
|
|
test('frontend auth foundation exposes a public login route and guarded workspace', () => {
|
|
const router = read('frontend/src/router/index.js')
|
|
const authStore = read('frontend/src/stores/auth.js')
|
|
const loginView = read('frontend/src/views/LoginView.vue')
|
|
|
|
assert.match(router, /path:\s*['"]\/login['"]/)
|
|
assert.match(router, /name:\s*['"]Login['"]/)
|
|
assert.match(router, /beforeEach/)
|
|
assert.match(router, /requiresAuth/)
|
|
assert.match(authStore, /api\/auth\/login|auth\/login/)
|
|
assert.doesNotMatch(authStore, /localStorage\.(setItem|save).*token/i)
|
|
assert.match(loginView, /auth\.login|login\(/)
|
|
assert.match(loginView, /name:\s*['"]Login['"]|router\.(push|replace)/)
|
|
})
|