Shankar
e445cbef22
feat: M11b — ownership tracking, agent groups, interactive renewal approval
...
Ownership: owners/teams GUI pages, notification email resolution via
resolveRecipient (owner_id → owner.email lookup). Agent groups: dynamic
device grouping by OS/arch/IP CIDR/version with manual include/exclude
membership, migration 000004, full CRUD stack (domain → repo → service →
handler → frontend). Interactive approval: AwaitingApproval job state,
approve/reject API endpoints with reason tracking. Tests: 12 agent group
handler tests, 8 approve/reject job handler tests, integration tests
updated for 13-param RegisterHandlers. Docs updated across architecture,
concepts, and seed data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-20 21:02:35 -04:00
Shankar
1ef16984eb
feat: M11a — certificate profiles, crypto policy enforcement, short-lived cert expiry
...
Add certificate profiles as named enrollment templates that control allowed
key algorithms, max TTL, permitted EKUs, required SAN patterns, and optional
SPIFFE URI SANs. CSR submissions are validated against profile rules at
signing time (key type + minimum size). Short-lived certs (TTL < 1 hour)
auto-expire via a new scheduler loop — expiry acts as revocation, no
CRL/OCSP needed.
New files:
- Migration 000003: certificate_profiles table, FK columns on
managed_certificates/renewal_policies, key metadata on certificate_versions
- domain/profile.go: CertificateProfile + KeyAlgorithmRule structs
- repository/postgres/profile.go: full CRUD with JSONB marshaling
- service/profile.go: ProfileService with validation + audit logging
- service/crypto_validation.go: CSR-against-profile validation (RSA/ECDSA/Ed25519)
- handler/profiles.go: 5 HTTP endpoints under /api/v1/profiles
- web/src/pages/ProfilesPage.tsx: profiles management page
Modified:
- renewal.go: CSR validation in CompleteAgentCSRRenewal, ExpireShortLivedCertificates
- scheduler.go: 30s short-lived expiry check loop
- certificate.go (repo): nullable profile FK, key metadata on versions
- main.go: profile repo/service/handler wiring, 8-param NewRenewalService
- router.go: 12-param RegisterHandlers with profile routes
- seed_demo.sql: 4 demo profiles (standard, mtls, short-lived, high-security)
- Frontend: types, API client, routing, sidebar nav
Tests: 40 new tests across handler (15), service (13), crypto validation (12)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-20 20:39:49 -04:00
Shankar
64f087c327
fix: frontend error handling — ErrorBoundary, type-safe errors, stable keys
...
- React ErrorBoundary wrapping entire app for graceful crash recovery
- fetchJSON error handling uses try/catch instead of .catch() chain
- CertificateDetailPage: instanceof checks replace unsafe type casts
- DataTable: keyField prop replaces array index keys
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-20 01:20:32 -04:00
Shankar
ff10c85c68
feat: add frontend action buttons, fix notification auth bug, add 53 Vitest tests
...
Bug fix:
- markNotificationRead was using raw fetch() without auth headers,
bypassing the shared client's Authorization header. Moved to
api/client.ts to use fetchJSON with proper auth.
New action buttons:
- CertificatesPage: "New Certificate" modal with form fields
- CertificateDetailPage: "Deploy" button with target selector modal,
"Archive" button with confirmation
- IssuersPage: "Test Connection" and "Delete" per-row actions
- TargetsPage: "Delete" per-row action
- PoliciesPage: "Enable/Disable" toggle and "Delete" per-row actions
New API client functions:
- updateCertificate, archiveCertificate, registerAgent,
createPolicy, updatePolicy, deletePolicy, getPolicyViolations,
createIssuer, testIssuerConnection, deleteIssuer,
createTarget, deleteTarget, markNotificationRead
Frontend tests (53 tests, 2 files):
- client.test.ts: 35 tests covering all API endpoints, auth headers,
401 handling, error parsing, HTTP methods, request bodies
- utils.test.ts: 18 tests covering formatDate, formatDateTime,
timeAgo, daysUntil, expiryColor
CI: Added "Run Frontend Tests" step to frontend-build job
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-16 00:05:21 -04:00
Shankar
1904a92359
Implement M7: auth middleware, rate limiting, CORS, and GUI login flow
...
Add SHA-256 API key authentication with constant-time comparison, configurable
token bucket rate limiter, CORS origin allowlist middleware, and React auth
context with login page. Auth info endpoint bootstraps GUI without credentials.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-15 11:58:13 -04:00
Shankar
9c4e157bf2
Implement M5: hardening, input validation, and Vite+React+TS dashboard
...
Backend hardening:
- Fix 6 nginx.go non-constant format string build errors
- Add validation.go with hostname, PEM, and enum validators
- Apply input validation to all POST/PUT handlers (certificates,
agents, CSR, policies, teams, owners, targets, issuers)
- Fix unchecked JSON decode in TriggerDeployment handler
Frontend (Vite + React + TypeScript):
- Migrate from single-file SPA to proper build pipeline
- 7 pages: Dashboard, Certificates (list+detail), Agents, Jobs,
Notifications, Policies, Audit Trail
- TanStack Query for server state with auto-refetch intervals
- Certificate detail with version history and renewal trigger
- Job cancellation, status/type filtering, expiry countdowns
- Reusable components: DataTable, StatusBadge, ErrorState, PageHeader
- Dark theme with Tailwind CSS, sidebar nav via React Router
Server integration:
- Go server serves web/dist/ (Vite output) with SPA fallback
- Falls back to web/index.html for legacy mode
- .gitignore updated for web/node_modules/ and web/dist/
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-15 01:19:19 -04:00