Skip to content

Commit 0080bfd

Browse files
committed
address comments
1 parent 7b711d5 commit 0080bfd

5 files changed

Lines changed: 12 additions & 50 deletions

File tree

Cargo.lock

Lines changed: 6 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ educe = "0.6"
121121
spire-api = "0.3.6"
122122
spiffe = "0.7"
123123
tempfile = { version = "3.23", optional = true}
124-
hyperlocal = "0.9.1"
125124
mockall = "0.14.0"
126125

127126
[target.'cfg(target_os = "linux")'.dependencies]

src/identity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub enum Error {
5757
Forgotten,
5858
#[error("BUG: identity requested {0}, but only allowed {1:?}")]
5959
BugInvalidIdentityRequest(Identity, Arc<WorkloadInfo>),
60-
#[error("failed to fetch pid for workload: {0}")]
60+
#[error("failed to fetch bundle for workload: {0}")]
6161
FailedToFetchBundle(String),
6262
#[error("certificate is in invalid format")]
6363
CertificateInvalidFormat(),

src/identity/manager.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,10 +1377,7 @@ mod tests {
13771377
test.caclient.set_error(true).await;
13781378
assert!(
13791379
test.caclient
1380-
.fetch_certificate(&CompositeId::with_key(
1381-
id.clone(),
1382-
id.clone(),
1383-
))
1380+
.fetch_certificate(&CompositeId::with_key(id.clone(), id.clone(),))
13841381
.await
13851382
.is_err()
13861383
);

src/identity/spireclient.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,8 @@ pub mod spire_tests {
473473

474474
assert!(identity.to_string() == "spiffe://example.org/ns/default/sa/test-sa");
475475

476-
let composite_id = CompositeId::with_key(
477-
identity,
478-
WorkloadUid::new("uid-123456".to_string()),
479-
);
476+
let composite_id =
477+
CompositeId::with_key(identity, WorkloadUid::new("uid-123456".to_string()));
480478

481479
let fetch_result = spire_client.fetch_certificate(&composite_id).await;
482480

@@ -676,10 +674,8 @@ pub mod spire_tests {
676674

677675
assert!(identity.to_string() == "spiffe://example.org/ns/default/sa/test-sa");
678676

679-
let composite_id = CompositeId::with_key(
680-
identity,
681-
WorkloadUid::new("uid-123456".to_string()),
682-
);
677+
let composite_id =
678+
CompositeId::with_key(identity, WorkloadUid::new("uid-123456".to_string()));
683679

684680
let fetch_result = spire_client.fetch_certificate(&composite_id).await;
685681

@@ -793,8 +789,6 @@ pub mod spire_tests {
793789
fn mock_stream_svid_success_response(
794790
spiffe_id: String,
795791
) -> Box<dyn Stream<Item = Result<X509Svid, GrpcClientError>> + Send + Unpin> {
796-
// build a stream that yields X509Svid responses
797-
// can you provide a minimal example of building such a stream?
798792
let (mut tx, rx) = mpsc::channel(10);
799793
tokio::spawn(async move {
800794
let svid = generate_svid(&spiffe_id, "example.org");
@@ -806,8 +800,6 @@ pub mod spire_tests {
806800
fn mock_stream_svid_success_delay_response(
807801
spiffe_id: String,
808802
) -> Box<dyn Stream<Item = Result<X509Svid, GrpcClientError>> + Send + Unpin> {
809-
// build a stream that yields X509Svid responses
810-
// can you provide a minimal example of building such a stream?
811803
let (mut tx, rx) = mpsc::channel(10);
812804
tokio::spawn(async move {
813805
tx.send(Err(GrpcClientError::EmptyResponse)).await.unwrap();
@@ -823,8 +815,6 @@ pub mod spire_tests {
823815
fn mock_stream_svid_success_delay_response_timeout(
824816
_: String,
825817
) -> Box<dyn Stream<Item = Result<X509Svid, GrpcClientError>> + Send + Unpin> {
826-
// build a stream that yields X509Svid responses
827-
// can you provide a minimal example of building such a stream?
828818
let (_, rx) = mpsc::channel(10);
829819
tokio::spawn(async move {
830820
tokio::time::sleep(std::time::Duration::from_secs(10)).await;
@@ -835,8 +825,6 @@ pub mod spire_tests {
835825
fn mock_stream_svid_success_delay_response_timeout_empty(
836826
_: String,
837827
) -> Box<dyn Stream<Item = Result<X509Svid, GrpcClientError>> + Send + Unpin> {
838-
// build a stream that yields X509Svid responses
839-
// can you provide a minimal example of building such a stream?
840828
let (mut tx, rx) = mpsc::channel(10);
841829
tokio::spawn(async move {
842830
tx.send(Err(GrpcClientError::EmptyResponse)).await.unwrap();

0 commit comments

Comments
 (0)