Class IssuerAcceptabilityHandlerImpl

java.lang.Object
uk.co.spudsoft.jwtvalidatorvertx.impl.IssuerAcceptabilityHandlerImpl
All Implemented Interfaces:
IssuerAcceptabilityHandler

public class IssuerAcceptabilityHandlerImpl extends Object implements IssuerAcceptabilityHandler
The standard IssuerAcceptabilityHandler. Provides two approaches, which can be used in isolation or together:
  1. A list of acceptable issuers can be provided in a file. The file can be changed whilst the system is up, but the path to the file is fixed. It is recommended that the file be updated atomically (e.g. by changing a soft link).
  2. A list of regular expressions can be provided. Each regular expression will be checked, one at a time.
The use of a file is generally more secure, but there are some situations in which a small number of regular expressions can be useful. Each line in the file is trimmed before adding to an internal Set, so leading and trailing whitespace is removed (and the line ending of the file is irrelevant). It is strongly recommended that each line of the file be an https URL.
Author:
yaytay
  • Constructor Details

    • IssuerAcceptabilityHandlerImpl

      public IssuerAcceptabilityHandlerImpl(List<String> acceptableIssuerRegexes, String acceptableIssuersFile, Duration pollPeriod)
      Constructor.
      Parameters:
      acceptableIssuerRegexes - The List of regular expressions (as Strings) that are acceptable.
      acceptableIssuersFile - The path to a file that contains valid issuers, one per line.
      pollPeriod - The time period between file checks (the check just looks at the last modified time, so make this about a minute).
  • Method Details