Contributing to VaultLens
Thanks for your interest in contributing! VaultLens is an open-source project and welcomes contributions of all kinds — bug fixes, new features, documentation improvements, and feedback.
Ways to Contribute
- Bug reports — open a GitHub issue with reproduction steps
- Feature requests — describe the use case in a GitHub issue before implementing
- Code contributions — fork the repo, make changes on a feature branch, and open a pull request
- Documentation — improvements to this site are always welcome
Prerequisites
Before setting up the development environment you'll need:
- Node.js 22+
- Docker & Docker Compose — for running a local Vault instance
- Git
Quick Start for Contributors
bash
# 1. Fork and clone
git clone https://github.com/YOUR_USERNAME/vaultlens.git
cd vaultlens
# 2. Start a local Vault instance (dev mode, pre-seeded)
docker compose -f docker-compose-development.yml up -d vault vault-init
# 3. Install dependencies and start the dev server
cd app
npm install
npm run devOpen http://localhost:3001 and log in with token root.
See Local Development for the full setup guide.
Project Structure
app/
src/
client/ # React SPA (Vite + TypeScript)
server/ # Express API + Vault proxy
shared/ # Shared types/utilities (policyEvaluator.ts)
vault/
policies/ # HCL ACL policies for bootstrapping
scripts/ # bootstrap.sh seeds local Vault
charts/
vaultlens/ # Helm chart for Kubernetes deployment
docs/ # This documentation site (VitePress)Development Workflow
- Create a feature branch from
main:git checkout -b feature/my-change - Make your changes — see Local Development for dev server details
- Run lint:
cd app && npm run lint - Test the checklist below manually
- Open a pull request against
main
Code Conventions
- TypeScript throughout — no
anyunless unavoidable - No
git commit/git pushfrom CI scripts — leave that to the developer encodeURIComponent()on all user-supplied Vault paths passed to the APIpath.basename()on all file-system path parameters- Vault operations from route handlers use
req.vaultToken— never the system token for user-initiated requests - Webhook URLs must pass the SSRF blocklist — no localhost, private ranges, metadata endpoints
Security Guidelines
- System token is never returned in any API response or log
- Auth routes are mounted before CSRF middleware by design
- Error responses use generic messages only — no stack traces or internal detail
- All new
/api/routes must useauthMiddlewareunless explicitly public
See Security Architecture for the full security model.
Testing Checklist
After making changes, verify these manually:
- Secrets page —
identity/andsystem/engines should NOT appear - Auth Methods — GitHub → Roles tab shows empty table (no 404)
- Breadcrumbs — all segments except the last are clickable links
- Shared secrets — create, copy URL, open in incognito — decrypts correctly
- Permission tester —
demo-user, pathtest, operationcreate→ denied - OIDC callback —
/oidc-callback/:mountPathaccessible without auth - View shared secret —
/shared/:id#keyaccessible without auth - Backup/restore — create backup, delete a secret, restore, secret reappears
- Webhooks — create, test fires; SSRF-blocked URLs are rejected
- Analytics — shows health data and counters
- Branding — change app name/logo, header updates
Commit Style
Use conventional commits:
feat: add webhook retry on failure
fix: handle 403 on KV list endpoint
docs: update configuration reference
chore: bump express to 4.21.2Shell Scripts
vault/scripts/bootstrap.sh must use Unix line endings (LF). The .gitattributes file enforces this — do not change the line endings.
