Package io.jans.fido2.service.shared
Class MetricService
java.lang.Object
io.jans.service.metric.MetricService
io.jans.fido2.service.shared.MetricService
- All Implemented Interfaces:
Serializable
@ApplicationScoped
@Named("metricService")
public class MetricService
extends io.jans.service.metric.MetricService
Store and retrieve metric
- Author:
- Yuriy Movchan Date: 05/13/2020
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbaseDn()categorizeError(String errorReason) Categorize error reasons for analytics.io.jans.orm.PersistenceEntryManagerio.jans.service.metric.MetricServicevoidbooleanvoidrecordPasskeyAuthenticationAbandoned(String username, long ceremonyStartTime) Record a passkey authentication that was started and never completed.voidrecordPasskeyAuthenticationAttempt(String username, jakarta.servlet.http.HttpServletRequest request, long startTime) Record passkey authentication attemptvoidrecordPasskeyAuthenticationFailure(String username, jakarta.servlet.http.HttpServletRequest request, long startTime, String errorReason, String authenticatorType) Record failed passkey authenticationvoidrecordPasskeyAuthenticationSuccess(String username, jakarta.servlet.http.HttpServletRequest request, long startTime, String authenticatorType) Record successful passkey authenticationvoidrecordPasskeyFallback(String username, String fallbackMethod, String reason) Record passkey fallback event (when user switches to password or other method)voidrecordPasskeyRegistrationAttempt(String username, jakarta.servlet.http.HttpServletRequest request, long startTime) Record passkey registration attemptvoidrecordPasskeyRegistrationFailure(String username, jakarta.servlet.http.HttpServletRequest request, long startTime, String errorReason, String authenticatorType) Record failed passkey registrationvoidrecordPasskeyRegistrationFailure(String username, jakarta.servlet.http.HttpServletRequest request, long startTime, String errorReason, String authenticatorType, String aaguid) Record failed passkey registration, attributing it to an authenticator model.voidrecordPasskeyRegistrationSuccess(String username, jakarta.servlet.http.HttpServletRequest request, long startTime, String authenticatorType) Record successful passkey registrationMethods inherited from class io.jans.service.metric.MetricService
add, add, addBranch, buildDn, close, containsBranch, createApplicationBaseBranch, createBranch, findAllPeriodBranches, findMetricEntry, findMetricEntry, getCounter, getCounter, getEntryLifetimeInDays, getExpiredMetricEntries, getMetricEntryByDn, getRegisteredMetrics, getTimer, getTimer, getUniqueIdentifier, incCounter, incCounter, initTimer, prepareBranch, remove, removeBranch, removeExpiredMetricEntries, update, writeMetricEntries
-
Field Details
-
METRIC_SERVICE_COMPONENT_NAME
- See Also:
-
-
Constructor Details
-
MetricService
public MetricService()
-
-
Method Details
-
initTimer
public void initTimer() -
baseDn
- Specified by:
baseDnin classio.jans.service.metric.MetricService
-
getMetricServiceInstance
public io.jans.service.metric.MetricService getMetricServiceInstance()- Specified by:
getMetricServiceInstancein classio.jans.service.metric.MetricService
-
isMetricReporterEnabled
public boolean isMetricReporterEnabled()- Specified by:
isMetricReporterEnabledin classio.jans.service.metric.MetricService
-
getString
- Specified by:
getStringin classio.jans.service.metric.MetricService
-
getEntryManager
public io.jans.orm.PersistenceEntryManager getEntryManager()- Specified by:
getEntryManagerin classio.jans.service.metric.MetricService
-
getNodeIdentifier
- Specified by:
getNodeIdentifierin classio.jans.service.metric.MetricService
-
recordPasskeyRegistrationAttempt
public void recordPasskeyRegistrationAttempt(String username, jakarta.servlet.http.HttpServletRequest request, long startTime) Record passkey registration attempt- Parameters:
username- Username attempting registrationrequest- HTTP request for device info extractionstartTime- Start time of the operation
-
recordPasskeyRegistrationSuccess
public void recordPasskeyRegistrationSuccess(String username, jakarta.servlet.http.HttpServletRequest request, long startTime, String authenticatorType) Record successful passkey registration- Parameters:
username- Username who completed registrationrequest- HTTP request for device info extractionstartTime- Start time of the operationauthenticatorType- Type of authenticator used
-
recordPasskeyRegistrationFailure
public void recordPasskeyRegistrationFailure(String username, jakarta.servlet.http.HttpServletRequest request, long startTime, String errorReason, String authenticatorType) Record failed passkey registration- Parameters:
username- Username who failed registrationrequest- HTTP request for device info extractionstartTime- Start time of the operationerrorReason- Reason for failureauthenticatorType- Type of authenticator used (if known)
-
recordPasskeyRegistrationFailure
public void recordPasskeyRegistrationFailure(String username, jakarta.servlet.http.HttpServletRequest request, long startTime, String errorReason, String authenticatorType, String aaguid) Record failed passkey registration, attributing it to an authenticator model.- Parameters:
username- Username who failed registrationrequest- HTTP request for device info extractionstartTime- Start time of the operationerrorReason- Reason for failureauthenticatorType- Type of authenticator used (if known)aaguid- AAGUID the failure concerns, or null when the failure is not tied to one. Recorded so attestation rejections can be broken down by authenticator model.
-
recordPasskeyAuthenticationAttempt
public void recordPasskeyAuthenticationAttempt(String username, jakarta.servlet.http.HttpServletRequest request, long startTime) Record passkey authentication attempt- Parameters:
username- Username attempting authenticationrequest- HTTP request for device info extractionstartTime- Start time of the operation
-
recordPasskeyAuthenticationSuccess
public void recordPasskeyAuthenticationSuccess(String username, jakarta.servlet.http.HttpServletRequest request, long startTime, String authenticatorType) Record successful passkey authentication- Parameters:
username- Username who completed authenticationrequest- HTTP request for device info extractionstartTime- Start time of the operationauthenticatorType- Type of authenticator used
-
recordPasskeyAuthenticationFailure
public void recordPasskeyAuthenticationFailure(String username, jakarta.servlet.http.HttpServletRequest request, long startTime, String errorReason, String authenticatorType) Record failed passkey authentication- Parameters:
username- Username who failed authenticationrequest- HTTP request for device info extractionstartTime- Start time of the operationerrorReason- Reason for failureauthenticatorType- Type of authenticator used (if known)
-
recordPasskeyAuthenticationAbandoned
Record a passkey authentication that was started and never completed.Unlike the success and failure recorders this runs on the sweep timer rather than a request thread, so there is no request to take device details from —
snapshotRequestyields an empty snapshot. The ceremony's own start time is passed in so the recorded duration is how long the ceremony stayed open, not how long the sweep took.- Parameters:
username- the ceremony user, or null for a conditional-UI ceremony that never had oneceremonyStartTime- when the ceremony was issued, in epoch millis
-
recordPasskeyFallback
Record passkey fallback event (when user switches to password or other method)- Parameters:
username- Username who fell backfallbackMethod- Method user fell back to (e.g., "PASSWORD", "SMS")reason- Reason for fallback
-
categorizeError
Categorize error reasons for analytics.Public so the assertion entry can be labelled with the same category that is recorded in the metrics store. Deriving both from one place is what keeps the two sources from disagreeing.
-