Skip to content

Challenge-response for attestation #415

Challenge-response for attestation

Challenge-response for attestation #415

Triggered via pull request December 14, 2023 10:04
@pwochnerpwochner
synchronize #162
94-cr-cli
Status Success
Total duration 5m 33s
Artifacts

rust.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

68 warnings
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-cli/src/bin/main.rs#L504
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-cli/src/bin/main.rs:504:65 | 504 | initiate_content_challenge(&path, ddid, &services, &attestor_public_key) | ^^^^^^^^^ help: change this to: `services` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-cli/src/bin/main.rs#L430
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-cli/src/bin/main.rs:430:73 | 430 | let identity_challenge = present_identity_challenge(&did, &temp_p_key)?; | ^^^^ help: change this to: `did` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
unused `std::result::Result` that must be used: trustchain-http/src/attestor.rs#L188
warning: unused `std::result::Result` that must be used --> trustchain-http/src/attestor.rs:188:9 | 188 | content_initiation.elementwise_serialize(&path); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled = note: `#[warn(unused_must_use)]` on by default help: use `let _ = ...` to ignore the resulting value | 188 | let _ = content_initiation.elementwise_serialize(&path); | +++++++
redundant closure: trustchain-http/src/requester.rs#L306
warning: redundant closure --> trustchain-http/src/requester.rs:306:18 | 306 | .map_err(|err| TrustchainCRError::Reqwest(err))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `TrustchainCRError::Reqwest` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
used `unwrap()` on `Some` value: trustchain-http/src/requester.rs#L278
warning: used `unwrap()` on `Some` value --> trustchain-http/src/requester.rs:278:34 | 278 | ... &Some(Value::from(nonce.clone())).unwrap(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap = note: `#[warn(clippy::unnecessary_literal_unwrap)]` on by default help: remove the `Some` and `unwrap()` | 278 - &Some(Value::from(nonce.clone())).unwrap(), 278 + &Value::from(nonce.clone()), |
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/requester.rs#L250
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/requester.rs:250:41 | 250 | let ion_attestor = IONAttestor::new(&ddid); | ^^^^^ help: change this to: `ddid` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/requester.rs#L226
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/requester.rs:226:83 | 226 | let identity_initiation = IdentityCRInitiation::new().elementwise_deserialize(&path); | ^^^^^ help: change this to: `path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/requester.rs#L194
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/requester.rs:194:9 | 194 | &path, | ^^^^^ help: change this to: `path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
redundant closure: trustchain-http/src/requester.rs#L189
warning: redundant closure --> trustchain-http/src/requester.rs:189:18 | 189 | .map_err(|err| TrustchainCRError::Reqwest(err))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `TrustchainCRError::Reqwest` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
redundant closure: trustchain-http/src/requester.rs#L180
warning: redundant closure --> trustchain-http/src/requester.rs:180:18 | 180 | .map_err(|err| TrustchainCRError::Reqwest(err))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `TrustchainCRError::Reqwest` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/requester.rs#L160
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/requester.rs:160:34 | 160 | .elementwise_deserialize(&path) | ^^^^^ help: change this to: `path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
redundant closure: trustchain-http/src/requester.rs#L125
warning: redundant closure --> trustchain-http/src/requester.rs:125:18 | 125 | .map_err(|err| TrustchainCRError::Reqwest(err))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `TrustchainCRError::Reqwest` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/requester.rs#L111
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/requester.rs:111:75 | 111 | .sign_and_encrypt_claim(&decrypted_verified_payload, &temp_s_key, &attestor_p_key) | ^^^^^^^^^^^^^^^ help: change this to: `attestor_p_key` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/requester.rs#L106
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/requester.rs:106:13 | 106 | &attestor_p_key, | ^^^^^^^^^^^^^^^ help: change this to: `attestor_p_key` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
redundant closure: trustchain-http/src/requester.rs#L63
warning: redundant closure --> trustchain-http/src/requester.rs:63:18 | 63 | .map_err(|err| TrustchainCRError::Reqwest(err))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `TrustchainCRError::Reqwest` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/attestor.rs#L375
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/attestor.rs:375:34 | 375 | .elementwise_deserialize(&path) | ^^^^^ help: change this to: `path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/attestor.rs#L359
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/attestor.rs:359:65 | 359 | attestor.sign_and_encrypt_claim(&payload, &signing_key, &temp_p_key); | ^^^^^^^^^^^ help: change this to: `temp_p_key` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/attestor.rs#L354
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/attestor.rs:354:28 | 354 | ssi_to_josekit_jwk(&signing_key_ssi).map_err(|_| TrustchainCRError::FailedToGenerateKey)?; | ^^^^^^^^^^^^^^^^ help: change this to: `signing_key_ssi` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/attestor.rs#L286
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/attestor.rs:286:46 | 286 | let signing_key = ssi_to_josekit_jwk(&signing_key_ssi).unwrap(); | ^^^^^^^^^^^^^^^^ help: change this to: `signing_key_ssi` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
the borrowed expression implements the required traits: trustchain-http/src/attestor.rs#L271
warning: the borrowed expression implements the required traits --> trustchain-http/src/attestor.rs:271:34 | 271 | let path = pathbase.join(&key_id); | ^^^^^^^ help: change this to: `key_id` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/attestor.rs#L223
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/attestor.rs:223:46 | 223 | let signing_key = ssi_to_josekit_jwk(&signing_key_ssi).unwrap(); | ^^^^^^^^^^^^^^^^ help: change this to: `signing_key_ssi` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/attestor.rs#L209
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/attestor.rs:209:29 | 209 | ... &requester_keys.get(key_id).unwrap(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `requester_keys.get(key_id).unwrap()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
statement with no effect: trustchain-http/src/attestor.rs#L152
warning: statement with no effect --> trustchain-http/src/attestor.rs:152:17 | 152 | (StatusCode::BAD_REQUEST, response); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect
statement with no effect: trustchain-http/src/attestor.rs#L145
warning: statement with no effect --> trustchain-http/src/attestor.rs:145:17 | 145 | (StatusCode::OK, respone); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect = note: `#[warn(clippy::no_effect)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/attestor.rs#L124
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/attestor.rs:124:46 | 124 | let signing_key = ssi_to_josekit_jwk(&signing_key_ssi); | ^^^^^^^^^^^^^^^^ help: change this to: `signing_key_ssi` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
the borrowed expression implements the required traits: trustchain-http/src/attestor.rs#L111
warning: the borrowed expression implements the required traits --> trustchain-http/src/attestor.rs:111:34 | 111 | let path = pathbase.join(&key_id); | ^^^^^^^ help: change this to: `key_id` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L779
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:779:5 | 779 | return Ok(endpoints[0].clone()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 779 - return Ok(endpoints[0].clone()); 779 + Ok(endpoints[0].clone()) |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L753
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:753:13 | 753 | return String::from("Challenge-response complete."); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 753 - return String::from("Challenge-response complete."); 753 + String::from("Challenge-response complete.") |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L750
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:750:13 | 750 | return String::from("Content challenge has been presented. Await response."); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 750 - return String::from("Content challenge has been presented. Await response."); 750 + String::from("Content challenge has been presented. Await response.") |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L747
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:747:13 | 747 | return String::from("Content challenge-response initiated. Await response."); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 747 - return String::from("Content challenge-response initiated. Await response."); 747 + String::from("Content challenge-response initiated. Await response.") |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L744
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:744:13 | 744 | return String::from("Identity challenge-response complete."); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 744 - return String::from("Identity challenge-response complete."); 744 + String::from("Identity challenge-response complete.") |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L741
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:741:13 | 741 | return String::from("Identity challenge has been presented. Await response."); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 741 - return String::from("Identity challenge has been presented. Await response."); 741 + String::from("Identity challenge has been presented. Await response.") |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L738
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:738:13 | 738 | return String::from("Identity challenge-response initiated. Await response."); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 738 - return String::from("Identity challenge-response initiated. Await response."); 738 + String::from("Identity challenge-response initiated. Await response.") |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L735
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:735:13 | 735 | ... return String::from("No records found for this challenge-response identifier. \nThe challenge-response process has not been initiated yet.... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 735 - return String::from("No records found for this challenge-response identifier. \nThe challenge-response process has not been initiated yet."); 735 + String::from("No records found for this challenge-response identifier. \nThe challenge-response process has not been initiated yet.") |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L695
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:695:9 | 695 | return Ok(current_state); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 695 - return Ok(current_state); 695 + Ok(current_state) |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L612
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:612:9 | 612 | return false; | ^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 612 - return false; 612 + false |
you should consider adding a `Default` implementation for `CRState`: trustchain-http/src/attestation_utils.rs#L583
warning: you should consider adding a `Default` implementation for `CRState` --> trustchain-http/src/attestation_utils.rs:583:5 | 583 | / pub fn new() -> Self { 584 | | Self { 585 | | identity_cr_initiation: None, 586 | | identity_challenge_response: None, ... | 589 | | } 590 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default help: try adding this | 582 + impl Default for CRState { 583 + fn default() -> Self { 584 + Self::new() 585 + } 586 + } |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L515
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:515:9 | 515 | return self.challenge_complete() && self.content_response_signature.is_some(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 515 - return self.challenge_complete() && self.content_response_signature.is_some(); 515 + self.challenge_complete() && self.content_response_signature.is_some() |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L511
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:511:9 | 511 | return self.content_nonce.is_some() && self.content_challenge_signature.is_some(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 511 - return self.content_nonce.is_some() && self.content_challenge_signature.is_some(); 511 + self.content_nonce.is_some() && self.content_challenge_signature.is_some() |
you should consider adding a `Default` implementation for `ContentCRChallenge`: trustchain-http/src/attestation_utils.rs#L502
warning: you should consider adding a `Default` implementation for `ContentCRChallenge` --> trustchain-http/src/attestation_utils.rs:502:5 | 502 | / pub fn new() -> Self { 503 | | Self { 504 | | content_nonce: None, 505 | | content_challenge_signature: None, 506 | | content_response_signature: None, 507 | | } 508 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default help: try adding this | 501 + impl Default for ContentCRChallenge { 502 + fn default() -> Self { 503 + Self::new() 504 + } 505 + } |
the borrowed expression implements the required traits: trustchain-http/src/attestation_utils.rs#L475
warning: the borrowed expression implements the required traits --> trustchain-http/src/attestation_utils.rs:475:47 | 475 | self.requester_did = match File::open(&requester_details_path) { | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `requester_details_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L464
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:464:9 | 464 | return self.requester_did.is_some(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 464 - return self.requester_did.is_some(); 464 + self.requester_did.is_some() |
you should consider adding a `Default` implementation for `ContentCRInitiation`: trustchain-http/src/attestation_utils.rs#L457
warning: you should consider adding a `Default` implementation for `ContentCRInitiation` --> trustchain-http/src/attestation_utils.rs:457:5 | 457 | / pub fn new() -> Self { 458 | | Self { 459 | | requester_did: None, 460 | | } 461 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default help: try adding this | 456 + impl Default for ContentCRInitiation { 457 + fn default() -> Self { 458 + Self::new() 459 + } 460 + } |
the borrowed expression implements the required traits: trustchain-http/src/attestation_utils.rs#L339
warning: the borrowed expression implements the required traits --> trustchain-http/src/attestation_utils.rs:339:46 | 339 | self.update_p_key = match File::open(&full_path) { | ^^^^^^^^^^ help: change this to: `full_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L327
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:327:9 | 327 | return self.challenge_complete() && self.identity_response_signature.is_some(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 327 - return self.challenge_complete() && self.identity_response_signature.is_some(); 327 + self.challenge_complete() && self.identity_response_signature.is_some() |
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L321
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:321:9 | 321 | / return self.update_p_key.is_some() 322 | | && self.identity_nonce.is_some() 323 | | && self.identity_challenge_signature.is_some(); | |__________________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 321 ~ self.update_p_key.is_some() 322 + && self.identity_nonce.is_some() 323 ~ && self.identity_challenge_signature.is_some() |
you should consider adding a `Default` implementation for `IdentityCRChallenge`: trustchain-http/src/attestation_utils.rs#L309
warning: you should consider adding a `Default` implementation for `IdentityCRChallenge` --> trustchain-http/src/attestation_utils.rs:309:5 | 309 | / pub fn new() -> Self { 310 | | Self { 311 | | update_p_key: None, 312 | | update_s_key: None, ... | 316 | | } 317 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default help: try adding this | 308 + impl Default for IdentityCRChallenge { 309 + fn default() -> Self { 310 + Self::new() 311 + } 312 + } |
the borrowed expression implements the required traits: trustchain-http/src/attestation_utils.rs#L275
warning: the borrowed expression implements the required traits --> trustchain-http/src/attestation_utils.rs:275:51 | 275 | self.requester_details = match File::open(&requester_details_path) { | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `requester_details_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
the borrowed expression implements the required traits: trustchain-http/src/attestation_utils.rs#L264
warning: the borrowed expression implements the required traits --> trustchain-http/src/attestation_utils.rs:264:44 | 264 | self.temp_s_key = match File::open(&temp_s_key_path) { | ^^^^^^^^^^^^^^^^ help: change this to: `temp_s_key_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
the borrowed expression implements the required traits: trustchain-http/src/attestation_utils.rs#L253
warning: the borrowed expression implements the required traits --> trustchain-http/src/attestation_utils.rs:253:44 | 253 | self.temp_p_key = match File::open(&temp_p_key_path) { | ^^^^^^^^^^^^^^^^ help: change this to: `temp_p_key_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
unneeded `return` statement: trustchain-http/src/attestation_utils.rs#L242
warning: unneeded `return` statement --> trustchain-http/src/attestation_utils.rs:242:9 | 242 | return self.temp_p_key.is_some() && self.requester_details.is_some(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return = note: `#[warn(clippy::needless_return)]` on by default help: remove `return` | 242 - return self.temp_p_key.is_some() && self.requester_details.is_some(); 242 + self.temp_p_key.is_some() && self.requester_details.is_some() |
you should consider adding a `Default` implementation for `IdentityCRInitiation`: trustchain-http/src/attestation_utils.rs#L232
warning: you should consider adding a `Default` implementation for `IdentityCRInitiation` --> trustchain-http/src/attestation_utils.rs:232:5 | 232 | / pub fn new() -> Self { 233 | | Self { 234 | | temp_p_key: None, 235 | | temp_s_key: None, 236 | | requester_details: None, 237 | | } 238 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default help: try adding this | 231 + impl Default for IdentityCRInitiation { 232 + fn default() -> Self { 233 + Self::new() 234 + } 235 + } |
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do: trustchain-http/src/attestation_utils.rs#L177
warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do --> trustchain-http/src/attestation_utils.rs:177:44 | 177 | fn elementwise_deserialize(self, path: &PathBuf) -> Result<Option<Self>, TrustchainCRError> | ^^^^^^^^ help: change this to: `&Path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
the borrowed expression implements the required traits: trustchain-http/src/attestation_utils.rs#L163
warning: the borrowed expression implements the required traits --> trustchain-http/src/attestation_utils.rs:163:34 | 163 | serde_json::to_value(&self).map_err(|_| TrustchainCRError::FailedToSerialize)?; | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do: trustchain-http/src/attestation_utils.rs#L161
warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do --> trustchain-http/src/attestation_utils.rs:161:43 | 161 | fn elementwise_serialize(&self, path: &PathBuf) -> Result<(), TrustchainCRError> { | ^^^^^^^^ help: change this to: `&Path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg = note: `#[warn(clippy::ptr_arg)]` on by default
you should consider adding a `Default` implementation for `Nonce`: trustchain-http/src/attestation_utils.rs#L117
warning: you should consider adding a `Default` implementation for `Nonce` --> trustchain-http/src/attestation_utils.rs:117:5 | 117 | / pub fn new() -> Self { 118 | | Self( 119 | | thread_rng() 120 | | .sample_iter(&Alphanumeric) ... | 124 | | ) 125 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default = note: `#[warn(clippy::new_without_default)]` on by default help: try adding this | 116 + impl Default for Nonce { 117 + fn default() -> Self { 118 + Self::new() 119 + } 120 + } |
redundant closure: trustchain-http/src/attestation_encryption_utils.rs#L123
warning: redundant closure --> trustchain-http/src/attestation_encryption_utils.rs:123:58 | 123 | ssi_to_josekit_jwk(&key).map_err(|err| TrustchainCRError::Serde(err))?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `TrustchainCRError::Serde` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure = note: `#[warn(clippy::redundant_closure)]` on by default
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: trustchain-http/src/attestation_encryption_utils.rs#L114
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> trustchain-http/src/attestation_encryption_utils.rs:114:13 | 114 | / match vm { 115 | | VerificationMethod::Map(vm_map) => { 116 | | let key = vm_map 117 | | .get_jwk() ... | 126 | | _ => (), 127 | | } | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match = note: `#[warn(clippy::single_match)]` on by default help: try | 114 ~ if let VerificationMethod::Map(vm_map) = vm { 115 + let key = vm_map 116 + .get_jwk() 117 + .map_err(|_| TrustchainCRError::MissingJWK)?; 118 + let id = key 119 + .thumbprint() 120 + .map_err(|_| TrustchainCRError::MissingJWK)?; 121 + let key_jose = 122 + ssi_to_josekit_jwk(&key).map_err(|err| TrustchainCRError::Serde(err))?; 123 + my_map.insert(id, key_jose); 124 + } |
the borrowed expression implements the required traits: trustchain-http/src/attestation_encryption_utils.rs#L75
warning: the borrowed expression implements the required traits --> trustchain-http/src/attestation_encryption_utils.rs:75:13 | 75 | &payload.claim("claim").unwrap().as_str().unwrap(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `payload.claim("claim").unwrap().as_str().unwrap()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/attestation_encryption_utils.rs#L59
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/attestation_encryption_utils.rs:59:52 | 59 | let decrypter = ECDH_ES.decrypter_from_jwk(&secret_key)?; | ^^^^^^^^^^^ help: change this to: `secret_key` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/attestation_encryption_utils.rs#L52
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/attestation_encryption_utils.rs:52:31 | 52 | self.encrypt(&claims, &public_key) | ^^^^^^^^^^^ help: change this to: `public_key` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/attestation_encryption_utils.rs#L38
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/attestation_encryption_utils.rs:38:52 | 38 | let encrypter = ECDH_ES.encrypter_from_jwk(&public_key)?; | ^^^^^^^^^^^ help: change this to: `public_key` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: trustchain-http/src/attestation_encryption_utils.rs#L25
warning: this expression creates a reference which is immediately dereferenced by the compiler --> trustchain-http/src/attestation_encryption_utils.rs:25:45 | 25 | let signer = ES256K.signer_from_jwk(&secret_key)?; | ^^^^^^^^^^^ help: change this to: `secret_key` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
variable does not need to be mutable: trustchain-http/src/attestation_utils.rs#L338
warning: variable does not need to be mutable --> trustchain-http/src/attestation_utils.rs:338:13 | 338 | let mut full_path = path.join("update_p_key.json"); | ----^^^^^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default
unused import: `trustchain_core::TRUSTCHAIN_DATA`: trustchain-http/src/attestor.rs#L30
warning: unused import: `trustchain_core::TRUSTCHAIN_DATA` --> trustchain-http/src/attestor.rs:30:5 | 30 | use trustchain_core::TRUSTCHAIN_DATA; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unused import: `std::io::BufReader`: trustchain-http/src/attestor.rs#L25
warning: unused import: `std::io::BufReader` --> trustchain-http/src/attestor.rs:25:5 | 25 | use std::io::BufReader; | ^^^^^^^^^^^^^^^^^^
unused import: `std::fs::File`: trustchain-http/src/attestor.rs#L24
warning: unused import: `std::fs::File` --> trustchain-http/src/attestor.rs:24:5 | 24 | use std::fs::File; | ^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
clippy_check
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/