public interface SecurityRequirement extends Constructible
Modifier and Type | Method and Description |
---|---|
SecurityRequirement |
addScheme(String securitySchemeName)
Adds a security scheme to the SecurityRequirement instance based on the scheme name.
|
SecurityRequirement |
addScheme(String securitySchemeName,
List<String> scopes)
Adds a security scheme to the SecurityRequirement instance based on the scheme name and
required scopes (optional) provided.
|
SecurityRequirement |
addScheme(String securitySchemeName,
String scope)
Adds a security scheme to the SecurityRequirement instance based on the scheme name and
required scope (optional) provided.
|
default List<String> |
getScheme(String securitySchemeName)
Returns a list of scopes for a given scheme name.
|
Map<String,List<String>> |
getSchemes()
Returns a copy map (potentially immutable) of the schemes.
|
default boolean |
hasScheme(String securitySchemeName)
Check whether a scheme is present in the map.
|
void |
removeScheme(String securitySchemeName)
Removes a security scheme to the SecurityRequirement instance based on the scheme name.
|
void |
setSchemes(Map<String,List<String>> items)
Set all security schemes to the SecurityRequirement instance.
|
SecurityRequirement addScheme(String securitySchemeName, 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(String securitySchemeName, List<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(String securitySchemeName)
securitySchemeName
- the name of security scheme declared in the Components section of the OpenAPI documentvoid removeScheme(String securitySchemeName)
securitySchemeName
- the name of security schemeMap<String,List<String>> getSchemes()
void setSchemes(Map<String,List<String>> items)
items
- a map containing the security schemes.default boolean hasScheme(String securitySchemeName)
getSchemes().containsKey(name)
securitySchemeName
- the name of security schemeCopyright © 2017 – 2020 Eclipse Foundation. All rights reserved.
Use is subject to license terms.