Package com.jsgalactic.axiom.openapi
Class SecurityScheme
java.lang.Object
com.jsgalactic.axiom.openapi.SecurityScheme
A security scheme that routes can require by name (see
RouteDoc.security(String...)). It only documents how clients
authenticate; the application enforces access with its own middleware.
In a Swagger 2.0 document a bearer scheme is an API key in the Authorization header,
because that format has no bearer type.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SecuritySchemeapiKeyHeader(String header) An API key sent in a request header.static SecuritySchemeapiKeyQuery(String parameter) An API key sent as a query parameter.static SecuritySchemebasic()HTTP basic authentication.static SecuritySchemebearer()An HTTP bearer token.static SecuritySchemeAn HTTP bearer token with a documented format, for exampleJWT.
-
Method Details
-
bearer
An HTTP bearer token.- Returns:
- the scheme
-
bearer
An HTTP bearer token with a documented format, for exampleJWT.- Parameters:
format- format hint- Returns:
- the scheme
-
basic
HTTP basic authentication.- Returns:
- the scheme
-
apiKeyHeader
An API key sent in a request header.- Parameters:
header- header name- Returns:
- the scheme
- Throws:
IllegalArgumentException- if the name is not a header name
-
apiKeyQuery
An API key sent as a query parameter.- Parameters:
parameter- parameter name- Returns:
- the scheme
- Throws:
IllegalArgumentException- if the name is not a plain parameter name
-