Skip to content

1.0.0

Latest

Choose a tag to compare

@maniramezan maniramezan released this 05 Jul 22:56
2b06d4b

A Swift 6.3 keychain wrapper for Apple platforms with async-safe access, a property-wrapper convenience API, and first-class testability.

Highlights

  • Keychain actor — typed, async-safe reads/writes for arbitrary Sendable values via KeychainKey, backed by a SecureStorageBackend seam that keeps all CFDictionary/CFTypeRef handling isolated to AppleKeychainBackend.
  • @KeychainStorage property wrapper — synchronous, UserDefaults-like access for @MainActor-isolated types, with configurable accessGroup, accessibility, and isSynchronizable.
  • Swift macros — @KeychainItem, @KeychainScope, and #keychainKey for declarative keychain-backed properties and scoped key namespacing, included by default (no extra traits needed).
  • SwiftyChainTesting product — InMemoryKeychain and an injectable InMemoryKeychainBackend so downstream code can unit test without touching the real keychain.
  • Optional traits:
    • cryptography — kSecClassKey/SecKey storage for signing and key management
    • observation — AsyncSequence keychain change stream with @observable integration
  • Platform support — macOS 13+, iOS 16+, iPadOS 16+, tvOS 16+, watchOS 9+, visionOS 1+, with documented divergences (e.g. whenPasscodeSetThisDeviceOnly and iCloud sync unavailable on tvOS).

Quality bar

  • Strict Sendable/concurrency checking, no force unwraps, no in-memory value caching, no secret-value logging (see SECURITY.md for the full invariant list).
  • CI enforces swift-format --strict, -warnings-as-errors builds/tests across all trait combinations, real-keychain integration tests, and an 80% line-coverage gate.
  • Full DocC documentation (including tutorials) published to GitHub Pages and indexed on Swift Package Index.

Installation

.package(url: "https://github.com/maniramezan/SwiftyChain", from: "1.0.0")

Full Changelog: https://github.com/maniramezan/SwiftyChain/commits/1.0.0