Package io.jans.fido2.service.trust
Class AttestationTrustDiagnostics
java.lang.Object
io.jans.fido2.service.trust.AttestationTrustDiagnostics
Recovers the trust diagnostic, if any, from the exception that failed a registration.
The code is read from a Fido2TrustException in the cause chain rather than matched against
the exception message. Message matching would silently stop classifying rejections the moment
someone rewords a log or error string, and the wording is not something the metrics contract should
depend on.
Registration failures that are not trust related resolve to null, and the caller keeps the
original message — nothing is lost for them.
- Author:
- Janssen Project
-
Method Summary
Modifier and TypeMethodDescriptionstatic Fido2TrustExceptionFinds the trust failure behind a registration error.static AttestationTrustDiagnosticConvenience for the enum constant itself, for callers that need more than the name.static StringresolveAaguid(Throwable error) The AAGUID a trust rejection concerns.static StringresolveCode(Throwable error) The diagnostic code to record for a registration failure.
-
Method Details
-
find
Finds the trust failure behind a registration error.- Parameters:
error- the exception that failed the registration; may be null- Returns:
- the
Fido2TrustExceptionthat describes the trust failure, ornullwhen the failure was not trust related
-
resolveCode
The diagnostic code to record for a registration failure.- Parameters:
error- the exception that failed the registration; may be null- Returns:
- the code name, or
nullwhen the failure was not trust related
-
resolveAaguid
The AAGUID a trust rejection concerns.- Parameters:
error- the exception that failed the registration; may be null- Returns:
- the AAGUID, or
nullwhen the failure is not trust related or is not tied to a specific authenticator model
-
resolve
Convenience for the enum constant itself, for callers that need more than the name.
-