From ceef67356cc520e04c4c93c146326a235ddea8a3 Mon Sep 17 00:00:00 2001 From: Ben Leggett <854255+bleggett@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:25:23 -0400 Subject: [PATCH] `cargo fmt` fixes + makefile (#97) Signed-off-by: Benjamin Leggett --- Makefile | 4 ++++ spiffe/src/proto/workload.rs | 1 + spiffe/src/spiffe_id/mod.rs | 2 +- spiffe/src/svid/jwt/mod.rs | 5 ----- spiffe/src/svid/x509/mod.rs | 2 +- spiffe/src/workload_api/client.rs | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1ee949a --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +.PHONY: lint +lint: + @cargo +nightly fmt --check + @cargo clippy diff --git a/spiffe/src/proto/workload.rs b/spiffe/src/proto/workload.rs index cbe7eba..ac7f945 100644 --- a/spiffe/src/proto/workload.rs +++ b/spiffe/src/proto/workload.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// The X509SVIDRequest message conveys parameters for requesting an X.509-SVID. /// There are currently no request parameters. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/spiffe/src/spiffe_id/mod.rs b/spiffe/src/spiffe_id/mod.rs index fe9560d..d5e4465 100644 --- a/spiffe/src/spiffe_id/mod.rs +++ b/spiffe/src/spiffe_id/mod.rs @@ -252,7 +252,7 @@ impl TrustDomain { /// # Arguments /// /// * `id_or_name` - Name of a trust domain, it also can be a SPIFFE ID string from which the domain name - /// is extracted. + /// is extracted. /// /// # Errors /// diff --git a/spiffe/src/svid/jwt/mod.rs b/spiffe/src/svid/jwt/mod.rs index aea20bc..39b528b 100644 --- a/spiffe/src/svid/jwt/mod.rs +++ b/spiffe/src/svid/jwt/mod.rs @@ -138,11 +138,6 @@ impl Claims { } } -#[derive(Debug, Clone, PartialEq)] -struct Header { - inner: jsonwebtoken::Header, -} - impl JwtSvid { /// Parses the given token verifying the token signature using the provided [`BundleSource`] as /// a source of [`JwtBundle`], validating the audience in the token with the expected audience, diff --git a/spiffe/src/svid/x509/mod.rs b/spiffe/src/svid/x509/mod.rs index ccde757..08bc77d 100644 --- a/spiffe/src/svid/x509/mod.rs +++ b/spiffe/src/svid/x509/mod.rs @@ -79,7 +79,7 @@ impl X509Svid { /// # Arguments /// /// * `cert_chain_der` - Slice of bytes representing a chain of certificates as ASN.1 DER-encoded (concatenated - /// with no intermediate padding if there are more than one certificate). + /// with no intermediate padding if there are more than one certificate). /// /// * `private_key_der` - Slice of bytes representing a private key as ASN.1 DER in PKCS#8 format. /// diff --git a/spiffe/src/workload_api/client.rs b/spiffe/src/workload_api/client.rs index 247e615..1b104ff 100644 --- a/spiffe/src/workload_api/client.rs +++ b/spiffe/src/workload_api/client.rs @@ -294,7 +294,7 @@ impl WorkloadApiClient { /// /// * `audience` - A list of audiences to include in the JWT token. Cannot be empty nor contain only empty strings. /// * `spiffe_id` - Optional [`SpiffeId`] for the token 'sub' claim. If not provided, the Workload API returns the - /// default identity. + /// default identity. /// /// # Errors /// @@ -322,7 +322,7 @@ impl WorkloadApiClient { /// /// * `audience` - A list of audiences to include in the JWT token. Cannot be empty nor contain only empty strings. /// * `spiffe_id` - Optional reference [`SpiffeId`] for the token 'sub' claim. If not provided, the Workload API returns the - /// default identity, + /// default identity, /// /// # Errors ///