Skip to content

Commit 52b4c24

Browse files
authored
Change default FingerprintCheckingMode to 'strict' (#4304)
rdar://85989302
1 parent e78566f commit 52b4c24

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Sources/Commands/Options.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2022 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -176,7 +176,7 @@ struct SecurityOptions: ParsableArguments {
176176
#endif
177177

178178
@Option(name: .customLong("resolver-fingerprint-checking"))
179-
var fingerprintCheckingMode: FingerprintCheckingMode = .warn
179+
var fingerprintCheckingMode: FingerprintCheckingMode = .strict
180180

181181
@Flag(name: .customLong("netrc"), help: .hidden)
182182
var _deprecated_netrc: Bool = false

Sources/Workspace/Workspace+Configuration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2018-2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2018-2022 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -716,7 +716,7 @@ public struct WorkspaceConfiguration {
716716
prefetchBasedOnResolvedFile: true,
717717
additionalFileRules: [],
718718
sharedDependenciesCacheEnabled: true,
719-
fingerprintCheckingMode: .warn,
719+
fingerprintCheckingMode: .strict,
720720
sourceControlToRegistryDependencyTransformation: .disabled
721721
)
722722
}

Sources/Workspace/Workspace.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2022 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -476,7 +476,7 @@ public class Workspace {
476476
additionalFileRules: [FileRuleDescription]? = .none,
477477
resolverUpdateEnabled: Bool? = .none,
478478
resolverPrefetchingEnabled: Bool? = .none,
479-
resolverFingerprintCheckingMode: FingerprintCheckingMode = .warn,
479+
resolverFingerprintCheckingMode: FingerprintCheckingMode = .strict,
480480
sharedRepositoriesCacheEnabled: Bool? = .none,
481481
delegate: Delegate? = .none
482482
) throws {

Tests/PackageRegistryTests/RegistryClientTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -372,7 +372,7 @@ final class RegistryClientTests: XCTestCase {
372372
let registryClient = makeRegistryClient(configuration: configuration,
373373
httpClient: httpClient,
374374
fingerprintStorage: fingerprintStorage,
375-
fingerprintCheckingMode: .strict)
375+
fingerprintCheckingMode: .strict) // intended for this test; don't change
376376

377377
XCTAssertThrowsError(try registryClient.fetchSourceArchiveChecksum(package: identity, version: version)) { error in
378378
guard case RegistryError.checksumChanged = error else {
@@ -441,7 +441,7 @@ final class RegistryClientTests: XCTestCase {
441441
let registryClient = makeRegistryClient(configuration: configuration,
442442
httpClient: httpClient,
443443
fingerprintStorage: fingerprintStorage,
444-
fingerprintCheckingMode: .warn)
444+
fingerprintCheckingMode: .warn) // intended for this test; don't change
445445

446446
let observability = ObservabilitySystem.makeForTesting()
447447

@@ -594,7 +594,7 @@ final class RegistryClientTests: XCTestCase {
594594
let registryClient = RegistryClient(
595595
configuration: configuration,
596596
fingerprintStorage: fingerprintStorage,
597-
fingerprintCheckingMode: .strict,
597+
fingerprintCheckingMode: .strict, // intended for this test; don't change
598598
customHTTPClient: httpClient,
599599
customArchiverProvider: { fileSystem in
600600
MockArchiver(handler: { _, from, to, callback in
@@ -677,7 +677,7 @@ final class RegistryClientTests: XCTestCase {
677677
let registryClient = RegistryClient(
678678
configuration: configuration,
679679
fingerprintStorage: fingerprintStorage,
680-
fingerprintCheckingMode: .warn,
680+
fingerprintCheckingMode: .warn, // intended for this test; don't change
681681
customHTTPClient: httpClient,
682682
customArchiverProvider: { fileSystem in
683683
MockArchiver(handler: { _, from, to, callback in

0 commit comments

Comments
 (0)