Challenge-response for attestation #411
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#L782
warning: unneeded `return` statement
--> trustchain-http/src/attestation_utils.rs:782:5
|
782 | 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`
|
782 - return Ok(endpoints[0].clone());
782 + Ok(endpoints[0].clone())
|
|
unneeded `return` statement:
trustchain-http/src/attestation_utils.rs#L756
warning: unneeded `return` statement
--> trustchain-http/src/attestation_utils.rs:756:13
|
756 | 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`
|
756 - return String::from("Challenge-response complete.");
756 + String::from("Challenge-response complete.")
|
|
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("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`
|
753 - return String::from("Content challenge has been presented. Await response.");
753 + String::from("Content challenge has been presented. Await response.")
|
|
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-response initiated. 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-response initiated. Await response.");
750 + String::from("Content challenge-response initiated. 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("Identity challenge-response complete.");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
747 - return String::from("Identity challenge-response complete.");
747 + String::from("Identity challenge-response complete.")
|
|
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 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`
|
744 - return String::from("Identity challenge has been presented. Await response.");
744 + String::from("Identity challenge has been presented. Await response.")
|
|
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-response initiated. 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-response initiated. Await response.");
741 + String::from("Identity challenge-response initiated. 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("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`
|
738 - return String::from("No records found for this challenge-response identifier. \nThe challenge-response process has not been initiated yet.");
738 + 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#L698
warning: unneeded `return` statement
--> trustchain-http/src/attestation_utils.rs:698:9
|
698 | return Ok(current_state);
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
698 - return Ok(current_state);
698 + Ok(current_state)
|
|
unneeded `return` statement:
trustchain-http/src/attestation_utils.rs#L615
warning: unneeded `return` statement
--> trustchain-http/src/attestation_utils.rs:615:9
|
615 | return false;
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
615 - return false;
615 + false
|
|
you should consider adding a `Default` implementation for `CRState`:
trustchain-http/src/attestation_utils.rs#L576
warning: you should consider adding a `Default` implementation for `CRState`
--> trustchain-http/src/attestation_utils.rs:576:5
|
576 | / pub fn new() -> Self {
577 | | Self {
578 | | identity_cr_initiation: None,
579 | | identity_challenge_response: None,
... |
582 | | }
583 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
575 + impl Default for CRState {
576 + fn default() -> Self {
577 + Self::new()
578 + }
579 + }
|
|
unneeded `return` statement:
trustchain-http/src/attestation_utils.rs#L510
warning: unneeded `return` statement
--> trustchain-http/src/attestation_utils.rs:510:9
|
510 | 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`
|
510 - return self.challenge_complete() && self.content_response_signature.is_some();
510 + self.challenge_complete() && self.content_response_signature.is_some()
|
|
unneeded `return` statement:
trustchain-http/src/attestation_utils.rs#L506
warning: unneeded `return` statement
--> trustchain-http/src/attestation_utils.rs:506:9
|
506 | 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`
|
506 - return self.content_nonce.is_some() && self.content_challenge_signature.is_some();
506 + 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#L497
warning: you should consider adding a `Default` implementation for `ContentCRChallenge`
--> trustchain-http/src/attestation_utils.rs:497:5
|
497 | / pub fn new() -> Self {
498 | | Self {
499 | | content_nonce: None,
500 | | content_challenge_signature: None,
501 | | content_response_signature: None,
502 | | }
503 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
496 + impl Default for ContentCRChallenge {
497 + fn default() -> Self {
498 + Self::new()
499 + }
500 + }
|
|
the borrowed expression implements the required traits:
trustchain-http/src/attestation_utils.rs#L468
warning: the borrowed expression implements the required traits
--> trustchain-http/src/attestation_utils.rs:468:47
|
468 | 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#L457
warning: unneeded `return` statement
--> trustchain-http/src/attestation_utils.rs:457:9
|
457 | 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`
|
457 - return self.requester_did.is_some();
457 + self.requester_did.is_some()
|
|
you should consider adding a `Default` implementation for `ContentCRInitiation`:
trustchain-http/src/attestation_utils.rs#L450
warning: you should consider adding a `Default` implementation for `ContentCRInitiation`
--> trustchain-http/src/attestation_utils.rs:450:5
|
450 | / pub fn new() -> Self {
451 | | Self {
452 | | requester_did: None,
453 | | }
454 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
449 + impl Default for ContentCRInitiation {
450 + fn default() -> Self {
451 + Self::new()
452 + }
453 + }
|
|
the borrowed expression implements the required traits:
trustchain-http/src/attestation_utils.rs#L333
warning: the borrowed expression implements the required traits
--> trustchain-http/src/attestation_utils.rs:333:46
|
333 | 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#L321
warning: unneeded `return` statement
--> trustchain-http/src/attestation_utils.rs:321:9
|
321 | 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`
|
321 - return self.challenge_complete() && self.identity_response_signature.is_some();
321 + self.challenge_complete() && self.identity_response_signature.is_some()
|
|
unneeded `return` statement:
trustchain-http/src/attestation_utils.rs#L315
warning: unneeded `return` statement
--> trustchain-http/src/attestation_utils.rs:315:9
|
315 | / return self.update_p_key.is_some()
316 | | && self.identity_nonce.is_some()
317 | | && 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`
|
315 ~ self.update_p_key.is_some()
316 + && self.identity_nonce.is_some()
317 ~ && self.identity_challenge_signature.is_some()
|
|
you should consider adding a `Default` implementation for `IdentityCRChallenge`:
trustchain-http/src/attestation_utils.rs#L303
warning: you should consider adding a `Default` implementation for `IdentityCRChallenge`
--> trustchain-http/src/attestation_utils.rs:303:5
|
303 | / pub fn new() -> Self {
304 | | Self {
305 | | update_p_key: None,
306 | | update_s_key: None,
... |
310 | | }
311 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
302 + impl Default for IdentityCRChallenge {
303 + fn default() -> Self {
304 + Self::new()
305 + }
306 + }
|
|
the borrowed expression implements the required traits:
trustchain-http/src/attestation_utils.rs#L270
warning: the borrowed expression implements the required traits
--> trustchain-http/src/attestation_utils.rs:270:51
|
270 | 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#L259
warning: the borrowed expression implements the required traits
--> trustchain-http/src/attestation_utils.rs:259:44
|
259 | 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#L248
warning: the borrowed expression implements the required traits
--> trustchain-http/src/attestation_utils.rs:248:44
|
248 | 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#L237
warning: unneeded `return` statement
--> trustchain-http/src/attestation_utils.rs:237:9
|
237 | 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`
|
237 - return self.temp_p_key.is_some() && self.requester_details.is_some();
237 + 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#L227
warning: you should consider adding a `Default` implementation for `IdentityCRInitiation`
--> trustchain-http/src/attestation_utils.rs:227:5
|
227 | / pub fn new() -> Self {
228 | | Self {
229 | | temp_p_key: None,
230 | | temp_s_key: None,
231 | | requester_details: None,
232 | | }
233 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
226 + impl Default for IdentityCRInitiation {
227 + fn default() -> Self {
228 + Self::new()
229 + }
230 + }
|
|
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do:
trustchain-http/src/attestation_utils.rs#L174
warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
--> trustchain-http/src/attestation_utils.rs:174:44
|
174 | 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#L160
warning: the borrowed expression implements the required traits
--> trustchain-http/src/attestation_utils.rs:160:34
|
160 | serde_json::to_value(&self).map_err(|_| TrustchainCRError::FailedToSave)?;
| ^^^^^ 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#L158
warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
--> trustchain-http/src/attestation_utils.rs:158:43
|
158 | 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#L114
warning: you should consider adding a `Default` implementation for `Nonce`
--> trustchain-http/src/attestation_utils.rs:114:5
|
114 | / pub fn new() -> Self {
115 | | Self(
116 | | thread_rng()
117 | | .sample_iter(&Alphanumeric)
... |
121 | | )
122 | | }
| |_____^
|
= 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
|
113 + impl Default for Nonce {
114 + fn default() -> Self {
115 + Self::new()
116 + }
117 + }
|
|
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#L332
warning: variable does not need to be mutable
--> trustchain-http/src/attestation_utils.rs:332:13
|
332 | 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/
|