Vapor: 4.0.0 Release

Release date:
April 9, 2020
Previous version:
4.0.0-rc.3.12 (released March 30, 2020)
Magnitude:
0 Diff Delta
Contributors:
1 total committer
Data confidence:
Commits:

Top Contributors in 4.0.0

0xTim

Directory Browser for 4.0.0

We haven't yet finished calculating and confirming the files and directories changed in this release. Please check back soon.

Release Notes Published

New Docs:

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.

  • ⚠️ Authenticators now return Void and have no associated User 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 with app.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 via app.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.