Package io.muserver.openapi
Class SecurityRequirementObjectBuilder
- java.lang.Object
-
- io.muserver.openapi.SecurityRequirementObjectBuilder
-
public class SecurityRequirementObjectBuilder extends java.lang.Object
Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the
SecuritySchemeObject
under theComponentsObject
.Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.
When a list of Security Requirement Objects is defined on the
OpenAPIObject
orOperationObject
, only one of Security Requirement Objects in the list needs to be satisfied to authorize the request.
-
-
Constructor Summary
Constructors Constructor Description SecurityRequirementObjectBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityRequirementObject
build()
static SecurityRequirementObjectBuilder
securityRequirementObject()
Creates a builder for aSecurityRequirementObjectBuilder
SecurityRequirementObjectBuilder
withRequirements(java.util.Map<java.lang.String,java.util.List<java.lang.String>> requirements)
-
-
-
Method Detail
-
withRequirements
public SecurityRequirementObjectBuilder withRequirements(java.util.Map<java.lang.String,java.util.List<java.lang.String>> requirements)
- Parameters:
requirements
- Each name MUST correspond to a security scheme which is declared in theComponentsObject.securitySchemes
under theComponentsObject
. If the security scheme is of type"oauth2"
or"openIdConnect"
, then the value is a list of scope names required for the execution. For other security scheme types, the array MUST be empty.- Returns:
- The builder
-
build
public SecurityRequirementObject build()
- Returns:
- A new object
-
securityRequirementObject
public static SecurityRequirementObjectBuilder securityRequirementObject()
Creates a builder for aSecurityRequirementObjectBuilder
- Returns:
- A new builder
-
-