Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Missing Debug Implementations #85

Merged
merged 5 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions spiffe/src/workload_api/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ const SPIFFE_HEADER_VALUE: &str = "true";
/// Supports one-shot calls and streaming updates for X.509 and JWT SVIDs and bundles.
/// The client can be used to fetch the current SVIDs and bundles, as well as to
/// subscribe for updates whenever the SVIDs or bundles change.
#[allow(missing_debug_implementations)]
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct WorkloadApiClient {
client: SpiffeWorkloadApiClient<
tonic::service::interceptor::InterceptedService<tonic::transport::Channel, MetadataAdder>,
Expand Down
10 changes: 7 additions & 3 deletions spiffe/src/workload_api/x509_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ use crate::workload_api::client::WorkloadApiClient;
use crate::workload_api::x509_context::X509Context;
use log::{debug, error, info};
use std::error::Error;
use std::fmt::Debug;
use std::sync::{Arc, PoisonError, RwLock};
use thiserror::Error;
use tokio::sync::watch;
Expand All @@ -80,6 +81,8 @@ use tokio_util::sync::CancellationToken;
/// ```
/// use spiffe::svid::x509::X509Svid;
/// use spiffe::workload_api::x509_source::SvidPicker;
///
/// #[derive(Debug)]
/// struct SecondSvidPicker;
///
/// impl SvidPicker for SecondSvidPicker {
Expand All @@ -88,7 +91,7 @@ use tokio_util::sync::CancellationToken;
/// }
/// }
/// ```
pub trait SvidPicker: Send + Sync {
pub trait SvidPicker: Debug + Send + Sync {
/// Selects an `X509Svid` from the provided slice of `X509Svid`.
///
/// # Parameters
Expand Down Expand Up @@ -131,7 +134,7 @@ impl X509SourceError {
/// `X509Source` implements the [`BundleSource`] and [`SvidSource`] traits.
///
/// The methods return cloned instances of the underlying objects.
#[allow(missing_debug_implementations)]
#[derive(Debug)]
pub struct X509Source {
svid: RwLock<Option<X509Svid>>,
bundles: RwLock<Option<X509BundleSet>>,
Expand All @@ -144,7 +147,7 @@ pub struct X509Source {
}

/// Builder for `X509Source`.
#[allow(missing_debug_implementations)]
#[derive(Debug)]
pub struct X509SourceBuilder {
client: Option<WorkloadApiClient>,
svid_picker: Option<Box<dyn SvidPicker>>,
Expand All @@ -162,6 +165,7 @@ pub struct X509SourceBuilder {
/// use spiffe::workload_api::x509_source::{SvidPicker, X509SourceBuilder};
/// use std::error::Error;
///
/// #[derive(Debug)]
/// struct SecondSvidPicker;
///
/// impl SvidPicker for SecondSvidPicker {
Expand Down
1 change: 1 addition & 0 deletions spiffe/tests/x509_source_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mod integration_tests_x509_source {

static TRUST_DOMAIN: Lazy<TrustDomain> = Lazy::new(|| TrustDomain::new("example.org").unwrap());

#[derive(Debug)]
struct SecondSvidPicker;

impl SvidPicker for SecondSvidPicker {
Expand Down
Loading