Class App.AppConfig
- Enclosing class:
- App
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvides the admin resources' CSRF boundary, covering/config,/logsand/shutdown.Provides the API's CSRF boundary, covering/petstore/*.Provides the console's CSRF boundary, covering/consoleonly.jakarta.servlet.ServletProvides the top-level REST servlet, auto-mounted byJettyServerComponentatRest.path().
-
Constructor Details
-
AppConfig
public AppConfig()
-
-
Method Details
-
rootResources
Provides the top-level REST servlet, auto-mounted byJettyServerComponentatRest.path().- Returns:
- The root servlet.
-
consoleBoundary
Provides the console's CSRF boundary, covering/consoleonly.The
/petstoreAPI is covered byapiBoundary()and the admin resources byadminBoundary();/petstore-uiis outside all three: seePetstoreConsoleBoundary. 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 samePetstoreApiBoundarythatapiBoundary()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.
-
adminBoundary
Provides the admin resources' CSRF boundary, covering/config,/logsand/shutdown.A filter of its own, answering to the host names in "petstore.admin.allowedHosts", or to the loopback names only while that is unset. The admin resources have no forms, so a browser write to them is refused, and command-line writes are admitted: see
AdminBoundary. The boundary does not authenticate: the admin resources must not be exposed on an untrusted network.- Returns:
- The filter registration.
- Throws:
IllegalArgumentException- If "petstore.admin.allowedHosts" holds an entry that is blank or not a bare host name.
-