Interface AnnotationAnalyzer

All Known Implementing Classes:
RoleAnnotationAnalyzer

public interface AnnotationAnalyzer
Provides capability to extensions to enforce authentication and authorization even when the resource is not annotated with io.helidon.security.annotations.Authenticated or io.helidon.security.annotations.Authorized. This is loaded using a ServiceLoader - integration with Security is done automatically as long as the implementation is discovered as a java service.

Note: This type is no longer a FunctionalInterface, as we need to support both SE and MP types. We are refactoring our approach so we do not use reflection.

  • Method Details

    • init

      default void init(Config config)
      Provides configuration on node "security.jersey.analyzers".
      Parameters:
      config - config to use to configure an analyzer, may be empty (e.g. have reasonable defaults if possible)
    • analyze

      @Deprecated(since="4.2.0") AnnotationAnalyzer.AnalyzerResponse analyze(Class<?> maybeAnnotated)
      Deprecated.
      this method will be made default in a future version, and marked for removal; it will be removed in two major versions from now (most likely version 6). Use analyze(io.helidon.common.types.TypeName, java.util.List) instead.
      Analyze an application class.
      Parameters:
      maybeAnnotated - class of the application layer
      Returns:
      response with information whether to (and how) authenticate and authorize
    • analyze

      default AnnotationAnalyzer.AnalyzerResponse analyze(TypeName applicationType, List<Annotation> annotations)
      Analyze application annotations.
      Parameters:
      applicationType - type to analyze
      annotations - annotations on the type
      Returns:
      response on how to authenticate and authorize
    • analyze

      default AnnotationAnalyzer.AnalyzerResponse analyze(TypeName endpointType, List<Annotation> annotations, AnnotationAnalyzer.AnalyzerResponse previousResponse)
      Analyze an endpoint class.
      Parameters:
      endpointType - type of the endpoint
      annotations - annotations on the type
      previousResponse - response from parent of this class (e.g. from application analysis)
      Returns:
      response with information whether to (and how) authenticate and authorize
    • analyze

      Analyze a resource method. By default returns an abstain response.
      Parameters:
      typeName - type that contains the method
      method - endpoint method
      previousResponse - response from parent of this class (e.g. from resource class analysis)
      Returns:
      response with information whether to (and how) authenticate and authorize