@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) @Repeatable(value=SecurityRequirementsSets.class) @Inherited public @interface SecurityRequirementsSet
If this annotation is applied to a method which corresponds to an operation, then the requirements will be added to that operation.
If this annotation is applied to a class which contains methods which correspond to operations, then the requirements will be added to all operations corresponding to methods within that class which don't specify any other requirements.
Security requirements can be specified for the whole API using OpenAPIDefinition.securitySets()
. Security
requirements specified for individual operations override those specified for the whole API.
If multiple security requirement sets are specified for an operation, then a user must satisfy all of the requirements within any one of the sets to access the operation.
An empty security requirement set indicates that authentication is not required.
A SecurityRequirementSet
annotation corresponds to a map of security requirements in an OpenAPI document.
Example: security: - api_secret: [] oauth_implicit: []
Modifier and Type | Optional Element and Description |
---|---|
SecurityRequirement[] |
value
The security requirements which make up the set
|
public abstract SecurityRequirement[] value