tangled
alpha
login
or
join now
nekomimi.pet
/
jacquard
forked from
nonbinary.computer/jacquard
0
fork
atom
A better Rust ATProto crate
0
fork
atom
overview
issues
pulls
pipelines
add tracing feature to jacquard-axum
nekomimi.pet
3 months ago
69a15524
8e89ab79
verified
This commit was signed with the committer's
known signature
.
nekomimi.pet
SSH Key Fingerprint:
SHA256:knUvGhH8rbrdqbzO9WXAIaTK0LrdYw2UC0qWB43Ic0Q=
+18
-3
2 changed files
expand all
collapse all
unified
split
crates
jacquard-axum
Cargo.toml
src
service_auth.rs
+1
crates/jacquard-axum/Cargo.toml
···
39
39
[features]
40
40
default = ["service-auth"]
41
41
service-auth = ["jacquard-common/service-auth", "dep:jacquard-identity", "dep:multibase"]
42
42
+
tracing = []
42
43
43
44
[dev-dependencies]
44
45
axum-macros = "0.5.0"
+17
-3
crates/jacquard-axum/src/service_auth.rs
···
572
572
573
573
match codec {
574
574
// p256-pub (0x1200)
575
575
-
[0x80, 0x24] => PublicKey::from_p256_bytes(key_material).ok(),
575
575
+
[0x80, 0x24] => PublicKey::from_p256_bytes(key_material)
576
576
+
.inspect_err(|_e| {
577
577
+
#[cfg(feature = "tracing")]
578
578
+
tracing::error!("Failed to parse p256 public key: {}", _e);
579
579
+
})
580
580
+
.ok(),
576
581
// secp256k1-pub (0xe7)
577
577
-
[0xe7, 0x01] => PublicKey::from_k256_bytes(key_material).ok(),
578
578
-
_ => None,
582
582
+
[0xe7, 0x01] => PublicKey::from_k256_bytes(key_material)
583
583
+
.inspect_err(|_e| {
584
584
+
#[cfg(feature = "tracing")]
585
585
+
tracing::error!("Failed to parse secp256k1 public key: {}", _e);
586
586
+
})
587
587
+
.ok(),
588
588
+
_ => {
589
589
+
#[cfg(feature = "tracing")]
590
590
+
tracing::error!("Unsupported public key multicodec: {:?}", codec);
591
591
+
None
592
592
+
}
579
593
}
580
594
}
581
595