Skip to content

Commit

Permalink
Merge pull request #8 from marius-se/vapor-4
Browse files Browse the repository at this point in the history
Migrate to Vapor 4
  • Loading branch information
0xTim authored Feb 13, 2023
2 parents 1348859 + e6e9352 commit 074f3c2
Show file tree
Hide file tree
Showing 68 changed files with 3,657 additions and 3,387 deletions.
12 changes: 2 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@

# Created by https://www.gitignore.io/api/vapor

### Vapor ###
Config/secrets

### Vapor Patch ###
Packages
.build
xcuserdata
*.xcodeproj
DerivedData/
.DS_Store
Package.pins
Package.resolved
db.sqlite
.swiftpm

# End of https://www.gitignore.io/api/vapor
185 changes: 185 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{
"pins" : [
{
"identity" : "async-http-client",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swift-server/async-http-client.git",
"state" : {
"revision" : "fc510a39cff61b849bf5cdff17eb2bd6d0777b49",
"version" : "1.11.5"
}
},
{
"identity" : "async-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/async-kit.git",
"state" : {
"revision" : "c3329e444bafbb12d1d312af9191be95348a8175",
"version" : "1.13.0"
}
},
{
"identity" : "console-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/console-kit.git",
"state" : {
"revision" : "a7e67a1719933318b5ab7eaaed355cde020465b1",
"version" : "4.5.0"
}
},
{
"identity" : "multipart-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/multipart-kit.git",
"state" : {
"revision" : "0d55c35e788451ee27222783c7d363cb88092fab",
"version" : "4.5.2"
}
},
{
"identity" : "routing-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/routing-kit.git",
"state" : {
"revision" : "ffac7b3a127ce1e85fb232f1a6271164628809ad",
"version" : "4.6.0"
}
},
{
"identity" : "swift-algorithms",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-algorithms.git",
"state" : {
"revision" : "b14b7f4c528c942f121c8b860b9410b2bf57825e",
"version" : "1.0.0"
}
},
{
"identity" : "swift-atomics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-atomics.git",
"state" : {
"revision" : "919eb1d83e02121cdb434c7bfc1f0c66ef17febe",
"version" : "1.0.2"
}
},
{
"identity" : "swift-backtrace",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swift-server/swift-backtrace.git",
"state" : {
"revision" : "f25620d5d05e2f1ba27154b40cafea2b67566956",
"version" : "1.3.3"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "f504716c27d2e5d4144fa4794b12129301d17729",
"version" : "1.0.3"
}
},
{
"identity" : "swift-crypto",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-crypto.git",
"state" : {
"revision" : "d9825fa541df64b1a7b182178d61b9a82730d01f",
"version" : "2.1.0"
}
},
{
"identity" : "swift-log",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log.git",
"state" : {
"revision" : "6fe203dc33195667ce1759bf0182975e4653ba1c",
"version" : "1.4.4"
}
},
{
"identity" : "swift-metrics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-metrics.git",
"state" : {
"revision" : "53be78637ecd165d1ddedc4e20de69b8f43ec3b7",
"version" : "2.3.2"
}
},
{
"identity" : "swift-nio",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "b4e0a274f7f34210e97e2f2c50ab02a10b549250",
"version" : "2.41.1"
}
},
{
"identity" : "swift-nio-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-extras.git",
"state" : {
"revision" : "6c84d247754ad77487a6f0694273b89b83efd056",
"version" : "1.14.0"
}
},
{
"identity" : "swift-nio-http2",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-http2.git",
"state" : {
"revision" : "f9ab1c94c80d568efd762d2a638f25162691d766",
"version" : "1.22.1"
}
},
{
"identity" : "swift-nio-ssl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssl.git",
"state" : {
"revision" : "ba7c0d7f82affc518147ea61d240330bf7f7ea9b",
"version" : "2.22.1"
}
},
{
"identity" : "swift-nio-transport-services",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-transport-services.git",
"state" : {
"revision" : "4e02d9cf35cabfb538c96613272fb027dd0c8692",
"version" : "1.13.1"
}
},
{
"identity" : "swift-numerics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-numerics",
"state" : {
"revision" : "0a5bc04095a675662cf24757cc0640aa2204253b",
"version" : "1.0.2"
}
},
{
"identity" : "vapor",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/vapor.git",
"state" : {
"revision" : "dda0de537e7906414dccd551e77095be1e34e3da",
"version" : "4.65.2"
}
},
{
"identity" : "websocket-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/websocket-kit.git",
"state" : {
"revision" : "2d9d2188a08eef4a869d368daab21b3c08510991",
"version" : "2.6.1"
}
}
],
"version" : 2
}
25 changes: 22 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
// swift-tools-version:5.6
import PackageDescription

let package = Package(
name: "VaporOAuth",
name: "vapor-oauth",
platforms: [
.macOS(.v12)
],
products: [
.library(
name: "OAuth",
targets: ["VaporOAuth"]
)
],
dependencies: [
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
.Package(url: "https://github.com/vapor/auth-provider.git", majorVersion: 1),
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0")
],
targets: [
.target(
name: "VaporOAuth",
dependencies: [.product(name: "Vapor", package: "vapor")]
),
.testTarget(name: "VaporOAuthTests", dependencies: [
.target(name: "VaporOAuth"),
.product(name: "XCTVapor", package: "vapor")
])
]
)
18 changes: 0 additions & 18 deletions [email protected]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import HTTP
import URI
import Vapor

public struct EmptyAuthorizationHandler: AuthorizeHandler {

public init() {}

public func handleAuthorizationError(_ errorType: AuthorizationError) throws -> ResponseRepresentable {
return ""
public func handleAuthorizationRequest(
_ request: Request,
authorizationRequestObject: AuthorizationRequestObject
) async throws -> Response {
Response(body: "")
}

public func handleAuthorizationRequest(_ request: Request,
authorizationRequestObject: AuthorizationRequestObject) throws -> ResponseRepresentable {
return ""
public func handleAuthorizationError(_ errorType: AuthorizationError) async throws -> Response {
Response(body: "")
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import Node

public struct EmptyCodeManager: CodeManager {
public init() {}

public func getCode(_ code: String) -> OAuthCode? {
return nil
}

public func generateCode(userID: Identifier, clientID: String, redirectURI: String, scopes: [String]?) throws -> String {
public func generateCode(
userID: String,
clientID: String,
redirectURI: String,
scopes: [String]?
) throws -> String {
return ""
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import Node

public struct EmptyUserManager: UserManager {

public init() {}

public func getUser(userID: Identifier) -> OAuthUser? {
public func getUser(userID: String) -> OAuthUser? {
return nil
}

public func authenticateUser(username: String, password: String) -> Identifier? {
public func authenticateUser(username: String, password: String) -> String? {
return nil
}
}
75 changes: 0 additions & 75 deletions Sources/VaporOAuth/Helper/Helper.swift

This file was deleted.

Loading

0 comments on commit 074f3c2

Please sign in to comment.