Vapor 4.0.0
New Docs:
- https://docs.vapor.codes/4.0/environment/
- https://docs.vapor.codes/4.0/errors/
- https://docs.vapor.codes/4.0/middleware/
- https://docs.vapor.codes/4.0/testing/
- https://docs.vapor.codes/4.0/server/
- https://docs.vapor.codes/4.0/sessions/
- https://docs.vapor.codes/4.0/services/
- https://docs.vapor.codes/4.0/passwords/
More information on Vapor 4 official release:
https://forums.swift.org/t/vapor-4-official-release-begins/34802
Changes since last pre-release. Breaking changes have a warning symbol.
⚠️ Authenticator
s now returnVoid
and have no associatedUser
type.
Authenticators should now use req.auth.login
internally to login the user instead of returning it. This change allows for authenticators to login one or more user types and prevents the need for associated types.
⚠️ HTTP client and server configuration are now prefixed withapp.http
.
// Configure HTTP server.
app.http.server.configuration.hostname = ...
// Configure HTTP client.
app.http.client.configuration.followRedirects = ...
⚠️ Shared HTTP client and server are now accessible viaapp.http
.
print(app.http.client.shared) // AsyncHTTPClient.HTTPClient
- Client is now configurable.
app.clients.use { app in
CustomClient()
}
- Server is now configurable.
app.servers.use { app in
CustomServer()
}
- New configurable password hashing API added.
let digest = try app.password.hash("vapor")
try app.password.verify("vapor", created: digest)
Async password hashing support included.
req.password.async.hash("vapor").map { digest in
// Handle digest.
}
-
Unused HTTPServer configuration options were removed.
-
Tests have been broken out into separate files.