Class RequestAnalyzer

java.lang.Object
it.univr.passportease.helper.RequestAnalyzer

@Service public class RequestAnalyzer extends Object
This class is used to analyze the request and extract the JWT token from the Authorization header. It also checks if the token is valid and not expired.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
    The regex used to check if the token is valid.
    private final JwtService
    The service used to check if the token is valid and not expired.
    private final jakarta.servlet.http.HttpServletRequest
    The request to analyze.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RequestAnalyzer(JwtService jwtService, jakarta.servlet.http.HttpServletRequest request)
    Constructor for the RequestAnalyzer class.
  • Method Summary

    Modifier and Type
    Method
    Description
    This method extracts the JWT token from the Authorization header of the request.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • JWT_REGEX

      private static final String JWT_REGEX
      The regex used to check if the token is valid.
      See Also:
    • request

      private final jakarta.servlet.http.HttpServletRequest request
      The request to analyze.
    • jwtService

      private final JwtService jwtService
      The service used to check if the token is valid and not expired.
  • Constructor Details

    • RequestAnalyzer

      @Autowired RequestAnalyzer(JwtService jwtService, jakarta.servlet.http.HttpServletRequest request)
      Constructor for the RequestAnalyzer class.
      Parameters:
      jwtService - The service used to check if the token is valid and not expired
      request - The request to analyze
  • Method Details