Commit Graph

249 Commits

Author SHA1 Message Date
rcourtman
7cc896424d refactor(33-data-model-integrity): harden shutdown lifecycle in pkg/audit 2026-02-12 01:34:50 +00:00
rcourtman
9e979916cd feat(cloud): add TierCloud, hosted subscription gating, trial seeding, SAML license check
- Add TierCloud to license features with full Cloud capability set
- Hosted mode: tenant middleware gates on subscription lifecycle
  (active/grace/bounded-trial) instead of FeatureMultiTenant
- Seed trial billing state on hosted signup so tenants are usable
  before Stripe checkout completes (14-day bounded trial)
- SAML SSO creation/update now requires AdvancedSSO license (OIDC
  remains free on all tiers)
- Stripe webhook handlers use TierCloud instead of TierPro for
  hosted checkout/subscription capability derivation
- MultiTenantChecker accepts hostedMode flag for correct WebSocket
  gating in Cloud deployments
- Comprehensive tests for hosted subscription gating (active, trial
  with/without end date, expired, canceled, grace period)
2026-02-10 22:56:50 +00:00
rcourtman
463e4eff50 feat(cloud): implement signup + magic link flow (C-6)
Complete the post-checkout signup flow: Stripe checkout → container
starts → magic link generated → user clicks → logged into tenant
dashboard.

- Add pkg/cloudauth for shared HMAC-SHA256 handoff token sign/verify
- Add internal/cloudcp/auth for control plane magic link service with
  SQLite-backed token store (standalone, no internal/api dependency)
- Add magic link verify handler on control plane that generates a
  short-lived handoff token and redirects to tenant container
- Add /auth/cloud-handoff endpoint on tenant side that validates
  handoff token and creates a session using existing auth machinery
- Expand provisioner to write per-tenant handoff key, poll container
  health (2s interval, 60s timeout), and generate magic link on success
- Wire magic link service into control plane server and routes
2026-02-10 21:54:23 +00:00
rcourtman
99c7b42d20 fix(proxmox): avoid 403 on apt update checks and harden PVE permission setup
Port from 5.1.x hotfix line (815c990e). Adds privilege probing so
the host agent only requests PVE permissions that exist on the target
version (VM.Monitor on PVE 8, VM.GuestAgent.Audit on PVE 9+). Demotes
apt/update 403 to Debug. Setup script uses comma-separated privs and
modify-before-add for the PulseMonitor role.
2026-02-10 18:12:09 +00:00
rcourtman
8a3aabe21d Merge branch 'main' into pulse/rc-00-scope-freeze 2026-02-10 17:17:32 +00:00
rcourtman
ca01fdf56c feat(audit): real per-tenant SQLite audit logging with license gating (W1-B)
- Add SQLiteLoggerFactory implementing LoggerFactory interface, bridging
  dbPath to SQLiteLoggerConfig.DataDir with per-tenant crypto support
- Wire factory into server.go TenantLoggerManager initialization
- Remove stub initAuditLoggerIfLicensed from license_handlers.go
- Make all /api/audit/* handlers tenant-aware via GetOrgID(ctx)
- Register /api/audit/export and /api/audit/summary with audit_logging
  license gate
- Add factory persistence + HMAC signing test
- Add tenant isolation test (org-a events invisible to org-b)

Decision: always capture audit events to SQLite; gate query/export
endpoints behind audit_logging license feature.
2026-02-10 14:52:02 +00:00
rcourtman
298b957222 feat(hosted): wire reaper + cleanup cascade into server lifecycle
- Add OnBeforeDelete hook to Reaper for pre-deletion cleanup
- Store rbacProvider on Router struct for cross-subsystem access
- Add Router.CleanupTenant() cascading RBAC, AI, and license cleanup
- Add LicenseHandlers.RemoveTenantService() for cache eviction
- Wire reaper startup in server.go behind PULSE_HOSTED_MODE=true
2026-02-10 12:47:27 +00:00
rcourtman
e2194f868e feat(relay-docker): improve relay proxy and Docker agent collection
- Enhance relay client with better connection handling
- Improve relay proxy with additional functionality and tests
- Update Docker agent collect with improved metrics gathering
- Add test coverage for Docker agent collection
2026-02-07 16:15:43 +00:00
rcourtman
ffe6c88c8b feat(kubernetes): improve agent metrics and unified resource integration
- Enhance Kubernetes agent with comprehensive usage metrics collection
- Add monitoring improvements for Kubernetes agents
- Integrate Kubernetes resources into unified resource registry
- Add report format improvements for Kubernetes agent reports
- Include new test coverage for usage metrics and registry integration
2026-02-07 16:12:23 +00:00
rcourtman
f6f792c4d4 feat(backend): Implement Unified Resources backend 2026-02-06 16:04:18 +00:00
rcourtman
555de24563 feat(api): update API handlers and service integrations
Refactors API handlers, updates notification logic, and enhances service discovery and configuration management. Includes extensive test coverage updates.
2026-02-06 12:28:55 +00:00
rcourtman
2cad478774 feat(monitoring): enhance metrics collection and history
Updates monitoring logic for better coverage, adds metrics history support, and improves host agent command handling.
2026-02-06 12:28:29 +00:00
rcourtman
1edfa4311e feat: Unified Resource Model and Navigation Redesign
## Summary
Complete implementation of the Unified Resource Model with new navigation.

## Features
- v2 resources API with identity matching across sources (Proxmox, Agent, Docker)
- Infrastructure page with merged host view
- Workloads page for all VMs/LXC/Docker containers
- Global search (Cmd/Ctrl+K) with keyboard navigation
- Mobile navigation with bottom tabs and drawer
- Keyboard shortcuts (g+key navigation, ? for help)
- What's New modal for user onboarding
- Report Incorrect Merge feature for false positive fixes
- Debug tab in resource drawer (enable via localStorage)

## Technical
- Async audit logging for improved performance
- WebSocket-driven real-time updates for unified resources
- Session-based auth achieves <2ms API response times

## Tests
- Backend: 78 tests passed
- Frontend: 397 tests passed
2026-02-05 17:57:59 +00:00
rcourtman
6c170165a5 Cover PMG cluster status without params 2026-02-05 13:24:50 +00:00
rcourtman
a1f48df3c4 Assert SetManager/GetManager behavior 2026-02-05 13:24:09 +00:00
rcourtman
e7fd2a101c Cover PMG mailcount without timespan 2026-02-05 13:23:39 +00:00
rcourtman
1f7fa7ee04 Cover PMG spam scores 2026-02-05 13:22:52 +00:00
rcourtman
349a49ee1b Cover metrics flush drop path 2026-02-05 13:22:16 +00:00
rcourtman
4d98da4845 Add IPv6 reserved IP coverage 2026-02-05 13:21:33 +00:00
rcourtman
1b79df8087 Cover empty webhook DNS resolution 2026-02-05 13:21:01 +00:00
rcourtman
cc1cbb9922 Add RBAC global manager tests 2026-02-05 13:20:28 +00:00
rcourtman
cab4c2c592 Cover PMG query params and path escaping 2026-02-05 13:19:40 +00:00
rcourtman
27e2019253 Add tlsutil fingerprint error coverage 2026-02-05 13:18:16 +00:00
rcourtman
6ab70801cc Assert downsampled metric stats 2026-02-05 13:17:21 +00:00
rcourtman
900cefb000 Cover discovery /31 IP generation 2026-02-05 13:16:20 +00:00
rcourtman
9915d6928c Test API token context key 2026-02-05 13:15:49 +00:00
rcourtman
7b7f7064e7 Add audit webhook invalid URL cases 2026-02-05 13:15:13 +00:00
rcourtman
954f24908b Cover discovery default phase budget 2026-02-05 13:14:23 +00:00
rcourtman
1eba2f6065 Add authorizer context helper tests 2026-02-05 13:13:49 +00:00
rcourtman
f590c0eb8a Assert alert metrics counters increment 2026-02-05 13:11:41 +00:00
rcourtman
64211dff60 Cover nil environment info 2026-02-05 13:10:28 +00:00
rcourtman
6610ef8b3e Cover nil extra targets profile 2026-02-05 13:10:04 +00:00
rcourtman
885adafdd7 Handle nil context in webhook validation 2026-02-05 13:09:37 +00:00
rcourtman
c278567381 Cover discovery environment info building 2026-02-05 13:08:57 +00:00
rcourtman
5b945f24a2 Add discovery scan helper coverage 2026-02-05 13:07:38 +00:00
rcourtman
3116ee7694 Add discovery generateIPs coverage 2026-02-05 13:06:44 +00:00
rcourtman
dc92fbca3b Cover webhook queue full behavior 2026-02-05 13:05:22 +00:00
rcourtman
5f0f6edcb7 Extend audit webhook hostname validation coverage 2026-02-05 13:04:24 +00:00
rcourtman
2508bc565f Add PMG error and decode coverage 2026-02-05 13:03:49 +00:00
rcourtman
b8bb2bf1ba Cover audit webhook delivery retries 2026-02-05 13:02:32 +00:00
rcourtman
c4dcb87735 Add console logger webhook tests 2026-02-05 13:00:42 +00:00
rcourtman
db0aba95f3 Add proxmox 500 error auth guard test 2026-02-05 12:59:17 +00:00
rcourtman
09c5dfa0d5 Expand fsfilters disk/device exclude tests 2026-02-05 12:58:38 +00:00
rcourtman
b94b61dfa1 Add metrics QueryAll downsample and metadata tests 2026-02-05 12:57:59 +00:00
rcourtman
3621a400d8 Add PMG token parsing and auth error tests 2026-02-05 12:57:12 +00:00
rcourtman
8b4325bc53 Exercise agent version parsing 2026-02-05 12:20:53 +00:00
rcourtman
eaeda68ee5 Cover cluster resources without type filter 2026-02-05 12:20:05 +00:00
rcourtman
56a17ce9a4 Cover backup task node list errors 2026-02-05 12:19:18 +00:00
rcourtman
9391dd103a Add trend and alert color tests 2026-02-05 12:18:36 +00:00
rcourtman
4256d1e63c Cover PDF recommendation defaults 2026-02-05 12:17:44 +00:00