- Introduce coding standards, testing commands, and tool usage. - Outline architecture notes, style, and logging conventions. - Provide guidance on modular design and authentication protocols.
1.2 KiB
1.2 KiB
Vault-Hier Development Guidelines
Build & Test Commands
- Build & run:
cargo build && cargo run - Run tests:
cargo test(orcargo test -- --nocapturefor verbose output) - Run single test:
cargo test test_name -- --nocapture - Docker test:
./test_docker.sh(includes vault initialization) - Local test:
./test_local.sh(sets up local vault) - Lint:
cargo clippy -- -D warnings - Format:
cargo fmt --all
Code Style Guidelines
- Formatting: Follow rustfmt conventions (run
cargo fmtbefore committing) - Imports: Group by crate (stdlib → external → internal)
- Error Handling: Use
anyhowwith descriptive messages; propagate with?orthiserrorfor actionable errors - Naming: Snake case for functions/variables, CamelCase for types
- Async: Use Tokio for async runtime with structured task management
- Logging: Use
tracingmacros for structured logging (info!,debug!,error!,warn!,trace!) - Documentation: Document public APIs with doc comments (
///)
Architecture Notes
- Modular design with separate services (document, vault, API)
- Hierarchical signing with department validation
- JWT-based authentication using Vault transit backend