refactor(spiffe-rustls): sync config builders, material generation, and verifier caching #210
+491
−218
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors
spiffe-rustlsto align withspiffe 0.8.0and to simplify the library’s public surface while improving internal correctness and performance under rotation.What changed
Update to
spiffe 0.8.0spiffe-rustlsandspiffe-rustls-grpc-examples.spiffeAPIs (notably theX509Sourceusage and return types).Client/Server builders are now synchronous
ClientConfigBuilder::build()andServerConfigBuilder::build()are nowfn build(self) -> Result<_>..awaitrequirement in examples and tests and better reflects the fact that building therustls::*Configis fundamentally a synchronous operation (the config remains backed by a liveX509Sourcefor rotation).Material watcher initialization is synchronous and explicit about runtime requirements
MaterialWatcher::new(...)is now synchronous and usestokio::runtime::Handle::try_current()to spawn the update task.Material pipeline cleanup
Vec<Vec<u8>>plumbing withrustls::pki_types::CertificateDerand helper constructors (certs_from_der_bytes,cert_chain_from_der_bytes).roots_from_certs,certified_key_from_chain_and_key).MaterialSnapshotto support cache invalidation.Verifier refactor: decouple, document, and cache
MaterialProvider(replacing the previous “roots-only” abstraction) to allow verifiers to read both roots and generation.WebPki*Verifierinstances to avoid rebuilding verifiers on every handshake while still supporting trust bundle rotation.Crate hygiene improvements
#![deny(missing_docs)],#![deny(unsafe_code)], and clippy (includingpedantic), with targeted allows.Debugimplementations for option structs that avoid printing authorization function internals.[features]section inCargo.toml(no functional change).User-facing impact
build()is no longer async. Downstream code must remove.awaitfrom builder usage.