Interface AnnotationAnalyzer
- All Known Implementing Classes:
JwtAuthAnnotationAnalyzer,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.
-
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 an endpoint class.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".
-
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
-
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. By default returns an abstain response.- Parameters:
maybeAnnotated- class of the JAX-RS resourcepreviousResponse- response from parent of this class (e.g. from application analysis)- Returns:
- response with information whether to (and how) 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 (such as JAX-RS resource)annotations- annotations on the typepreviousResponse- response from parent of this class (e.g. from application analysis)- Returns:
- response with information whether to (and how) authenticate and authorize
-
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. By default returns an abstain response.- Parameters:
maybeAnnotated- JAX-RS resource methodpreviousResponse- response from parent of this class (e.g. from resource class analysis)- Returns:
- response with information whether to (and how) authenticate and authorize
-
analyze
default AnnotationAnalyzer.AnalyzerResponse analyze(TypeName typeName, TypedElementInfo method, AnnotationAnalyzer.AnalyzerResponse previousResponse) Analyze a resource method. By default returns an abstain response.- Parameters:
typeName- type that contains the methodmethod- endpoint method (such as JAX-RS 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
-