Heimdall is a secure, role-based HTTP Request Approval System built with Next.js 16. It acts as an intermediate governance layer for sensitive internal API requests, requiring designated approvers to vet payloads before they are physically executed on the backend network.
- Flexible Authentication: Natively supports legacy Active Directory / LDAP and modern Enterprise SSO (OpenID Connect via Google, Keycloak, Auth0) using a simple
AUTH_MODEtoggle. - Role-Based Access Control (RBAC): Users are classified strictly as
REQUESTERorAPPROVERvia whitelist environment constraints. - Request Collections (Blueprints): Full-featured management of reusable request templates with custom visibility (Global/Private), Auth injection, Params, and Headers. Fully aligned with the main dashboard's premium UI.
- Granular Payload Construction: Full GUI support for URL search parameters, header key-values (Basic/Bearer Auth injection), and raw JSON bodies.
- Full Lifecycle Audit Trail: The Inspection Detail panel surfaces the complete request lifecycle β Operator (who requested + when), Verifier (who approved/rejected + when), and Completion (execution timestamp and status).
- Structured JSON Logs: A zero-dependency logger outputs strictly formatted non-nested JSON to
stdoutβ compatible with Datadog, ELK, and Loki. - Request Cloning: Clone and mutate existing requests into new drafts directly from the dashboard.
- Execution Telemetry: Raw response data and network latency (via
performance.now()) are permanently attached to executed requests.
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router + React 19) |
| Styling | Tailwind CSS v4 |
| Database | Prisma ORM β SQLite / MySQL / PostgreSQL |
| Authentication | ldap-authentication (LDAP/AD) + jose (OIDC/JWT) |
| Testing | Vitest + Testing Library (78 tests, β₯92% coverage) |
| CI/CD | GitHub Actions β Pre-Commit checks + Coverage reports |
| Secret Scanning | Gitleaks (600+ patterns) |
npm installcp env.example .envFill in the required values:
# Database
DATABASE_URL="file:./dev.db"
# Auth mode: "LDAP" or "SSO"
AUTH_MODE="LDAP"
MOCK_LDAP="true" # Set false to bind to a real LDAP server
LDAP_URL="ldap://your-server:389"
LDAP_SEARCH_FILTER="(|(sAMAccountName=%s)(userPrincipalName=%s))"
# SSO / OIDC (only if AUTH_MODE="SSO")
OAUTH_CLIENT_ID="your-client-id"
OAUTH_CLIENT_SECRET="your-client-secret"
OAUTH_AUTH_URL="https://accounts.google.com/o/oauth2/v2/auth"
OAUTH_TOKEN_URL="https://oauth2.googleapis.com/token"
OAUTH_REDIRECT_URI="http://localhost:3000/api/auth/callback"
# Role control β comma-separated approver usernames
APPROVERS="admin,supervisor.name"npx prisma db pushnpm run devHeimdall defaults to SQLite for zero-config local development, but supports MySQL and PostgreSQL for production.
npm run db:mysql # Switch to MySQL
npm run db:postgres # Switch to PostgreSQLUpdate DATABASE_URL in .env, then apply the schema:
npx prisma migrate dev --name initnpm run db:sqliteUpdate DATABASE_URL to file:./dev.db, then sync:
npx prisma db push# Build (SQLite β default)
docker build -t heimdall-platform .
# Build (MySQL)
docker build -t heimdall-platform --build-arg DATABASE_PROVIDER=mysql .
# Run
docker run -p 3000:3000 --env-file .env -d heimdall-platformnpm run test # Watch mode
npm run test:coverage # Full coverage reportThe test suite covers API routes, React components, and utility functions with a target of β₯90% statement coverage and β₯80% branch coverage.
Contributions are welcome! Please read CONTRIBUTING.md before opening a PR.
Key requirements:
- Follow the Conventional Commits format (
feat:,fix:,test:, etc.) - All PRs must pass
npm run lintwith 0 errors andnpm run test:coveragewith all tests passing - Install the pre-commit hooks before committing:
brew install pre-commit gitleaks
pre-commit installUse the Bug Report or Feature Request templates for issues.
- Session Integrity: Stateless session cookies are managed securely on every request.
- Secret Scanning: Gitleaks scans every commit via pre-commit hooks and the CI pipeline, blocking 600+ known secret patterns before they reach the repository.
- Environment Strictness: Unless
FORCE_HTTPS=trueis set, development setups bypass theSecurecookie flag to allow local/network hosting during development. - HMR Strictness: If developing over a network,
next.config.tsdynamically resolves local IPs to allow Turbopack hot-reloading across VM arrays.
