Skip to content

Constraints should be checked in parallel. #2

Description

@Jonas-Sander

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}');
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions