Skip to content

Commit

Permalink
chore(ci): Fix clippy; lisence template for new files
Browse files Browse the repository at this point in the history
  • Loading branch information
itsyaasir committed Aug 30, 2024
1 parent 409b153 commit dbaefa2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions identity_core/src/custom_time.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! An implementation of `now_utc` which calls out to an externally defined function.
use crate::common::Timestamp;

Expand Down
3 changes: 3 additions & 0 deletions identity_core/tests/custom_time.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020-2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use identity_core::common::Timestamp;
use identity_core::register_custom_now_utc;

Expand Down
23 changes: 10 additions & 13 deletions identity_jose/src/tests/rfc8037.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,18 @@ fn test_rfc8037_ed25519() {
.decode_compact_serialization(jws.as_bytes(), None)
.and_then(|decoded| decoded.verify(&jws_verifier, &public))
.unwrap();
let jws_signature_verifier = JwsVerifierFn::from(|input: VerificationInput, key: &Jwk| match input.alg {
JwsAlgorithm::EdDSA => ed25519::verify(input, key),
other => unimplemented!("{other}"),
});

#[cfg(feature = "eddsa")]
{
let jws_signature_verifier = JwsVerifierFn::from(|input: VerificationInput, key: &Jwk| match input.alg {
JwsAlgorithm::EdDSA => ed25519::verify(input, key),
other => unimplemented!("{other}"),
});
let decoder = Decoder::new();
let token_with_default = decoder
.decode_compact_serialization(jws.as_bytes(), None)
.and_then(|decoded| decoded.verify(&jws_signature_verifier, &public))
.unwrap();

let decoder = Decoder::new();
let token_with_default = decoder
.decode_compact_serialization(jws.as_bytes(), None)
.and_then(|decoded| decoded.verify(&jws_signature_verifier, &public))
.unwrap();
assert_eq!(token, token_with_default);
}
assert_eq!(token, token_with_default);
assert_eq!(token.protected, header);
assert_eq!(token.claims, tv.payload.as_bytes());
}
Expand Down

0 comments on commit dbaefa2

Please sign in to comment.