Skip to content

Commit 18ea7ae

Browse files
Merge pull request #3788 from SwiftPackageIndex/re-enable-collection-signing
Re enable collection signing
2 parents d254081 + 6fc3d3f commit 18ea7ae

File tree

12 files changed

+335
-209
lines changed

12 files changed

+335
-209
lines changed

Package.resolved

Lines changed: 93 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ let package = Package(
2929
dependencies: [
3030
.package(url: "https://github.com/JohnSundell/Ink.git", from: "0.5.1"),
3131
.package(url: "https://github.com/swift-server/swift-prometheus.git", from: "1.0.0"),
32+
.package(url: "https://github.com/SwiftPackageIndex/Plot.git", branch: "main"),
3233
.package(url: "https://github.com/SwiftPackageIndex/CanonicalPackageURL.git", from: "1.0.0"),
3334
.package(url: "https://github.com/SwiftPackageIndex/DependencyResolution.git", from: "1.1.2"),
34-
.package(url: "https://github.com/SwiftPackageIndex/PackageCollections.git", branch: "main"),
35-
.package(url: "https://github.com/SwiftPackageIndex/Plot.git", branch: "main"),
3635
.package(url: "https://github.com/SwiftPackageIndex/SPIManifest.git", from: "1.2.0"),
3736
.package(url: "https://github.com/SwiftPackageIndex/SemanticVersion.git", from: "0.3.0"),
3837
.package(url: "https://github.com/SwiftPackageIndex/ShellOut.git", from: "3.1.4"),
38+
.package(url: "https://github.com/swiftlang/swift-package-manager.git", branch: "release/6.1"),
3939
.package(url: "https://github.com/pointfreeco/swift-custom-dump.git", from: "1.0.0"),
4040
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.8.0"),
4141
.package(url: "https://github.com/pointfreeco/swift-parsing.git", from: "0.12.0"),
@@ -68,10 +68,11 @@ let package = Package(
6868
.product(name: "DependencyResolution", package: "DependencyResolution"),
6969
.product(name: "Fluent", package: "fluent"),
7070
.product(name: "FluentPostgresDriver", package: "fluent-postgres-driver"),
71-
.product(name: "PackageCollections", package: "PackageCollections"),
7271
.product(name: "Parsing", package: "swift-parsing"),
7372
.product(name: "Redis", package: "redis"),
7473
.product(name: "ShellOut", package: "ShellOut"),
74+
.product(name: "SwiftPMDataModel-auto", package: "swift-package-manager"),
75+
.product(name: "SwiftPMPackageCollections", package: "swift-package-manager"),
7576
.product(name: "Vapor", package: "vapor"),
7677
.product(name: "SotoCognitoAuthentication", package: "soto-cognito-authentication"),
7778
.product(name: "JWTKit", package: "jwt-kit")

Sources/App/Controllers/API/API+PackageCollectionController.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import Fluent
1616
import PackageCollectionsModel
17+
import PackageCollectionsSigning
1718
import Vapor
1819

1920

@@ -22,14 +23,14 @@ extension API {
2223
enum PackageCollectionController {
2324

2425
@Sendable
25-
static func generate(req: Request) async throws -> PackageCollection {
26+
static func generate(req: Request) async throws -> SignedCollection {
2627
AppMetrics.apiPackageCollectionGetTotal?.inc()
2728

2829
let dto = try req.content.decode(PostPackageCollectionDTO.self)
2930

3031
switch dto.selection {
3132
case let .author(author):
32-
return try await PackageCollection.generate(
33+
return try await SignedCollection.generate(
3334
db: req.db,
3435
filterBy: .author(author),
3536
authorName: dto.authorName ?? "Swift Package Index",
@@ -43,7 +44,7 @@ extension API {
4344
guard packageURLs.count <= 20 else {
4445
throw Abort(.badRequest)
4546
}
46-
return try await PackageCollection.generate(
47+
return try await SignedCollection.generate(
4748
db: req.db,
4849
filterBy: .urls(packageURLs),
4950
authorName: dto.authorName ?? "Swift Package Index",
@@ -60,7 +61,7 @@ extension API {
6061
}
6162

6263

63-
extension PackageCollectionModel.V1.Collection: Vapor.Content {}
64+
extension PackageCollectionSigning.Model.SignedCollection: @retroactive @unchecked Sendable, Vapor.Content {}
6465

6566

6667
extension API {

0 commit comments

Comments
 (0)