Skip to content

Commit 2995ba6

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

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
@@ -3849,7 +3849,7 @@ mod tests {
38493849
use rustls::pki_types::CertificateDer;
38503850
let dir = tempdir().unwrap();
38513851
let (ca, ca_key) = generate_test_certs_with_ca(dir.path());
3852-
let mut params = rcgen::CertificateParams::new(Vec::<String>::new()).unwrap();
3852+
let mut params = CertificateParams::new(Vec::<String>::new()).unwrap();
38533853
params
38543854
.distinguished_name
38553855
.push(rcgen::DnType::CommonName, "discovery-proxy");
@@ -3863,7 +3863,7 @@ mod tests {
38633863
let key_pem = client_key.serialize_pem().unwrap();
38643864
let client_pem_key = key_pem.clone();
38653865
let fingerprint = hex::encode(openshell_crypto::sha256(client_cert.as_ref()).unwrap());
3866-
std::fs::write(dir.path().join("grants.json"),serde_json::to_vec(&serde_json::json!({"readers":[{"certificate_sha256":fingerprint,"all_workspaces":true}]})).unwrap()).unwrap();
3866+
fs::write(dir.path().join("grants.json"),serde_json::to_vec(&serde_json::json!({"readers":[{"certificate_sha256":fingerprint,"all_workspaces":true}]})).unwrap()).unwrap();
38673867
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
38683868
let addr = listener.local_addr().unwrap();
38693869
let mut state = test_state(addr, false).await;
@@ -3950,7 +3950,7 @@ mod tests {
39503950
.unwrap()
39513951
.into_inner();
39523952
assert!(watch.message().await.unwrap().is_some());
3953-
std::fs::write(dir.path().join("grants.json"), r#"{"readers":[]}"#).unwrap();
3953+
fs::write(dir.path().join("grants.json"), r#"{"readers":[]}"#).unwrap();
39543954
assert_eq!(
39553955
tokio::time::timeout(Duration::from_secs(3), watch.message())
39563956
.await

0 commit comments

Comments
 (0)