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 })?; 108 Ok(Some(data)) 109 } 110 - Err(gloo_storage::errors::StorageError::KeyNotFound(err)) => { 111 - tracing::debug!("gloo error: {}", err); 112 - Ok(None) 113 - } 114 Err(e) => Err(SessionStoreError::Other( 115 format!("SessionStorage error: {}", e).into(), 116 )),
··· 107 })?; 108 Ok(Some(data)) 109 } 110 + Err(gloo_storage::errors::StorageError::KeyNotFound(_)) => Ok(None), 111 Err(e) => Err(SessionStoreError::Other( 112 format!("SessionStorage error: {}", e).into(), 113 )),
+1
crates/jacquard-axum/Cargo.toml
··· 39 [features] 40 default = ["service-auth"] 41 service-auth = ["jacquard-common/service-auth", "dep:jacquard-identity", "dep:multibase"] 42 43 [dev-dependencies] 44 axum-macros = "0.5.0"
··· 39 [features] 40 default = ["service-auth"] 41 service-auth = ["jacquard-common/service-auth", "dep:jacquard-identity", "dep:multibase"] 42 + tracing = [] 43 44 [dev-dependencies] 45 axum-macros = "0.5.0"
+14 -7
crates/jacquard-axum/src/service_auth.rs
··· 572 573 match codec { 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(), 578 // 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 _ => { 583 tracing::error!("Unsupported public key multicodec: {:?}", codec); 584 None 585 - }, 586 } 587 } 588
··· 572 573 match codec { 574 // p256-pub (0x1200) 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(), 581 // secp256k1-pub (0xe7) 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(), 588 _ => { 589 + #[cfg(feature = "tracing")] 590 tracing::error!("Unsupported public key multicodec: {:?}", codec); 591 None 592 + } 593 } 594 } 595
-2
crates/jacquard-oauth/src/client.rs
··· 280 token_set, 281 }; 282 283 - dbg!(&client_data); 284 - 285 self.create_session(client_data).await 286 } 287 Err(e) => Err(e.into()),
··· 280 token_set, 281 }; 282 283 self.create_session(client_data).await 284 } 285 Err(e) => Err(e.into()),
-5
crates/jacquard-oauth/src/request.rs
··· 517 prompt: prompt.map(CowStr::from), 518 }; 519 520 - #[cfg(feature = "tracing")] 521 - tracing::debug!( 522 - parameters = ?parameters, 523 - "par:" 524 - ); 525 if metadata 526 .server_metadata 527 .pushed_authorization_request_endpoint
··· 517 prompt: prompt.map(CowStr::from), 518 }; 519 520 if metadata 521 .server_metadata 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