Class OpenApiConfig

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

@Configuration(proxyBeanMethods=false) public class OpenApiConfig extends Object
Runtime OpenAPI document of the JSON API of the BFF, served by springdoc at "/v3/api-docs" to a signed-in user. The contract apis/bff/rest-server/bff-api-v1.yaml is the source of truth: the operations are described by the interface generated from it, and this class only adds what springdoc cannot read from it (the info block and the security scheme). OpenApiDriftIT fails when the document served differs from the contract.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Path of the OpenAPI document.
    (package private) static final String
    Name of the header carrying the CSRF token.
    static final String
    Name of the CSRF security scheme, which protects every state-changing request.
    (package private) static final String
    Name of the session cookie (set by SessionConfiguration of bff/infrastructure/session).
    static final String
    Name of the session-cookie security scheme the contract's operations refer to.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springdoc.core.models.GroupedOpenApi
    Groups the BFF's own JSON paths (/bff/**) and the documents API (/api/**), leaving out the OAuth 2.0 login endpoints.
    io.swagger.v3.oas.models.OpenAPI
    Describes the API.

    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:
    • SESSION_SCHEME

      public static final String SESSION_SCHEME
      Name of the session-cookie security scheme the contract's operations refer to.
      See Also:
    • CSRF_SCHEME

      public static final String CSRF_SCHEME
      Name of the CSRF security scheme, which protects every state-changing request.
      See Also:
    • CSRF_HEADER

      static final String CSRF_HEADER
      Name of the header carrying the CSRF token.
      See Also:
  • Constructor Details

    • OpenApiConfig

      public OpenApiConfig()
  • Method Details

    • bffOpenApi

      @Bean public io.swagger.v3.oas.models.OpenAPI bffOpenApi()
      Describes the API.
      Returns:
      the OpenAPI info block and security scheme.
    • apiGroup

      @Bean public org.springdoc.core.models.GroupedOpenApi apiGroup()
      Groups the BFF's own JSON paths (/bff/**) and the documents API (/api/**), leaving out the OAuth 2.0 login endpoints.
      Returns:
      the group of API paths.