Package io.muserver.openapi
Class SecuritySchemeObjectBuilder
- java.lang.Object
-
- io.muserver.openapi.SecuritySchemeObjectBuilder
-
public class SecuritySchemeObjectBuilder extends java.lang.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 Summary
Constructors Constructor Description SecuritySchemeObjectBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SecuritySchemeObject
build()
static SecuritySchemeObjectBuilder
securitySchemeObject()
Creates a builder for aSecuritySchemeObject
SecuritySchemeObjectBuilder
withBearerFormat(java.lang.String bearerFormat)
SecuritySchemeObjectBuilder
withDescription(java.lang.String description)
SecuritySchemeObjectBuilder
withFlows(OAuthFlowsObject flows)
SecuritySchemeObjectBuilder
withIn(java.lang.String in)
SecuritySchemeObjectBuilder
withName(java.lang.String name)
SecuritySchemeObjectBuilder
withOpenIdConnectUrl(java.net.URI openIdConnectUrl)
SecuritySchemeObjectBuilder
withScheme(java.lang.String scheme)
SecuritySchemeObjectBuilder
withType(java.lang.String type)
-
-
-
Method Detail
-
withType
public SecuritySchemeObjectBuilder withType(java.lang.String type)
- Parameters:
type
- REQUIRED. The type of the security scheme. Valid values are"apiKey"
,"http"
,"oauth2"
,"openIdConnect"
.- Returns:
- The current builder
-
withDescription
public SecuritySchemeObjectBuilder withDescription(java.lang.String description)
- Parameters:
description
- A short description for security scheme. CommonMark syntax MAY be used for rich text representation.- Returns:
- The current builder
-
withName
public SecuritySchemeObjectBuilder withName(java.lang.String name)
- Parameters:
name
- REQUIRED (when type is apiKey). The name of the header, query or cookie parameter to be used.- Returns:
- The current builder
-
withIn
public SecuritySchemeObjectBuilder withIn(java.lang.String in)
- Parameters:
in
- REQUIRED (when type is apiKey). The location of the API key. Valid values are"query"
,"header"
or"cookie"
.- Returns:
- The current builder
-
withScheme
public SecuritySchemeObjectBuilder withScheme(java.lang.String scheme)
- Parameters:
scheme
- REQUIRED (when type is http). The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.- Returns:
- The current builder
-
withBearerFormat
public SecuritySchemeObjectBuilder withBearerFormat(java.lang.String bearerFormat)
- Parameters:
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.- Returns:
- The current builder
-
withFlows
public SecuritySchemeObjectBuilder withFlows(OAuthFlowsObject flows)
- Parameters:
flows
- REQUIRED (when type is oauth2). An object containing configuration information for the flow types supported.- Returns:
- The current builder
-
withOpenIdConnectUrl
public SecuritySchemeObjectBuilder withOpenIdConnectUrl(java.net.URI openIdConnectUrl)
- Parameters:
openIdConnectUrl
- REQUIRED (when type is openIdConnect). OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.- Returns:
- The current builder
-
build
public SecuritySchemeObject build()
- Returns:
- A new object
-
securitySchemeObject
public static SecuritySchemeObjectBuilder securitySchemeObject()
Creates a builder for aSecuritySchemeObject
- Returns:
- A new builder
-
-