Package io.jans.fido2.service.trust
Class NativeFailureDiagnostics
java.lang.Object
io.jans.fido2.service.trust.NativeFailureDiagnostics
Recovers the native-failure diagnostic, if any, from the exception that failed a registration or
authentication ceremony. Mirrors
AttestationTrustDiagnostics for the same reasons: the code
is read from a Fido2NativeFailureException in the cause chain rather than matched against
the exception message, so rewording a log string never silently stops classifying failures.
Failures that are not one of these diagnostics resolve to null, and the caller keeps the
original message — nothing is lost for them.
- Author:
- Janssen Project
-
Method Summary
Modifier and TypeMethodDescriptionstatic Fido2NativeFailureExceptionFinds the native failure behind a ceremony error.static NativeFailureDiagnosticConvenience for the enum constant itself, for callers that need more than the name.static StringresolveCode(Throwable error) The diagnostic code to record for a ceremony failure.
-
Method Details
-
find
Finds the native failure behind a ceremony error.- Parameters:
error- the exception that failed the ceremony; may be null- Returns:
- the
Fido2NativeFailureExceptionthat describes the failure, ornullwhen the failure was not one of these diagnostics
-
resolveCode
The diagnostic code to record for a ceremony failure.- Parameters:
error- the exception that failed the ceremony; may be null- Returns:
- the code name, or
nullwhen the failure was not one of these diagnostics
-
resolve
Convenience for the enum constant itself, for callers that need more than the name.
-