Thank you for your interest in contributing to the Rust SPIFFE libraries!
This project values clear APIs, disciplined changes, and a low-noise contribution process.
- Rust 1.88 or later (see
rust-versioninCargo.toml) make(for running the test suite)- SPIRE agent (for integration tests)
# Clone the repository
git clone https://github.com/maxlambrecht/rust-spiffe.git
cd rust-spiffe
# Quick check (formatting + linting + build, no tests)
make check
# Full check (formatting + linting + build + tests)
make all
# Run full CI checks locally (includes MSRV verification)
make ci
# Run integration tests (requires SPIRE setup)
make integration-tests- Follow standard Rust formatting (
make fmtorcargo fmt) - Run
make lintto check for clippy warnings (orcargo clippydirectly) - Ensure all public APIs are documented (
#![deny(missing_docs)]) - No
unsafecode blocks (enforced by#![deny(unsafe_code)])
# Run tests on all crates (default features only)
make test
# Test a specific crate (full feature matrix)
make spiffe
make spiffe-rustls
make spire-apiIntegration tests require a running SPIRE agent. See
.github/workflows/scripts/run-spire.sh for setup instructions.
# Run all integration tests
make integration-testsThe project includes fuzz targets for validating SPIFFE ID and TrustDomain
parsing logic, located under spiffe/fuzz/.
Fuzzing is used to harden parsing against malformed or adversarial inputs and to enforce core invariants such as round-trip stability and API consistency.
Running fuzz tests locally requires cargo-fuzz and a nightly Rust toolchain.
# Install cargo-fuzz if needed
cargo +nightly install cargo-fuzz --locked
# Run all fuzz targets
make fuzzFuzz tests are not required for every pull request, but contributors touching parsing, validation, or security-sensitive code are encouraged to run them locally.
- Fork and branch: Create a feature branch from
main - Make changes: Follow code style guidelines
- Test: Ensure all tests pass (
make allormake cifor full CI checks) - Document: Update README/docs if needed
- Submit: Open a PR with a clear description
Reviews are done on a best-effort basis. Please allow time for feedback.
- Code follows style guidelines (
make fmt-check,make lint) - All tests pass (
make all) - MSRV compatibility verified (
make msrvormake ci) - Integration tests pass (if applicable)
- Documentation updated (if needed)
- CHANGELOG updated (if applicable)
This project follows Conventional Commits and Conventional Pull Requests.
- PR titles must follow the format:
<type>(<scope>): <description> - Example:
feat(spiffe): add JwtSource API - PRs are squash-merged; the PR title becomes the commit message.
-
Branches are short-lived and named using:
<type>/<short-description> -
Examples:
feat/jwt-sourcefix/bundle-rotationchore/release-0.11.0
-
Branches are deleted after merge.
- Commits must follow Conventional Commits.
- Release commits use the format:
chore(release): <crate> <version>
Pull requests are checked using automated CI, including:
- Formatting and linting
- Unit and integration tests
- Dependency vulnerability scanning (
cargo-audit) - Dependency, license, and source policy checks (
cargo-deny)
New dependencies must comply with the existing policy defined in deny.toml.
- Keep features opt-in (no default features)
- Gate functionality behind feature flags in
Cargo.toml - Update the feature matrix in crate documentation
- Add tests for new functionality
- Open an issue for bugs or feature requests
- Check existing issues and PRs before creating new ones
- Be respectful and constructive in discussions