Fix dleq logging (#670)

* fix: dleq logging

* feat: log wallet auth for request
This commit is contained in:
thesimplekid
2025-03-24 12:50:54 +00:00
committed by GitHub
parent be93ff2384
commit b3ae76d6c7
2 changed files with 12 additions and 6 deletions

View File

@@ -194,7 +194,7 @@ impl TryFrom<Proof> for AuthProof {
keyset_id: value.keyset_id,
secret: value.secret,
c: value.c,
dleq: value.dleq.ok_or({
dleq: value.dleq.ok_or_else(|| {
tracing::warn!("Dleq proof not included in auth");
Error::DleqProofNotIncluded
})?,

View File

@@ -296,12 +296,18 @@ impl AuthWallet {
) -> Result<Option<AuthToken>, Error> {
match self.is_protected(method).await {
Some(auth) => match auth {
AuthRequired::Clear => self.client.get_auth_token().await.map(Some),
AuthRequired::Clear => {
tracing::trace!("Clear auth needed for request.");
self.client.get_auth_token().await.map(Some)
}
AuthRequired::Blind => {
let proof = self
.get_blind_auth_token()
.await?
.ok_or(Error::InsufficientBlindAuthTokens)?;
tracing::trace!("Blind auth needed for request getting Auth proof.");
let proof = self.get_blind_auth_token().await?.ok_or_else(|| {
tracing::debug!(
"Insufficient blind auth proofs in wallet. Must mint bats."
);
Error::InsufficientBlindAuthTokens
})?;
Ok(Some(proof))
}