Class JwtAuthAnnotationAnalyzer

java.lang.Object
io.helidon.microprofile.jwt.auth.JwtAuthAnnotationAnalyzer
All Implemented Interfaces:
AnnotationAnalyzer

public class JwtAuthAnnotationAnalyzer extends Object implements AnnotationAnalyzer
Implementation of AnnotationAnalyzer which checks for LoginConfig annotation if JWT Authentication should be enabled.
  • Constructor Details

    • JwtAuthAnnotationAnalyzer

      public JwtAuthAnnotationAnalyzer()
  • Method Details

    • supportsExpandedEndpointAnalysis

      public boolean supportsExpandedEndpointAnalysis()
      Description copied from interface: AnnotationAnalyzer
      Whether this analyzer supports expanded callbacks for separate resource definition, declaring, and handling stages.

      The default preserves the original application, resource-class, and resource-method callback topology. The returned value must remain stable after initialization.

      Specified by:
      supportsExpandedEndpointAnalysis in interface AnnotationAnalyzer
      Returns:
      true to opt in to expanded endpoint analysis
    • init

      public void init(Config config)
      Description copied from interface: AnnotationAnalyzer
      Provides configuration on node "security.jersey.analyzers".

      API Note: the default method implementation is provided for backward compatibility and will be removed in the next major version

      Specified by:
      init in interface AnnotationAnalyzer
      Parameters:
      config - config to use to configure an analyzer, may be empty (e.g. have reasonable defaults if possible)
    • analyze

      public AnnotationAnalyzer.AnalyzerResponse analyze(TypeName applicationType, List<Annotation> annotations)
      Description copied from interface: AnnotationAnalyzer
      Analyze application annotations.
      Specified by:
      analyze in interface AnnotationAnalyzer
      Parameters:
      applicationType - type to analyze
      annotations - annotations on the type
      Returns:
      response on how to authenticate and authorize
    • analyze

      public AnnotationAnalyzer.AnalyzerResponse analyze(TypeName endpointType, List<Annotation> annotations, AnnotationAnalyzer.AnalyzerResponse previousResponse)
      Description copied from interface: AnnotationAnalyzer
      Analyze a resource type.

      By default, the supplied annotations are the complete annotation view of the selected resource class. An analyzer that opts in through AnnotationAnalyzer.supportsExpandedEndpointAnalysis() may receive several ordered callbacks for a resource's selected definition, method-declaring type, and concrete handling type. The supplied annotations are then exactly those selected for that stage and may be a declared, inherited, or filtered subset.

      Specified by:
      analyze in interface AnnotationAnalyzer
      Parameters:
      endpointType - type analyzed at this stage
      annotations - annotations selected for this stage
      previousResponse - response returned by this analyzer for the preceding class or method stage
      Returns:
      response describing authentication and authorization requirements
    • analyze

      Description copied from interface: AnnotationAnalyzer
      Analyze a resource method.

      An analyzer that opts in through AnnotationAnalyzer.supportsExpandedEndpointAnalysis() may receive separate callbacks for a resource's selected definition method and actual handling method. The supplied metadata is the method view selected for this stage, and previousResponse is the response returned by this analyzer for the immediately preceding class or method stage.

      Specified by:
      analyze in interface AnnotationAnalyzer
      Parameters:
      typeName - declaring type of the method analyzed at this stage
      method - method metadata selected for this stage
      previousResponse - response from the preceding analyzer stage
      Returns:
      response describing authentication and authorization requirements
    • analyze

      public AnnotationAnalyzer.AnalyzerResponse analyze(Class<?> maybeAnnotated)
      Description copied from interface: AnnotationAnalyzer
      Analyze an application class.
      Specified by:
      analyze in interface AnnotationAnalyzer
      Parameters:
      maybeAnnotated - class of the JAX-RS application
      Returns:
      response with information whether to (and how) authenticate and authorize
    • analyze

      public AnnotationAnalyzer.AnalyzerResponse analyze(Class<?> maybeAnnotated, AnnotationAnalyzer.AnalyzerResponse previousResponse)
      Description copied from interface: AnnotationAnalyzer
      Analyze a resource class.

      An analyzer that opts in through AnnotationAnalyzer.supportsExpandedEndpointAnalysis() may receive several ordered class and method stages for resource definitions, declaring types, and concrete handlers. In that case, previousResponse is the response returned by this analyzer for the immediately preceding stage and may be a method-stage response.

      This legacy reflection callback receives the complete reflective class view and cannot represent a scoped or filtered annotation list. When called through the metadata callback's default implementation, filtering performed by the integration is therefore not visible. Integrations may omit legacy callbacks for stages that cannot be represented faithfully.

      Specified by:
      analyze in interface AnnotationAnalyzer
      Parameters:
      maybeAnnotated - class analyzed at this stage
      previousResponse - response from the preceding analyzer stage
      Returns:
      response describing authentication and authorization requirements
    • analyze

      public AnnotationAnalyzer.AnalyzerResponse analyze(Method maybeAnnotated, AnnotationAnalyzer.AnalyzerResponse previousResponse)
      Description copied from interface: AnnotationAnalyzer
      Analyze a resource method.

      An analyzer that opts in through AnnotationAnalyzer.supportsExpandedEndpointAnalysis() may receive both Jersey's selected resource-definition method and the actual handling method. previousResponse is the response returned by this analyzer for the immediately preceding stage, normally the last applicable class stage.

      This legacy callback receives the complete reflective method view. The metadata callback's default implementation delegates here using its originating Method, when available, or a reflectively resolved matching method.

      Specified by:
      analyze in interface AnnotationAnalyzer
      Parameters:
      maybeAnnotated - method analyzed at this stage
      previousResponse - response from the preceding analyzer stage
      Returns:
      response describing authentication and authorization requirements
    • toString

      public String toString()
      Overrides:
      toString in class Object