mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-18 11:35:40 +01:00
Fix dleq logging (#670)
* fix: dleq logging * feat: log wallet auth for request
This commit is contained in:
@@ -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
|
||||
})?,
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user