Skip to content

Vapor 4.0.0

Compare
Choose a tag to compare
@tanner0101 tanner0101 released this 09 Apr 17:49
633b2a8

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.