Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0.0 gm #2278

Merged
merged 48 commits into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
349c62f
gm
tanner0101 Mar 31, 2020
d7ee0be
update Authenticator protocol to return Void (#2260)
tanner0101 Mar 31, 2020
d65ff85
Make testing with password easier with Password Service (#2275)
0xTim Apr 1, 2020
bd52b11
Allow Client to be Changed (#2279)
0xTim Apr 1, 2020
e4ab410
update verifier
tanner0101 Apr 1, 2020
9bf403e
client cleanup
tanner0101 Apr 1, 2020
db9b8a7
server override
tanner0101 Apr 1, 2020
a9bd457
server tests
tanner0101 Apr 1, 2020
76b5b56
server + client cleanup
tanner0101 Apr 1, 2020
c89a729
rm deprecations
tanner0101 Apr 1, 2020
c586d30
folder cleanup
tanner0101 Apr 1, 2020
c33c947
test folder cleanup
tanner0101 Apr 1, 2020
c3c97c0
remove dead code
tanner0101 Apr 1, 2020
2aec17e
remove apt script
tanner0101 Apr 1, 2020
e033224
Allow nested route building to throw and rethrow (#2148)
baarde Apr 1, 2020
3666636
rethrows test
tanner0101 Apr 1, 2020
e239cff
Foundation.url query support, fixes #2191
tanner0101 Apr 1, 2020
9903dd7
AllowOriginSetting adjustments (#2053)
cak Apr 2, 2020
2328bea
fixes #2034
tanner0101 Apr 2, 2020
dd3127e
remove content-type check in JSONDecoder content conformance, fixes #…
tanner0101 Apr 2, 2020
acb1c49
test #2130
tanner0101 Apr 2, 2020
819f34c
fix leaking promise when port too large, fixes #2245
tanner0101 Apr 2, 2020
692564c
port int.max
tanner0101 Apr 2, 2020
b40376a
add SameSite=None, fixes #2259
tanner0101 Apr 2, 2020
b59fd6c
custom client test
tanner0101 Apr 2, 2020
ddd58da
move docs
tanner0101 Apr 2, 2020
4cc28e8
remove utils folder
tanner0101 Apr 2, 2020
85a488c
2020 license
tanner0101 Apr 2, 2020
4404a4c
use swift coc
tanner0101 Apr 2, 2020
e45db9c
update contributing
tanner0101 Apr 2, 2020
19ea9dc
add new sponsors
tanner0101 Apr 2, 2020
a028cc7
remove inactive
tanner0101 Apr 2, 2020
0a4005a
api docs cleanup
tanner0101 Apr 2, 2020
fe3cd4d
Minor grammatical edits (GM Branch) (#2290)
HaydenMcCabe Apr 3, 2020
6715584
sessions updates
tanner0101 Apr 3, 2020
f4aba4b
session updates
tanner0101 Apr 3, 2020
326f9dc
Fix tests
MrLotU Apr 5, 2020
0f2d11d
DefaultResponder fixes
tanner0101 Apr 6, 2020
9918203
Merge branch 'gm' of github.com:vapor/vapor into gm
tanner0101 Apr 6, 2020
bcc0629
Merge branch 'master' into gm
tanner0101 Apr 7, 2020
db799ad
Fix the "Server starting on ..." message to report the actual hostnam…
gwynne Apr 8, 2020
fe83a3d
Async password verifier (#2284)
madsodgaard Apr 8, 2020
f916721
password updates
tanner0101 Apr 8, 2020
3c0ef78
fix max body size
tanner0101 Apr 8, 2020
d8c3f00
fix chunk test
tanner0101 Apr 8, 2020
847ebe0
fix ws max frame size
tanner0101 Apr 8, 2020
ff44d62
docs updates
tanner0101 Apr 9, 2020
b06bc95
fix devel configure
tanner0101 Apr 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/code_of_conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Vapor adopts Swift's code of conduct: https://swift.org/community/#code-of-conduct
15 changes: 3 additions & 12 deletions Docs/contributing.md → .github/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,13 @@

👋 Welcome to the Vapor team!

## Linux

You can use the included bash script to test your PR on macOS and Linux before submitting (you must have Docker installed).

```sh
Utilities/contributor_test.sh
```

## Testing

Once in Xcode, select the `Vapor-Package` scheme and use `CMD+U` to run the tests.
Once in Xcode, select the `vapor-Package` scheme and use `CMD+U` to run the tests.

You can use the `Boilerplate...` and `Development` executables for testing out your code.
You can use the `Development` executables for testing out your code.

When adding new tests (please do 😁), don't forget to add the method name to the `allTests` array.
If you add a new `XCTestCase` subclass, make sure to add it to the `Tests/LinuxMain.swift` file.
Don't forget to add tests for your new features.

If you are fixing a single GitHub issue in particular, you can add a test named `testGH<issue number>` to ensure
that your fix is working. This will also help prevent regression.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 0 additions & 46 deletions Docs/code_of_conduct.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Qutheory, LLC
Copyright (c) 2020 Qutheory, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ let package = Package(
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.0.0"),

// Sugary extensions for the SwiftNIO library
.package(url: "https://github.com/vapor/async-kit.git", from: "1.0.0-rc.1"),
.package(url: "https://github.com/vapor/async-kit.git", from: "1.0.0"),

// 💻 APIs for creating interactive CLI tools.
.package(url: "https://github.com/vapor/console-kit.git", from: "4.0.0-rc.1"),
.package(url: "https://github.com/vapor/console-kit.git", from: "4.0.0"),

// 🔑 Hashing (BCrypt, SHA2, HMAC), encryption (AES), public-key (RSA), and random data generation.
.package(url: "https://github.com/apple/swift-crypto.git", from: "1.0.0"),

// 🚍 High-performance trie-node router.
.package(url: "https://github.com/vapor/routing-kit.git", from: "4.0.0-rc.1"),
.package(url: "https://github.com/vapor/routing-kit.git", from: "4.0.0"),

// 💥 Backtraces for Swift on Linux
.package(url: "https://github.com/swift-server/swift-backtrace.git", from: "1.1.1"),
Expand All @@ -48,7 +48,7 @@ let package = Package(
.package(url: "https://github.com/apple/swift-metrics.git", from: "2.0.0"),

// WebSocket client library built on SwiftNIO
.package(url: "https://github.com/vapor/websocket-kit.git", from: "2.0.0-rc.1"),
.package(url: "https://github.com/vapor/websocket-kit.git", from: "2.0.0"),
],
targets: [
// C helpers
Expand Down
60 changes: 48 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ Support Vapor's development by [becoming a backer](https://github.com/users/tann
href="https://github.com/Yasumoto">
<img src="https://avatars3.githubusercontent.com/u/48383?s=120" width="60px">
</a>
<a
data-amt="25"
data-since="3/11/20"
href="https://github.com/hjuraev">
<img src="https://avatars3.githubusercontent.com/u/5513926?s=120" width="60px">
</a>
<a
data-amt="10"
data-since="10/14/19"
Expand All @@ -99,12 +105,6 @@ Support Vapor's development by [becoming a backer](https://github.com/users/tann
href="https://github.com/ScottRobbins">
<img src="https://avatars3.githubusercontent.com/u/6894359?s=120" width="60px">
</a>
<a
data-amt="10"
data-since="10/15/19"
href="https://github.com/ksmandersen">
<img src="https://avatars3.githubusercontent.com/u/178181?s=120" width="60px">
</a>
<a
data-amt="10"
data-since="10/15/19"
Expand All @@ -117,6 +117,24 @@ Support Vapor's development by [becoming a backer](https://github.com/users/tann
href="https://github.com/mikkelu">
<img src="https://avatars3.githubusercontent.com/u/17051694?s=120" width="60px">
</a>
<a
data-amt="10"
data-since="2/28/20"
href="https://github.com/timothymiko">
<img src="https://avatars3.githubusercontent.com/u/2555306?s=120" width="60px">
</a>
<a
data-amt="10"
data-since="2/28/20"
href="https://github.com/jstevison">
<img src="https://avatars3.githubusercontent.com/u/149974?s=120" width="60px">
</a>
<a
data-amt="10"
data-since="4/1/20"
href="https://github.com/jstorm31">
<img src="https://avatars3.githubusercontent.com/u/16023539?s=120" width="60px">
</a>
<a
data-amt="5"
data-since="10/15/19"
Expand Down Expand Up @@ -159,12 +177,6 @@ Support Vapor's development by [becoming a backer](https://github.com/users/tann
href="https://github.com/Mordil">
<img src="https://avatars3.githubusercontent.com/u/3506776?s=120" width="60px">
</a>
<a
data-amt="5"
data-since="11/09/19"
href="https://github.com/danielinoa">
<img src="https://avatars3.githubusercontent.com/u/972877?s=120" width="60px">
</a>
<a
data-amt="5"
data-since="11/14/19"
Expand All @@ -189,6 +201,30 @@ Support Vapor's development by [becoming a backer](https://github.com/users/tann
href="https://github.com/jordanebelanger">
<img src="https://avatars3.githubusercontent.com/u/1856085?s=120" width="60px">
</a>
<a
data-amt="5"
data-since="12/21/19"
href="https://github.com/StefanCosminR">
<img src="https://avatars3.githubusercontent.com/u/17311242?s=120" width="60px">
</a>
<a
data-amt="5"
data-since="2/1/20"
href="https://github.com/piers12">
<img src="https://avatars3.githubusercontent.com/u/37227905?s=120" width="60px">
</a>
<a
data-amt="5"
data-since="2/26/20"
href="https://github.com/iq3addLi">
<img src="https://avatars3.githubusercontent.com/u/16850104?s=120" width="60px">
</a>
<a
data-amt="5"
data-since="3/20/20"
href="https://github.com/lmcd">
<img src="https://avatars3.githubusercontent.com/u/363540?s=120" width="60px">
</a>
<a
data-amt="5"
data-since="04/07/20"
Expand Down
9 changes: 0 additions & 9 deletions Sources/Development/app.swift

This file was deleted.

8 changes: 4 additions & 4 deletions Sources/Development/configure.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Vapor

public func configure(_ app: Application) throws {
app.server.configuration.hostname = "127.0.0.1"
app.http.server.configuration.hostname = "127.0.0.1"
switch app.environment {
case .tls:
app.server.configuration.port = 8443
try app.server.configuration.tlsConfiguration = .forServer(
app.http.server.configuration.port = 8443
try app.http.server.configuration.tlsConfiguration = .forServer(
certificateChain: [
.certificate(.init(
file: "/Users/tanner0101/dev/vapor/net-kit/certs/cert.pem",
Expand All @@ -15,7 +15,7 @@ public func configure(_ app: Application) throws {
privateKey: .file("/Users/tanner0101/dev/vapor/net-kit/certs/key.pem")
)
default:
app.server.configuration.port = 8080
app.http.server.configuration.port = 8080
}

// routes
Expand Down
17 changes: 8 additions & 9 deletions Sources/Development/routes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,16 @@ public func routes(_ app: Application) throws {
}

let sessions = app.grouped("sessions")
.grouped(SessionsMiddleware(session: app.sessions.driver))
sessions.get("get") { req -> String in
return req.session.data["name"] ?? "n/a"
.grouped(app.sessions.middleware)
sessions.get("set", ":value") { req -> HTTPStatus in
req.session.data["name"] = req.parameters.get("value")
return .ok
}
sessions.get("set", ":value") { req -> String in
let name = req.parameters.get("value")!
req.session.data["name"] = name
return name
sessions.get("get") { req -> String in
req.session.data["name"] ?? "n/a"
}
sessions.get("del") { req -> String in
req.destroySession()
req.session.destroy()
return "done"
}

Expand Down Expand Up @@ -197,7 +196,7 @@ struct TestError: AbortError {
line: UInt = #line,
column: UInt = #column,
range: Range<UInt>? = nil,
stackTrace: StackTrace = .capture()
stackTrace: StackTrace? = .capture()
) {
self.source = .init(
file: file,
Expand Down
14 changes: 11 additions & 3 deletions Sources/Vapor/Application.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import Backtrace

public protocol LockKey { }

public final class Application {
public var environment: Environment
public let eventLoopGroupProvider: EventLoopGroupProvider
Expand All @@ -21,6 +19,7 @@ public final class Application {
self.handlers.append(handler)
}
}

public var lifecycle: Lifecycle

public final class Locks {
Expand All @@ -46,7 +45,9 @@ public final class Application {
}
}
}

public var locks: Locks

public var sync: Lock {
self.locks.main
}
Expand Down Expand Up @@ -77,11 +78,16 @@ public final class Application {
self.isBooted = false
self.core.initialize()
self.views.initialize()
self.passwords.use(.bcrypt)
self.sessions.initialize()
self.sessions.use(.memory)
self.responder.initialize()
self.responder.use(.default)
self.commands.use(self.server.command, as: "serve", isDefault: true)
self.servers.initialize()
self.servers.use(.http)
self.clients.initialize()
self.clients.use(.http)
self.commands.use(self.servers.command, as: "serve", isDefault: true)
self.commands.use(RoutesCommand(), as: "routes")
// Load specific .env first since values are not overridden.
self.loadDotEnv(named: ".env.\(self.environment.name)")
Expand Down Expand Up @@ -162,3 +168,5 @@ public final class Application {
}
}
}

public protocol LockKey { }