Skip to content
Merged
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
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [1.4.0] - 2026-03-18
## [1.2.1] - 2026-06-17
### Added
- Added retroactive conformance to `@unchecked Sendable` for `SecCertificate`, `SecIdentity`, `SecKey`, and `SecKeychainItem`. This is safe because Apple eventually adds this same conformance beginning in Xcode 26.

## [1.2.0] - 2026-03-18
### Added
- Added convenience methods for accessing mock data values on the `HaversackEphemeralStrategy`
- Added `Sendable` conformance to all public types, protocols, and enums.
Expand All @@ -21,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Internal `CFString` dictionary keys migrated to `String` for `Sendable` compatibility.
- Completion handlers and closure properties marked `@Sendable`.

## [1.3.0] - 2024-02-11
## [1.2.0-prerelease] - 2024-02-11
### Added
- Added support for visionOS.

Expand Down
5 changes: 2 additions & 3 deletions Sources/Haversack/Entities/PasswordBaseEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ public protocol PasswordBaseEntity: KeychainStorable {
/// - Note: Uses `kSecValueData`.
var passwordData: Data? { get set }

// NOTE: This function has a cyclomatic complexity of 11 instead of the allowed 10.
// swiftlint:disable:next cyclomatic_complexity
func entityQuery(includeSecureData: Bool) -> SecurityFrameworkQuery
}

Expand All @@ -76,7 +74,8 @@ extension PasswordBaseEntity {
return passwordData == nil
}

// swiftlint:disable:next identifier_name
// NOTE: This function has a cyclomatic complexity of 11 instead of the allowed 10.
// swiftlint:disable:next identifier_name cyclomatic_complexity
func _entityQuery(includeSecureData: Bool) -> SecurityFrameworkQuery {
var newQuery = SecurityFrameworkQuery()

Expand Down
4 changes: 2 additions & 2 deletions Sources/Haversack/NSLocked.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import Foundation
public struct NSLocked<T>: @unchecked Sendable {
private let lock = NSLock()
private var value: T

public init(wrappedValue: T) {
value = wrappedValue
}

public var wrappedValue: T {
get {
lock.withLock {
Expand Down
20 changes: 20 additions & 0 deletions Sources/Haversack/SecuritySendable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: MIT
// Copyright 2026, Jamf

import Security

#if compiler(<6) // conformance for Xcode less than 16.0, @retroactive unavailable until Swift 6
extension SecCertificate: @unchecked Sendable {}
extension SecIdentity: @unchecked Sendable {}
extension SecKey: @unchecked Sendable {}
#if os(macOS)
extension SecKeychainItem: @unchecked Sendable {}
#endif
#elseif compiler(<6.2) // retroactive conformance for Xcode 16.0
extension SecCertificate: @retroactive @unchecked Sendable {}
extension SecIdentity: @retroactive @unchecked Sendable {}
extension SecKey: @retroactive @unchecked Sendable {}
#if os(macOS)
extension SecKeychainItem: @retroactive @unchecked Sendable {}
#endif
#endif