Skip to content

Commit 589f85d

Browse files
committed
test(auth): use shared imports in discovery certificate coverage
Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
1 parent a2b3bee commit 589f85d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • crates/openshell-server/src

‎crates/openshell-server/src/lib.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3749,7 +3749,7 @@ mod tests {
37493749
use rustls::pki_types::CertificateDer;
37503750
let dir = tempdir().unwrap();
37513751
let (ca, ca_key) = generate_test_certs_with_ca(dir.path());
3752-
let mut params = rcgen::CertificateParams::new(Vec::<String>::new()).unwrap();
3752+
let mut params = CertificateParams::new(Vec::<String>::new()).unwrap();
37533753
params
37543754
.distinguished_name
37553755
.push(rcgen::DnType::CommonName, "discovery-proxy");
@@ -3763,7 +3763,7 @@ mod tests {
37633763
let key_pem = client_key.serialize_pem().unwrap();
37643764
let client_pem_key = key_pem.clone();
37653765
let fingerprint = hex::encode(openshell_crypto::sha256(client_cert.as_ref()).unwrap());
3766-
std::fs::write(dir.path().join("grants.json"),serde_json::to_vec(&serde_json::json!({"readers":[{"certificate_sha256":fingerprint,"all_workspaces":true}]})).unwrap()).unwrap();
3766+
fs::write(dir.path().join("grants.json"),serde_json::to_vec(&serde_json::json!({"readers":[{"certificate_sha256":fingerprint,"all_workspaces":true}]})).unwrap()).unwrap();
37673767
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
37683768
let addr = listener.local_addr().unwrap();
37693769
let mut state = test_state(addr, false).await;
@@ -3841,7 +3841,7 @@ mod tests {
38413841
.unwrap()
38423842
.into_inner();
38433843
assert!(watch.message().await.unwrap().is_some());
3844-
std::fs::write(dir.path().join("grants.json"), r#"{"readers":[]}"#).unwrap();
3844+
fs::write(dir.path().join("grants.json"), r#"{"readers":[]}"#).unwrap();
38453845
assert_eq!(
38463846
tokio::time::timeout(Duration::from_secs(3), watch.message())
38473847
.await

0 commit comments

Comments
 (0)