Class App.AppConfig

java.lang.Object
org.apache.juneau.petstore.jetty.App.AppConfig
Enclosing class:
App

@Configuration public static class App.AppConfig extends Object
Application-specific configuration class contributing the top-level REST servlet and the console, API and admin boundary filters.
  • Field Details

  • Constructor Details

  • Method Details

    • config

      public Config config()
      Provides the deployment's configuration, named explicitly because the working directory is no longer scanned for *.cfg files.
      Returns:
      The configuration.
    • rootResources

      public jakarta.servlet.Servlet rootResources()
      Provides the top-level REST servlet, auto-mounted by JettyServerComponent at Rest.path().
      Returns:
      The root servlet.
    • consoleBoundary

      Provides the console's CSRF boundary, covering /console only.

      The /petstore API is covered by apiBoundary(); /petstore-ui is outside both: see PetstoreConsoleBoundary. It runs ahead of routing and ahead of authentication, for the request, forward, async and error dispatches; the include dispatch is deliberately not mapped. It is built over the same PetstoreApiBoundary that apiBoundary() mounts, so the API token its pages carry is one the API filter accepts.

      Returns:
      The filter registration.
    • apiBoundary

      Provides the API's CSRF boundary, covering /petstore/*.

      It runs only on the original request: an internal forward or error dispatch to the API is not a new attacker-controlled request. The order keeps it just behind consoleBoundary(); the two patterns never overlap.

      Returns:
      The filter registration.