AbstractValidationAction NPEs if a MetricRegistry is not installed

Description

The recordSuccess and recordFailure methods of the AbstractValidationAction do not first check if the metrics registry has been installed into the runtime before obtaining and modifying a counter. The metrics registry can be null. 

This only surfaced when mocking up an authn flow test without first initializing the metric registry in the configuration service.  A successful authentication was triggering a NPE which then triggered an authentication failure.  

Environment

None

Activity

Philip SmartMay 15, 2020 at 9:42 AM

Philip SmartMay 15, 2020 at 9:41 AM

I think this extends to the opensaml MetricContext as well. 

Philip SmartMay 15, 2020 at 9:26 AM

I think there are a few call sites to getting the metric registry in opensaml as well, I will check.

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Created May 15, 2020 at 9:24 AM
Updated May 29, 2020 at 1:51 PM
Resolved May 29, 2020 at 1:51 PM