Skip to content

feat: add reusable DDNS provider secrets, OIDC SPA gating, and Cap-style admin UI controls - #6

Merged
tracyhatemice merged 16 commits into
masterfrom
feat/ddns-secrets-ui-polish
Nov 29, 2026
Merged

tracyhatemice merged 16 commits into
masterfrom
feat/ddns-secrets-ui-polish

Conversation

@tracyhatemice

Copy link
Copy Markdown
Owner

Summary

Reusable DDNS Provider Secrets & Provider-Agnostic DDNS

  • Added a declarative DDNS provider credential registry (ddns/providers.go) and migrated ddns.Config to a generic Credentials map[string]string map ready for future providers (e.g., Cloudflare) alongside AWS Route53.
  • Added SQLite ddns_secrets table (schema_version = 2) with secret_id foreign-key usage guards (ON DELETE RESTRICT), secret-linked JSON backup/restore, and /api/v1/secrets CRUD with live secret rotation and secret masking (••••••••).
  • Generalized DDNS views and modals (DDNSModal, SecretModal, Provider Secrets management in Settings) with inline quick-create secret support and consistent Sync action naming.

OIDC SPA Gating, Live Allowlist Enforcement & CSRF Hardening

  • Added sessions.email_verified (schema_version = 3, additive fail-closed v2 -> v3 migration) so internal/auth enforces WHO_OIDC_ALLOWED_EMAILS / WHO_OIDC_ALLOWED_SUBS identically at login and on every request, automatically revoking disallowed sessions and auditing session_denied.
  • Gated {basePath}/ and {basePath}/assets/* behind OIDC (spa.go, auth_page.go): unauthenticated visitors receive a self-contained zero-admin-JS Cap-styled Sign-In / OIDC-setup HTML page, pre-auth asset requests return 401, and authenticated SPA responses set Cache-Control: private + Vary: Cookie.
  • Added Sec-Fetch-Site: cross-site rejection (403), required X-Who-CSRF: 1 on GET /api/v1/backup/export (triggered via authenticated fetch + Blob download), and preserved one-shot ?auth_error=session_revoked redirects when sessions are revoked or expire.

Structured Log Filters, Numbered Pagination, Top Breakdowns & Facets

  • Extended GET /api/v1/access-logs, GET /api/v1/audit-logs, and GET /api/v1/records/{iam}/history with repeatable structured filters (OR within a key, AND across keys), clamped offset pagination (page, pageSize, total, totalPages), view=top SQL GROUP BY ranked breakdowns, and window facets (facets=1).

Admin UI/UX Polish & Cap-Style Controls

  • Fixed top-layer right-edge drawer (Drawer), left-edge mobile nav (Sidebar), and Dialog slide/fade entry & exit animations across browsers (@starting-style, transition-behavior: allow-discrete, and Firefox/Safari exit fallback in topLayer.js).
  • Replaced tile time pickers and per-page quick-filter strips with a compact Cap-style TimeRangePicker (with custom range and Refresh to its left), a unified tokenized key:value autocomplete FilterBar, numbered Pagination across all list views, and List | Top interactive drill-down views on Access Log and Audit Log.
  • Renamed nav items to Records and Settings, split DDNS and Webhooks into standalone sections (redirecting #/integrations*), added Persisted/Ephemeral badges and aligned row actions (Sync, Edit, ⋯ ActionMenu, Delete) on Records, and fixed 2-row alias history alignment with clickable member navigation in RecordDrawer.

Notes

  • SQLite migrates automatically (v1 -> v2 -> v3); pre-v3 sessions default email_verified = 0 so email-allowlisted sessions re-authenticate once after upgrade.
  • GET {basePath}/api/v1/backup/export now requires the X-Who-CSRF: 1 header.

Verification

  • golangci-lint run: 0 issues.
  • go test -count=1 -race -cover ./...: all 6 packages pass (who 77.5%, ddns 97.6%, internal/auth 86.8%, internal/storage 82.3%, ui 66.7%, webhook 94.0%).
  • pnpm --dir ui run check: 25/25 Node tests pass + Vite dev build clean (0 warnings/errors).
  • pnpm --dir ui run build & CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o who .: clean static binary build.

@tracyhatemice
tracyhatemice merged commit 8c3dec0 into master Nov 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant