Skip to content

Log when CTAP2 bio_enrollment responses return None fields#153

Merged
AlfioEmanueleFresta merged 3 commits into
linux-credentials:masterfrom
jkaiwar:let-else-tracing
Dec 26, 2025
Merged

Log when CTAP2 bio_enrollment responses return None fields#153
AlfioEmanueleFresta merged 3 commits into
linux-credentials:masterfrom
jkaiwar:let-else-tracing

Conversation

@jkaiwar
Copy link
Copy Markdown
Contributor

@jkaiwar jkaiwar commented Oct 22, 2025

This PR adds info! logs in the error paths for a couple of BioEnrollment implementation methods, which previously returned Error::Ctap(CtapError::Other) silently under some CTAP requests to channels, where the response had None fields that were expected to be Some.

Maintainers: Are these logs desirable in the context of #14 ? How appropriate are the messages and log-levels I have chosen?

@jkaiwar jkaiwar changed the title Log when CTAP2 bio_enrollment responses return None fields (#14) Log when CTAP2 bio_enrollment responses return None fields Oct 22, 2025
@AlfioEmanueleFresta
Copy link
Copy Markdown
Member

Thanks @jkaiwar!

I believe warn! here would be most appropriate if this is unexpected authenticator behaviour, and causes the request to fail.

If this is more common, debug! would be appropriate. IMO, info! should be few and far between during normal operation, only reserved to high level methods, reporting results.

I would defer to @msirringhaus on the specifics on biometrics enrollment.

@msirringhaus
Copy link
Copy Markdown
Collaborator

I would agree that info!() is too low. If devices do not return these fields, they are in direct violation of the spec. So I would also go to warn!() (or maybe even higher).

@AlfioEmanueleFresta
Copy link
Copy Markdown
Member

I would reserve error! to something the library genuinely can't handle, or high-level operation failures.

@jkaiwar
Copy link
Copy Markdown
Contributor Author

jkaiwar commented Oct 31, 2025

Sounds good @AlfioEmanueleFresta @msirringhaus. I have changed the levels to warn.

Copy link
Copy Markdown
Member

@AlfioEmanueleFresta AlfioEmanueleFresta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jkaiwar!

@AlfioEmanueleFresta AlfioEmanueleFresta merged commit fad2679 into linux-credentials:master Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants