- Install Rust stable.
- Optional tools:
cargo install cargo-mutantscargo install cargo-fuzzcargo install cargo-nextestcargo install cargo-deny
cargo xtask setupThis sets core.hooksPath to .githooks, enabling:
- pre-commit: auto-formats and runs clippy fix on staged Rust/Cargo files.
- pre-push: runs the quality gate (fmt check + cargo check + clippy + test compile).
Both hooks now delegate to xtask:
pre-commit->cargo xtask hook pre-commitpre-push->cargo xtask hook pre-push
This repository uses xtask for automation. You can run these commands via cargo xtask <cmd>.
cargo xtask ci # Main CI pipeline: fmt + clippy + tests + matrix + guard + bdd + no-blob + mutants + fuzz
cargo xtask pr # PR-scoped tests based on git diff (emits JSON receipt)
cargo xtask test # Run all tests with all features
cargo xtask fmt --fix # Fix formatting
cargo xtask clippy # Run clippy with -D warnings
cargo xtask bdd # Run Cucumber BDD tests
cargo xtask fuzz # Fuzz testing (requires cargo-fuzz)
cargo xtask mutants # Mutation testing (requires cargo-mutants)
cargo xtask deny # License/advisory checks (requires cargo-deny)
cargo xtask feature-matrix # Run feature matrix checks (default, no-default, each feature, all-features)
cargo xtask publish-check # Run publish dry-runs in dependency order
cargo xtask publish-preflight # Validate metadata + cargo package --no-verify
cargo xtask no-blob # Enforce no secret-shaped blobs in test/fixture paths
cargo xtask dep-guard # Guard against multiple versions of pinned deps
cargo xtask coverage # Run code coverage (requires cargo-llvm-cov)
cargo xtask nextest # Run tests via cargo-nextest (requires cargo-nextest)
cargo xtask lint-fix # Auto-fix fmt + clippy, then verify
cargo xtask lint-fix --check # Check-only (no mutations)
cargo xtask gate # Pre-push quality gate: fmt check + cargo check + clippy + test compile
cargo xtask bdd-matrix # BDD matrix with feature sets
cargo xtask publish # Publish all crates in dependency order
cargo xtask typos # Spell check (requires typos installed)
cargo xtask typos --fix # Auto-fix typos
cargo xtask setup # Configure git hooks (sets core.hooksPath to .githooks)crates/uselesskey: Public facade crate, re-exports stable API under feature flags.crates/uselesskey-core: Core factory, derivation, caching, and negative fixture traits.crates/uselesskey-<type>: Individual key/certificate type implementations (RSA, ECDSA, Ed25519, HMAC, PGP, Token, X.509).crates/uselesskey-jwk: Typed JWK/JWKS helpers andJwksBuilder.crates/uselesskey-<adapter>: Adapt uselesskey fixtures to third-party library types. Adapter crates are separate crates (not features) to avoid coupling versioning.
Current adapter crates: uselesskey-jsonwebtoken, uselesskey-rustls, uselesskey-tonic, uselesskey-ring, uselesskey-rustcrypto, uselesskey-aws-lc-rs.
BDD contributors: shared step definitions live in
crates/uselesskey-bdd-steps.
- Create a new crate
crates/uselesskey-<name>. - Define a
Specand a factory extension trait in that crate. - Implement
FactoryExtonuselesskey_core::Factory. - Re-export the extension trait in the main
uselesskeycrate. - Add the crate to the workspace
membersin rootCargo.toml. - Add the crate to
publish_check()order inxtask/src/main.rs. - Add the crate to
dependents()inxtask/src/plan.rs.
- Deterministic Stability: Keep deterministic derivation stable. If you must change an algorithm, bump the
derivation_versionin the artifact ID. - No Key Leakage: Debug output (
impl Debug) must never print key material. - Modularity: Prefer small, composable crates over a monolith.
- No Unsafe: All crates must use
#![forbid(unsafe_code)].