Package io.jans.fido2.ws.rs.controller
Class Fido2MetricsController
java.lang.Object
io.jans.fido2.ws.rs.controller.Fido2MetricsController
REST API controller for FIDO2/Passkey metrics
Provides endpoints to fetch metrics data for dashboards and analytics tools
SECURITY NOTE: Authentication and authorization for these endpoints should be enforced
at the infrastructure level (API gateway, OAuth interceptor, or reverse proxy).
User-specific endpoints (e.g., /entries/user/{userId}) are particularly sensitive
and should restrict access to authorized users or administrators only.
If security is enforced at deployment time, ensure proper documentation is maintained.
GitHub Issue #11922
- Author:
- FIDO2 Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsegetAggregations(String aggregationType, String startTime, String endTime) Get aggregated metrics datajakarta.ws.rs.core.ResponsegetAggregationSummary(String aggregationType, String startTime, String endTime) Ge/t aggregation summary statisticsjakarta.ws.rs.core.ResponsegetAttestationRejectionAnalysis(String startTime, String endTime) Get attestation rejections broken down by trust diagnostic code.jakarta.ws.rs.core.ResponsegetDeviceAnalytics(String startTime, String endTime) Get device analytics (platform distribution, authenticator types)jakarta.ws.rs.core.ResponsegetErrorAnalysis(String startTime, String endTime, String operationType) Get error analysis (error categories, frequencies)jakarta.ws.rs.core.ResponseHealth check endpoint for metrics service Verifies that the metrics service is functional and can connect to the databasejakarta.ws.rs.core.ResponseGet metrics configuration and statusjakarta.ws.rs.core.ResponsegetMetricsEntries(String startTime, String endTime) Get raw metrics entries within a time rangejakarta.ws.rs.core.ResponsegetMetricsEntriesByOperation(String operationType, String startTime, String endTime) Get metrics entries by operation type (REGISTRATION or AUTHENTICATION)jakarta.ws.rs.core.ResponsegetMetricsEntriesByUser(String userId, String startTime, String endTime) Get metrics entries for a specific userjakarta.ws.rs.core.ResponsegetPerformanceMetrics(String startTime, String endTime) Get performance metrics (average durations, success rates)jakarta.ws.rs.core.ResponsegetPeriodOverPeriodComparison(String aggregationType, int periods) Get period-over-period comparisonjakarta.ws.rs.core.ResponsegetTrendAnalysis(String aggregationType, String startTime, String endTime) Get trend analysis for metrics over timejakarta.ws.rs.core.ResponsegetUserAdoptionMetrics(String startTime, String endTime) Get user adoption metrics
-
Constructor Details
-
Fido2MetricsController
public Fido2MetricsController()
-
-
Method Details
-
getMetricsEntries
@GET @Path("/entries") @Produces("application/json") public jakarta.ws.rs.core.Response getMetricsEntries(@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime) Get raw metrics entries within a time range- Parameters:
startTime- Start time in ISO format (e.g., 2024-01-01T00:00:00)endTime- End time in ISO format- Returns:
- List of metrics entries
-
getMetricsEntriesByUser
@GET @Path("/entries/user/{userId}") @Produces("application/json") public jakarta.ws.rs.core.Response getMetricsEntriesByUser(@PathParam("userId") String userId, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime) Get metrics entries for a specific user- Parameters:
userId- User IDstartTime- Start time in ISO formatendTime- End time in ISO format- Returns:
- List of user-specific metrics entries
-
getMetricsEntriesByOperation
@GET @Path("/entries/operation/{operationType}") @Produces("application/json") public jakarta.ws.rs.core.Response getMetricsEntriesByOperation(@PathParam("operationType") String operationType, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime) Get metrics entries by operation type (REGISTRATION or AUTHENTICATION)- Parameters:
operationType- Operation typestartTime- Start time in ISO formatendTime- End time in ISO format- Returns:
- List of operation-specific metrics entries
-
getAggregations
@GET @Path("/aggregations/{aggregationType}") @Produces("application/json") public jakarta.ws.rs.core.Response getAggregations(@PathParam("aggregationType") String aggregationType, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime) Get aggregated metrics data- Parameters:
aggregationType- Aggregation type (HOURLY, DAILY, WEEKLY, MONTHLY)startTime- Start time in ISO formatendTime- End time in ISO format- Returns:
- List of aggregated metrics
-
getAggregationSummary
@GET @Path("/aggregations/{aggregationType}/summary") @Produces("application/json") public jakarta.ws.rs.core.Response getAggregationSummary(@PathParam("aggregationType") String aggregationType, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime) Ge/t aggregation summary statistics- Parameters:
aggregationType- Aggregation type (HOURLY, DAILY, WEEKLY, MONTHLY)startTime- Start time in ISO formatendTime- End time in ISO format- Returns:
- Summary statistics
-
getUserAdoptionMetrics
@GET @Path("/analytics/adoption") @Produces("application/json") public jakarta.ws.rs.core.Response getUserAdoptionMetrics(@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime) Get user adoption metrics- Parameters:
startTime- Start time in ISO formatendTime- End time in ISO format- Returns:
- User adoption statistics
-
getPerformanceMetrics
@GET @Path("/analytics/performance") @Produces("application/json") public jakarta.ws.rs.core.Response getPerformanceMetrics(@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime) Get performance metrics (average durations, success rates)- Parameters:
startTime- Start time in ISO formatendTime- End time in ISO format- Returns:
- Performance statistics
-
getDeviceAnalytics
@GET @Path("/analytics/devices") @Produces("application/json") public jakarta.ws.rs.core.Response getDeviceAnalytics(@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime) Get device analytics (platform distribution, authenticator types)- Parameters:
startTime- Start time in ISO formatendTime- End time in ISO format- Returns:
- Device analytics data
-
getErrorAnalysis
@GET @Path("/analytics/errors") @Produces("application/json") public jakarta.ws.rs.core.Response getErrorAnalysis(@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime, @QueryParam("operationType") String operationType) Get error analysis (error categories, frequencies)- Parameters:
startTime- Start time in ISO formatendTime- End time in ISO formatoperationType- REGISTRATION or AUTHENTICATION to report that ceremony alone; omit to report both together, which is what this endpoint has always done- Returns:
- Error analysis data
-
getAttestationRejectionAnalysis
@GET @Path("/analytics/attestation-rejections") @Produces("application/json") public jakarta.ws.rs.core.Response getAttestationRejectionAnalysis(@QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime) Get attestation rejections broken down by trust diagnostic code.Answers "why are registrations being rejected" — an unknown AAGUID, an authenticator blocked by an MDS status report and an untrusted root are otherwise indistinguishable once they reach the metrics store. Reads the same store as
/analytics/errors.- Parameters:
startTime- Start time in ISO formatendTime- End time in ISO format- Returns:
- Attestation rejection analysis
-
getTrendAnalysis
@GET @Path("/analytics/trends/{aggregationType}") @Produces("application/json") public jakarta.ws.rs.core.Response getTrendAnalysis(@PathParam("aggregationType") String aggregationType, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime) Get trend analysis for metrics over time- Parameters:
aggregationType- Aggregation type for trend analysisstartTime- Start time in ISO formatendTime- End time in ISO format- Returns:
- Trend analysis data
-
getPeriodOverPeriodComparison
@GET @Path("/analytics/comparison/{aggregationType}") @Produces("application/json") public jakarta.ws.rs.core.Response getPeriodOverPeriodComparison(@PathParam("aggregationType") String aggregationType, @QueryParam("periods") @DefaultValue("2") int periods) Get period-over-period comparison- Parameters:
aggregationType- Aggregation type for comparisonperiods- Number of periods to compare (default: 2)- Returns:
- Period comparison data
-
getMetricsConfig
@GET @Path("/config") @Produces("application/json") public jakarta.ws.rs.core.Response getMetricsConfig()Get metrics configuration and status- Returns:
- Configuration information
-
getHealth
@GET @Path("/health") @Produces("application/json") public jakarta.ws.rs.core.Response getHealth()Health check endpoint for metrics service Verifies that the metrics service is functional and can connect to the database- Returns:
- Health status
-