Skip to content

Commit

Permalink
Improve AuthenticatorStatusValidators logging
Browse files Browse the repository at this point in the history
  • Loading branch information
MKodde committed Apr 16, 2024
1 parent 331a33b commit 530294e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Service/AuthenticatorStatusValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,22 @@ public function validate(array $statusReports): void
{
$meetsRequirement = false;
$reportsProcessed = 0;
$reportLog = [];
foreach ($statusReports as $report) {
if (in_array($report->status, $this->allowedStatus)) {
$meetsRequirement = true;
}
$reportsProcessed++;
$reportLog[] = $report->status;
}

if (!$meetsRequirement) {
throw new AuthenticatorStatusNotSupportedException(
sprintf(
'Of the %d StatusReports tested, none met one of the required FIDO Certified statuses',
$reportsProcessed
'Of the %d StatusReports tested, none met one of the required FIDO Certified statuses. ' .
'Reports tested: "%s"',
$reportsProcessed,
implode(', ', $reportLog)
)
);
}
Expand Down

0 comments on commit 530294e

Please sign in to comment.