Class OpenApiConfig

java.lang.Object
com.irurueta.authserver.authorization.api.web.OpenApiConfig

@Configuration(proxyBeanMethods=false) public class OpenApiConfig extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Path of the OpenAPI document.
    static final String
    Name of the group of the REST API.
    static final String
    Name of the bearer-token security scheme the REST contract's operations refer to.
    static final String
    Path of the OpenAPI document of the HTML pages.
    static final String
    Name of the group of the HTML pages.
    (package private) static final String
    Name of the session cookie (see LogoutChainCustomizer, which deletes it).
    static final String
    Name of the session-cookie security scheme the pages contract's operations refer to.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springdoc.core.models.GroupedOpenApi
    Groups the application's own API paths, leaving out the protocol endpoints and the HTML pages.
    io.swagger.v3.oas.models.OpenAPI
    Describes the API.
    private static io.swagger.v3.oas.models.info.License
    Describes the license of the documents.
    org.springdoc.core.models.GroupedOpenApi
    Groups the HTML pages of the contract apis/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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • API_DOCS_PATH

      public static final String API_DOCS_PATH
      Path of the OpenAPI document.
      See Also:
    • API_GROUP

      public static final String API_GROUP
      Name of the group of the REST API.
      See Also:
    • PAGES_GROUP

      public static final String PAGES_GROUP
      Name of the group of the HTML pages.
      See Also:
    • PAGES_DOCS_PATH

      public static final String PAGES_DOCS_PATH
      Path of the OpenAPI document of the HTML pages.
      See Also:
    • BEARER_SCHEME

      public static final String BEARER_SCHEME
      Name of the bearer-token security scheme the REST contract's operations refer to.
      See Also:
    • SESSION_SCHEME

      public static final String SESSION_SCHEME
      Name of the session-cookie security scheme the pages contract's operations refer to.
      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 contract apis/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.