Skip to content

Signer API call adjustments #62

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMajor(from: "1.0.2")),
.package(url: "https://github.com/apple/swift-package-manager.git", branch: "main"),
.package(url: "https://github.com/yim-lee/swift-package-manager.git", branch: "fix-package-collection-signer"),
.package(url: "https://github.com/swift-server/swift-backtrace.git", .upToNextMajor(from: "1.1.0")),
],
targets: [
Expand Down
15 changes: 11 additions & 4 deletions Sources/PackageCollectionSigner/PackageCollectionSign.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,18 @@ public struct PackageCollectionSign: ParsableCommand {
try localFileSystem.copy(from: rootCertPath, to: tmpDir.appending(component: rootCertFilename))

// Sign the collection
let signer = signer ?? PackageCollectionSigning(trustedRootCertsDir: tmpDir.asURL,
observabilityScope: ObservabilitySystem { _, diagnostic in print(diagnostic) }.topScope,
callbackQueue: DispatchQueue.global())
let signer = signer ?? PackageCollectionSigning(trustedRootCertsDir: tmpDir.asURL)
let observabilityScope = ObservabilitySystem { _, diagnostic in print(diagnostic) }.topScope
let signedCollection = try temp_await { callback in
signer.sign(collection: collection, certChainPaths: certChainURLs, certPrivateKeyPath: privateKeyURL, certPolicyKey: .default, callback: callback)
signer.sign(
collection: collection,
certChainPaths: certChainURLs,
certPrivateKeyPath: privateKeyURL,
certPolicyKey: .default,
observabilityScope: observabilityScope,
callbackQueue: DispatchQueue.global(),
callback: callback
)
}

// Make sure the output directory exists
Expand Down