public interface SecurityRequirement extends Constructible
Modifier and Type | Method and Description |
---|---|
SecurityRequirement |
addScheme(java.lang.String securitySchemeName)
Adds a security scheme to the SecurityRequirement instance based on the scheme name.
|
SecurityRequirement |
addScheme(java.lang.String securitySchemeName,
java.util.List<java.lang.String> scopes)
Adds a security scheme to the SecurityRequirement instance based on the scheme name and
required scopes (optional) provided.
|
SecurityRequirement |
addScheme(java.lang.String securitySchemeName,
java.lang.String scope)
Adds a security scheme to the SecurityRequirement instance based on the scheme name and
required scope (optional) provided.
|
default java.util.List<java.lang.String> |
getScheme(java.lang.String securitySchemeName)
Returns a list of scopes for a given scheme name.
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getSchemes()
Returns a copy map (potentially immutable) of the schemes.
|
default boolean |
hasScheme(java.lang.String securitySchemeName)
Check whether a scheme is present in the map.
|
void |
removeScheme(java.lang.String securitySchemeName)
Removes a security scheme to the SecurityRequirement instance based on the scheme name.
|
void |
setSchemes(java.util.Map<java.lang.String,java.util.List<java.lang.String>> items)
Set all security schemes to the SecurityRequirement instance.
|
SecurityRequirement addScheme(java.lang.String securitySchemeName, java.lang.String scope)
securitySchemeName
- the name of security scheme declared in the Components section of the OpenAPI documentscope
- a required scope - only valid when the defined scheme's type is 'oauth2' or 'openIdConnect'. passing null will
result in an empty list of scopesSecurityRequirement addScheme(java.lang.String securitySchemeName, java.util.List<java.lang.String> scopes)
securitySchemeName
- the name of security scheme declared in the Components section of the OpenAPI documentscopes
- the scopes required - only valid when the defined scheme is 'oauth2' or 'openIdConnect'. passing null
will result in an empty list of scopesSecurityRequirement addScheme(java.lang.String securitySchemeName)
securitySchemeName
- the name of security scheme declared in the Components section of the OpenAPI documentvoid removeScheme(java.lang.String securitySchemeName)
securitySchemeName
- the name of security schemejava.util.Map<java.lang.String,java.util.List<java.lang.String>> getSchemes()
void setSchemes(java.util.Map<java.lang.String,java.util.List<java.lang.String>> items)
items
- a map containing the security schemes.default boolean hasScheme(java.lang.String securitySchemeName)
getSchemes().containsKey(name)
securitySchemeName
- the name of security schemedefault java.util.List<java.lang.String> getScheme(java.lang.String securitySchemeName)
getSchemes().get(name)
securitySchemeName
- the name of security scheme