Interface AnnotationAnalyzer
- All Known Implementing Classes:
JwtAuthAnnotationAnalyzer,RoleAnnotationAnalyzer
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classResponse of an analysis run.static enumFlag for security type. -
Method Summary
Modifier and TypeMethodDescriptionanalyze(TypeName typeName, TypedElementInfo method, AnnotationAnalyzer.AnalyzerResponse previousResponse) Analyze a resource method.analyze(TypeName applicationType, List<Annotation> annotations) Analyze application annotations.analyze(TypeName endpointType, List<Annotation> annotations, AnnotationAnalyzer.AnalyzerResponse previousResponse) Analyze a resource type.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).analyze(Class<?> maybeAnnotated, AnnotationAnalyzer.AnalyzerResponse previousResponse) Deprecated, for removal: This API element is subject to removal in a future version.going away from reflection, useanalyze(io.helidon.common.types.TypeName, java.util.List, io.helidon.security.providers.common.spi.AnnotationAnalyzer.AnalyzerResponse)insteadanalyze(Method maybeAnnotated, AnnotationAnalyzer.AnalyzerResponse previousResponse) Deprecated, for removal: This API element is subject to removal in a future version.default voidDeprecated, for removal: This API element is subject to removal in a future version.useinit(io.helidon.config.Config)insteaddefault voidProvides configuration on node "security.jersey.analyzers".default booleanWhether this analyzer supports expanded callbacks for separate resource definition, declaring, and handling stages.
-
Method Details
-
init
Deprecated, for removal: This API element is subject to removal in a future version.useinit(io.helidon.config.Config)insteadProvides 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)
-
init
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
- Parameters:
config- config to use to configure an analyzer, may be empty (e.g. have reasonable defaults if possible)- Since:
- 4.4.0
-
supportsExpandedEndpointAnalysis
default boolean supportsExpandedEndpointAnalysis()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.
- Returns:
trueto opt in to expanded endpoint analysis- Since:
- 4.5.4
-
analyze
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). Useanalyze(io.helidon.common.types.TypeName, java.util.List)instead.Analyze an application class.- Parameters:
maybeAnnotated- class of the JAX-RS application- 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 analyzeannotations- annotations on the type- Returns:
- response on how to authenticate and authorize
-
analyze
@Deprecated(forRemoval=true, since="4.2.0") default AnnotationAnalyzer.AnalyzerResponse analyze(Class<?> maybeAnnotated, AnnotationAnalyzer.AnalyzerResponse previousResponse) Deprecated, for removal: This API element is subject to removal in a future version.going away from reflection, useanalyze(io.helidon.common.types.TypeName, java.util.List, io.helidon.security.providers.common.spi.AnnotationAnalyzer.AnalyzerResponse)insteadAnalyze a resource class.An analyzer that opts in through
supportsExpandedEndpointAnalysis()may receive several ordered class and method stages for resource definitions, declaring types, and concrete handlers. In that case,previousResponseis 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.
- Parameters:
maybeAnnotated- class analyzed at this stagepreviousResponse- response from the preceding analyzer stage- Returns:
- response describing authentication and authorization requirements
-
analyze
default AnnotationAnalyzer.AnalyzerResponse analyze(TypeName endpointType, List<Annotation> annotations, AnnotationAnalyzer.AnalyzerResponse previousResponse) 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
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.- Parameters:
endpointType- type analyzed at this stageannotations- annotations selected for this stagepreviousResponse- response returned by this analyzer for the preceding class or method stage- Returns:
- response describing authentication and authorization requirements
-
analyze
@Deprecated(forRemoval=true, since="4.2.0") default AnnotationAnalyzer.AnalyzerResponse analyze(Method maybeAnnotated, AnnotationAnalyzer.AnalyzerResponse previousResponse) Deprecated, for removal: This API element is subject to removal in a future version.Analyze a resource method.An analyzer that opts in through
supportsExpandedEndpointAnalysis()may receive both Jersey's selected resource-definition method and the actual handling method.previousResponseis 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.- Parameters:
maybeAnnotated- method analyzed at this stagepreviousResponse- response from the preceding analyzer stage- Returns:
- response describing authentication and authorization requirements
-
analyze
default AnnotationAnalyzer.AnalyzerResponse analyze(TypeName typeName, TypedElementInfo method, AnnotationAnalyzer.AnalyzerResponse previousResponse) Analyze a resource method.An analyzer that opts in through
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, andpreviousResponseis the response returned by this analyzer for the immediately preceding class or method stage.- Parameters:
typeName- declaring type of the method analyzed at this stagemethod- method metadata selected for this stagepreviousResponse- response from the preceding analyzer stage- Returns:
- response describing authentication and authorization requirements
-