A better Rust ATProto crate

clean up more debug logs #5

closed opened by nekomimi.pet targeting main from nekomimi.pet/jacquard: main

this also gates the tracing logs in axum under a tracing feature, i can nix this if need be

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:ttdrpj45ibqunmfhdsb4zdwq/sh.tangled.repo.pull/3maddkhcucj22
+16 -18
Diff #0
+1 -4
crates/jacquard/src/client/bff_session.rs
··· 107 107 })?; 108 108 Ok(Some(data)) 109 109 } 110 - Err(gloo_storage::errors::StorageError::KeyNotFound(err)) => { 111 - tracing::debug!("gloo error: {}", err); 112 - Ok(None) 113 - } 110 + Err(gloo_storage::errors::StorageError::KeyNotFound(_)) => Ok(None), 114 111 Err(e) => Err(SessionStoreError::Other( 115 112 format!("SessionStorage error: {}", e).into(), 116 113 )),
+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 + tracing = [] 42 43 43 44 [dev-dependencies] 44 45 axum-macros = "0.5.0"
+14 -7
crates/jacquard-axum/src/service_auth.rs
··· 572 572 573 573 match codec { 574 574 // p256-pub (0x1200) 575 - [0x80, 0x24] => PublicKey::from_p256_bytes(key_material).inspect_err(|e| { 576 - tracing::error!("Failed to parse p256 public key: {}", e); 577 - }).ok(), 575 + [0x80, 0x24] => PublicKey::from_p256_bytes(key_material) 576 + .inspect_err(|_e| { 577 + #[cfg(feature = "tracing")] 578 + tracing::error!("Failed to parse p256 public key: {}", _e); 579 + }) 580 + .ok(), 578 581 // secp256k1-pub (0xe7) 579 - [0xe7, 0x01] => PublicKey::from_k256_bytes(key_material).inspect_err(|e| { 580 - tracing::error!("Failed to parse secp256k1 public key: {}", e); 581 - }).ok(), 582 + [0xe7, 0x01] => PublicKey::from_k256_bytes(key_material) 583 + .inspect_err(|_e| { 584 + #[cfg(feature = "tracing")] 585 + tracing::error!("Failed to parse secp256k1 public key: {}", _e); 586 + }) 587 + .ok(), 582 588 _ => { 589 + #[cfg(feature = "tracing")] 583 590 tracing::error!("Unsupported public key multicodec: {:?}", codec); 584 591 None 585 - }, 592 + } 586 593 } 587 594 } 588 595
-2
crates/jacquard-oauth/src/client.rs
··· 280 280 token_set, 281 281 }; 282 282 283 - dbg!(&client_data); 284 - 285 283 self.create_session(client_data).await 286 284 } 287 285 Err(e) => Err(e.into()),
-5
crates/jacquard-oauth/src/request.rs
··· 517 517 prompt: prompt.map(CowStr::from), 518 518 }; 519 519 520 - #[cfg(feature = "tracing")] 521 - tracing::debug!( 522 - parameters = ?parameters, 523 - "par:" 524 - ); 525 520 if metadata 526 521 .server_metadata 527 522 .pushed_authorization_request_endpoint

History

1 round 2 comments
sign up or login to add to the discussion
nekomimi.pet submitted #0
2 commits
expand
clean up debug logs
add tracing feature to jacquard-axum
expand 2 comments

crap, meant to pull this into the release, will do another version bump in a bit, this is good overall. need to take a real look over logging/errors again.

i did actually merge this, i think tangled just got confused with the jujutsu rebase on top of your merge i did

closed without merging