Instead of iterating through the constraints we should execute them in parallel via .map as await blocks the loop until resolved.
for (final constraint in jwtConstraints) {
final satisfied = await constraint.isSatisfiedBy(jwt);
_logger.finer(
'JWT-Token constraint ${constraint.description} satisfied: $satisfied');
if (!satisfied) {
throw ArgumentError(
'JWT does not satisfy constraint: ${constraint.description}');
}
Instead of iterating through the constraints we should execute them in parallel via
.mapasawaitblocks the loop until resolved.