Class OpenApiConfig
java.lang.Object
com.irurueta.authserver.authorization.api.web.OpenApiConfig
Runtime OpenAPI documents of the authorization server, served by springdoc. The contracts under
apis/auth-server/ are the source of truth: the operations are described by the interfaces generated from
them, and this class only adds what springdoc cannot read from those (the info blocks and the security schemes).
Two groups are published: "api" (/api/**, the REST API of
rest-server/auth-server-api-v1.yaml) and "pages" (the HTML pages of
web-pages/auth-server-pages-v1.yaml, at "/v3/api-docs/pages"). OpenApiDriftIT fails when a
document served differs from its contract. The OAuth 2.1 / OpenID Connect protocol endpoints are defined by the
specifications and documented by the discovery document, so they are not published here.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPath of the OpenAPI document.static final StringName of the group of the REST API.static final StringName of the bearer-token security scheme the REST contract's operations refer to.static final StringPath of the OpenAPI document of the HTML pages.static final StringName of the group of the HTML pages.(package private) static final StringName of the session cookie (seeLogoutChainCustomizer, which deletes it).static final StringName of the session-cookie security scheme the pages contract's operations refer to. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springdoc.core.models.GroupedOpenApiapiGroup()Groups the application's own API paths, leaving out the protocol endpoints and the HTML pages.io.swagger.v3.oas.models.OpenAPIDescribes the API.private static io.swagger.v3.oas.models.info.Licenselicense()Describes the license of the documents.org.springdoc.core.models.GroupedOpenApiGroups the HTML pages of the contractapis/auth-server/web-pages/auth-server-pages-v1.yaml, with their own info block and the session-cookie scheme instead of the REST API's.
-
Field Details
-
API_DOCS_PATH
Path of the OpenAPI document.- See Also:
-
API_GROUP
Name of the group of the REST API.- See Also:
-
PAGES_GROUP
Name of the group of the HTML pages.- See Also:
-
PAGES_DOCS_PATH
Path of the OpenAPI document of the HTML pages.- See Also:
-
BEARER_SCHEME
Name of the bearer-token security scheme the REST contract's operations refer to.- See Also:
-
SESSION_SCHEME
Name of the session-cookie security scheme the pages contract's operations refer to.- See Also:
-
SESSION_COOKIE
Name of the session cookie (seeLogoutChainCustomizer, which deletes it).- See Also:
-
-
Constructor Details
-
OpenApiConfig
public OpenApiConfig()
-
-
Method Details
-
authServerOpenApi
@Bean public io.swagger.v3.oas.models.OpenAPI authServerOpenApi()Describes the API.- Returns:
- the OpenAPI info block.
-
apiGroup
@Bean public org.springdoc.core.models.GroupedOpenApi apiGroup()Groups the application's own API paths, leaving out the protocol endpoints and the HTML pages.- Returns:
- the group of API paths.
-
pagesGroup
@Bean public org.springdoc.core.models.GroupedOpenApi pagesGroup()Groups the HTML pages of the contractapis/auth-server/web-pages/auth-server-pages-v1.yaml, with their own info block and the session-cookie scheme instead of the REST API's.- Returns:
- the group of the HTML pages.
-
license
private static io.swagger.v3.oas.models.info.License license()Describes the license of the documents.- Returns:
- the license.
-