public class SecuritySchemeObjectBuilder extends Object
Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header or as a query parameter), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect Discovery.
Constructor and Description |
---|
SecuritySchemeObjectBuilder() |
Modifier and Type | Method and Description |
---|---|
SecuritySchemeObject |
build() |
static SecuritySchemeObjectBuilder |
securitySchemeObject()
Creates a builder for a
SecuritySchemeObject |
SecuritySchemeObjectBuilder |
withBearerFormat(String bearerFormat) |
SecuritySchemeObjectBuilder |
withDescription(String description) |
SecuritySchemeObjectBuilder |
withFlows(OAuthFlowsObject flows) |
SecuritySchemeObjectBuilder |
withIn(String in) |
SecuritySchemeObjectBuilder |
withName(String name) |
SecuritySchemeObjectBuilder |
withOpenIdConnectUrl(URI openIdConnectUrl) |
SecuritySchemeObjectBuilder |
withScheme(String scheme) |
SecuritySchemeObjectBuilder |
withType(String type) |
public SecuritySchemeObjectBuilder withType(String type)
type
- REQUIRED. The type of the security scheme. Valid values are "apiKey"
,
"http"
, "oauth2"
, "openIdConnect"
.public SecuritySchemeObjectBuilder withDescription(String description)
description
- A short description for security scheme. CommonMark syntax
MAY be used for rich text representation.public SecuritySchemeObjectBuilder withName(String name)
name
- REQUIRED (when type is apiKey). The name of the header, query or cookie parameter to be used.public SecuritySchemeObjectBuilder withIn(String in)
in
- REQUIRED (when type is apiKey). The location of the API key. Valid values are "query"
,
"header"
or "cookie"
.public SecuritySchemeObjectBuilder withScheme(String scheme)
scheme
- REQUIRED (when type is http). The name of the HTTP Authorization scheme to be used in the
Authorization header as defined in RFC7235.public SecuritySchemeObjectBuilder withBearerFormat(String bearerFormat)
bearerFormat
- A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually
generated by an authorization server, so this information is primarily for documentation purposes.public SecuritySchemeObjectBuilder withFlows(OAuthFlowsObject flows)
flows
- REQUIRED (when type is oauth2). An object containing configuration information for the flow types supported.public SecuritySchemeObjectBuilder withOpenIdConnectUrl(URI openIdConnectUrl)
openIdConnectUrl
- REQUIRED (when type is openIdConnect). OpenId Connect URL to discover OAuth2 configuration values.
This MUST be in the form of a URL.public SecuritySchemeObject build()
public static SecuritySchemeObjectBuilder securitySchemeObject()
SecuritySchemeObject
Copyright © 2017–2019. All rights reserved.