The guarded-mounting release: requests register on the route group whose middleware guards them.
BREAKING — one-line migration. The four
register(request:)methods moved fromApplicationtoRoutesBuilderand take anapp:parameter:try app.register(request: X.self)→try app.register(request: X.self, app: app), or mount behind your credential group:try authed.register(request: X.self, app: app). See the full changelog.
Highlights
RoutesBuilder.register(request:app:)(FOSMVVMVapor) — the group you register on decides the middleware that guards the route: mount privileged requests behindClientCredentialMiddleware, public ones on theApplicationitself (anApplicationis aRoutesBuilder). Guarded writes are rejected before anything mutates, and.liverefreshes ride the same guarded route. Every method still derives and validates the request's load plan at boot — where a request mounts is your decision; that its plan is derived is not.- Path-prefixing groups are rejected at boot. Clients derive the served URL from the request type, so
app.grouped("admin")would make client and server silently disagree — registration now fails fast with a diagnostic naming the request and the mounted path. Mount on middleware-only groups.
Full changelog: https://github.com/foscomputerservices/FOSUtilities/blob/0.9.0/CHANGELOG.md