Skip to content

Commit

Permalink
Merge pull request #51 from SwiftPackageIndex/api-based-dependency-check
Browse files Browse the repository at this point in the history
Api based dependency check
  • Loading branch information
finestructure committed Jan 3, 2024
2 parents c9dcfa4 + 39b212b commit 86a4efe
Show file tree
Hide file tree
Showing 24 changed files with 1,145 additions and 222 deletions.
314 changes: 183 additions & 131 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,133 +1,185 @@
{
"object": {
"pins": [
{
"package": "async-http-client",
"repositoryURL": "https://github.com/swift-server/async-http-client.git",
"state": {
"branch": null,
"revision": "78db67e5bf4a8543075787f228e8920097319281",
"version": "1.18.0"
}
},
{
"package": "ShellOut",
"repositoryURL": "https://github.com/JohnSundell/ShellOut.git",
"state": {
"branch": null,
"revision": "e1577acf2b6e90086d01a6d5e2b8efdaae033568",
"version": "2.3.0"
}
},
{
"package": "swift-algorithms",
"repositoryURL": "https://github.com/apple/swift-algorithms.git",
"state": {
"branch": null,
"revision": "b14b7f4c528c942f121c8b860b9410b2bf57825e",
"version": "1.0.0"
}
},
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "6b2aa2748a7881eebb9f84fb10c01293e15b52ca",
"version": "0.5.0"
}
},
{
"package": "swift-atomics",
"repositoryURL": "https://github.com/apple/swift-atomics.git",
"state": {
"branch": null,
"revision": "6c89474e62719ddcc1e9614989fff2f68208fe10",
"version": "1.1.0"
}
},
{
"package": "swift-collections",
"repositoryURL": "https://github.com/apple/swift-collections.git",
"state": {
"branch": null,
"revision": "937e904258d22af6e447a0b72c0bc67583ef64a2",
"version": "1.0.4"
}
},
{
"package": "swift-log",
"repositoryURL": "https://github.com/apple/swift-log.git",
"state": {
"branch": null,
"revision": "532d8b529501fb73a2455b179e0bbb6d49b652ed",
"version": "1.5.3"
}
},
{
"package": "swift-nio",
"repositoryURL": "https://github.com/apple/swift-nio.git",
"state": {
"branch": null,
"revision": "cf281631ff10ec6111f2761052aa81896a83a007",
"version": "2.58.0"
}
},
{
"package": "swift-nio-extras",
"repositoryURL": "https://github.com/apple/swift-nio-extras.git",
"state": {
"branch": null,
"revision": "0e0d0aab665ff1a0659ce75ac003081f2b1c8997",
"version": "1.19.0"
}
},
{
"package": "swift-nio-http2",
"repositoryURL": "https://github.com/apple/swift-nio-http2.git",
"state": {
"branch": null,
"revision": "a8ccf13fa62775277a5d56844878c828bbb3be1a",
"version": "1.27.0"
}
},
{
"package": "swift-nio-ssl",
"repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
"state": {
"branch": null,
"revision": "e866a626e105042a6a72a870c88b4c531ba05f83",
"version": "2.24.0"
}
},
{
"package": "swift-nio-transport-services",
"repositoryURL": "https://github.com/apple/swift-nio-transport-services.git",
"state": {
"branch": null,
"revision": "e7403c35ca6bb539a7ca353b91cc2d8ec0362d58",
"version": "1.19.0"
}
},
{
"package": "swift-numerics",
"repositoryURL": "https://github.com/apple/swift-numerics",
"state": {
"branch": null,
"revision": "0a5bc04095a675662cf24757cc0640aa2204253b",
"version": "1.0.2"
}
},
{
"package": "swift-tagged",
"repositoryURL": "https://github.com/pointfreeco/swift-tagged.git",
"state": {
"branch": null,
"revision": "3907a9438f5b57d317001dc99f3f11b46882272b",
"version": "0.10.0"
}
}
]
},
"version": 1
"pins" : [
{
"identity" : "async-http-client",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swift-server/async-http-client.git",
"state" : {
"revision" : "16f7e62c08c6969899ce6cc277041e868364e5cf",
"version" : "1.19.0"
}
},
{
"identity" : "canonicalpackageurl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftPackageIndex/CanonicalPackageURL.git",
"state" : {
"revision" : "1588003a7b745ae899d9e9c9869187e6883bf129",
"version" : "0.0.7"
}
},
{
"identity" : "shellout",
"kind" : "remoteSourceControl",
"location" : "https://github.com/JohnSundell/ShellOut.git",
"state" : {
"revision" : "e1577acf2b6e90086d01a6d5e2b8efdaae033568",
"version" : "2.3.0"
}
},
{
"identity" : "swift-algorithms",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-algorithms.git",
"state" : {
"revision" : "f6919dfc309e7f1b56224378b11e28bab5bccc42",
"version" : "1.2.0"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41",
"version" : "1.3.0"
}
},
{
"identity" : "swift-atomics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-atomics.git",
"state" : {
"revision" : "cd142fd2f64be2100422d658e7411e39489da985",
"version" : "1.2.0"
}
},
{
"identity" : "swift-case-paths",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-case-paths",
"state" : {
"revision" : "bba1111185863c9288c5f047770f421c3b7793a4",
"version" : "1.1.3"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "a902f1823a7ff3c9ab2fba0f992396b948eda307",
"version" : "1.0.5"
}
},
{
"identity" : "swift-http-types",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-http-types",
"state" : {
"revision" : "1827dc94bdab2eb5f2fc804e9b0cb43574282566",
"version" : "1.0.2"
}
},
{
"identity" : "swift-log",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log.git",
"state" : {
"revision" : "532d8b529501fb73a2455b179e0bbb6d49b652ed",
"version" : "1.5.3"
}
},
{
"identity" : "swift-nio",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "702cd7c56d5d44eeba73fdf83918339b26dc855c",
"version" : "2.62.0"
}
},
{
"identity" : "swift-nio-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-extras.git",
"state" : {
"revision" : "798c962495593a23fdea0c0c63fd55571d8dff51",
"version" : "1.20.0"
}
},
{
"identity" : "swift-nio-http2",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-http2.git",
"state" : {
"revision" : "3bd9004b9d685ed6b629760fc84903e48efec806",
"version" : "1.29.0"
}
},
{
"identity" : "swift-nio-ssl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssl.git",
"state" : {
"revision" : "320bd978cceb8e88c125dcbb774943a92f6286e9",
"version" : "2.25.0"
}
},
{
"identity" : "swift-nio-transport-services",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-transport-services.git",
"state" : {
"revision" : "ebf8b9c365a6ce043bf6e6326a04b15589bd285e",
"version" : "1.20.0"
}
},
{
"identity" : "swift-numerics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-numerics",
"state" : {
"revision" : "0a5bc04095a675662cf24757cc0640aa2204253b",
"version" : "1.0.2"
}
},
{
"identity" : "swift-parsing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-parsing.git",
"state" : {
"revision" : "a0e7d73f462c1c38c59dc40a3969ac40cea42950",
"version" : "0.13.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
}
},
{
"identity" : "swift-tagged",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-tagged.git",
"state" : {
"revision" : "3907a9438f5b57d317001dc99f3f11b46882272b",
"version" : "0.10.0"
}
},
{
"identity" : "xctest-dynamic-overlay",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631",
"version" : "1.0.2"
}
}
],
"version" : 2
}
23 changes: 11 additions & 12 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:5.8

// Copyright Dave Verwer, Sven A. Schmidt, and other contributors.
//
Expand All @@ -23,25 +23,24 @@ let package = Package(
.executable(name: "validator", targets: ["validator"])
],
dependencies: [
.package(name: "async-http-client",
url: "https://github.com/swift-server/async-http-client.git", from: "1.2.0"),
.package(name: "swift-argument-parser",
url: "https://github.com/apple/swift-argument-parser", from: "0.2.0"),
.package(url: "https://github.com/JohnSundell/ShellOut.git", from: "2.3.0"),
.package(name: "swift-tagged",
url: "https://github.com/pointfreeco/swift-tagged.git", from: "0.5.0"),
.package(url: "https://github.com/apple/swift-algorithms.git", from: "1.0.0")
.package(url: "https://github.com/SwiftPackageIndex/CanonicalPackageURL.git", from: "0.0.6"),
.package(url: "https://github.com/apple/swift-algorithms.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"),
.package(url: "https://github.com/pointfreeco/swift-tagged.git", from: "0.5.0"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.2.0"),
],
targets: [
.target(name: "validator", dependencies: ["ValidatorCore"]),
.executableTarget(name: "validator", dependencies: ["ValidatorCore"]),
.target(
name: "ValidatorCore",
dependencies: [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "Algorithms", package: "swift-algorithms"),
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"ShellOut",
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "CanonicalPackageURL", package: "CanonicalPackageURL"),
.product(name: "ShellOut", package: "ShellOut"),
.product(name: "Tagged", package: "swift-tagged"),
.product(name: "Algorithms", package: "swift-algorithms"),
]),
.testTarget(name: "ValidatorTests",
dependencies: ["ValidatorCore"],
Expand Down
1 change: 1 addition & 0 deletions Sources/ValidatorCore/AppError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Foundation
enum AppError: Error {
case decodingError(context: String, underlyingError: Error, json: String)
case dumpPackageError(String)
case githubTokenNotSet
case invalidPackage(url: PackageURL)
case invalidDenyListUrl(string: String)
case ioError(String)
Expand Down
4 changes: 4 additions & 0 deletions Sources/ValidatorCore/Cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ struct Cache<T: Codable> {
struct Key: Codable, Hashable, CustomStringConvertible {
let string: String

init(string: String) {
self.string = string.lowercased()
}

var description: String { string }
}

Expand Down
Loading

0 comments on commit 86a4efe

Please sign in to comment.