Skip to content

Commit

Permalink
Fix 'access group' capitalization (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket committed Jun 29, 2022
1 parent a066671 commit c7bda30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![Coverage Status](https://img.shields.io/codecov/c/github/auth0/SimpleKeychain/master.svg?style=flat)
![License](https://img.shields.io/github/license/Auth0/SimpleKeychain.svg?style=flat)

Easily store your user's credentials in the Keychain. Supports sharing credentials with an **Access Group** or through **iCloud**, and integrating **Touch ID / Face ID**.
Easily store your user's credentials in the Keychain. Supports sharing credentials with an **access group** or through **iCloud**, and integrating **Touch ID / Face ID**.

> ⚠️ This library is currently in [**First Availability**](https://auth0.com/docs/troubleshoot/product-lifecycle/product-release-stages). We do not recommend using this library in production yet. As we move towards General Availability, please be aware that releases may contain breaking changes.
Expand All @@ -31,7 +31,7 @@ Easily store your user's credentials in the Keychain. Supports sharing credentia
+ [Error handling](#error-handling)
- [**Configuration**](#configuration)
+ [Include additional attributes](#include-additional-attributes)
+ [Share items with other apps and extensions using an Access Group](#share-items-with-other-apps-and-extensions-using-an-access-group)
+ [Share items with other apps and extensions using an access group](#share-items-with-other-apps-and-extensions-using-an-access-group)
+ [Share items with other devices through iCloud synchronization](#share-items-with-other-devices-through-icloud-synchronization)
+ [Restrict item accessibility based on device state](#restrict-item-accessibility-based-on-device-state)
+ [Require Touch ID / Face ID to retrieve an item](#require-touch-id--face-id-to-retrieve-an-item)
Expand Down Expand Up @@ -166,15 +166,15 @@ When creating the SimpleKeychain instance, specify additional attributes to incl
let simpleKeychain = SimpleKeychain(attributes: [kSecUseDataProtectionKeychain as String: true])
```

### Share items with other apps and extensions using an Access Group
### Share items with other apps and extensions using an access group

When creating the SimpleKeychain instance, specify the Access Group that the app may share entries with.
When creating the SimpleKeychain instance, specify the access group that the app may share entries with.

```swift
let simpleKeychain = SimpleKeychain(accessGroup: "ABCDEFGH.com.example.myaccessgroup")
```

> 💡 For more information on Access Group sharing, see [Sharing Access to Keychain Items Among a Collection of Apps](https://developer.apple.com/documentation/security/keychain_services/keychain_items/sharing_access_to_keychain_items_among_a_collection_of_apps).
> 💡 For more information on access group sharing, see [Sharing Access to Keychain Items Among a Collection of Apps](https://developer.apple.com/documentation/security/keychain_services/keychain_items/sharing_access_to_keychain_items_among_a_collection_of_apps).
### Share items with other devices through iCloud synchronization

Expand Down
2 changes: 1 addition & 1 deletion SimpleKeychain.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Pod::Spec.new do |s|
s.summary = 'A simple Keychain wrapper for iOS, macOS, tvOS, and watchOS'
s.description = <<-DESC
Easily store your user's credentials in the Keychain.
Supports sharing credentials with an Access Group or through iCloud, and integrating Touch ID / Face ID.
Supports sharing credentials with an access group or through iCloud, and integrating Touch ID / Face ID.
DESC
s.homepage = 'https://github.com/auth0/SimpleKeychain'
s.license = 'MIT'
Expand Down
9 changes: 5 additions & 4 deletions SimpleKeychain/SimpleKeychain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ typealias RetrieveFunction = (_ query: CFDictionary, _ result: UnsafeMutablePoin
typealias RemoveFunction = (_ query: CFDictionary) -> OSStatus

/// A simple Keychain wrapper for iOS, macOS, tvOS, and watchOS.
/// Supports sharing credentials with an **Access Group** or through **iCloud**, and integrating **Touch ID / Face ID**.
/// Supports sharing credentials with an **access group** or through **iCloud**, and integrating **Touch ID / Face ID**.
public struct SimpleKeychain {
let service: String
let accessGroup: String?
Expand All @@ -26,10 +26,10 @@ public struct SimpleKeychain {
/// Initializes a ``SimpleKeychain`` instance.
///
/// - Parameter service: Name of the service under which to save items. Defaults to the bundle identifier.
/// - Parameter accessGroup: Access Group for sharing Keychain items. Defaults to `nil`.
/// - Parameter accessGroup: access group for sharing Keychain items. Defaults to `nil`.
/// - Parameter accessibility: ``Accessibility`` type the stored items will have. Defaults to ``Accessibility/afterFirstUnlock``.
/// - Parameter accessControlFlags: Access control conditions for `kSecAttrAccessControl`. Defaults to `nil`.
/// - Parameter context: `LAContext` used to access Keychain items. Defaults to a new `LAContext` instance.
/// - Parameter context: `LAContext` used to access Keychain items. Defaults to `nil`.
/// - Parameter synchronizable: Whether the items should be synchronized through iCloud. Defaults to `false`.
/// - Parameter attributes: Additional attributes to include in every query. Defaults to an empty dictionary.
/// - Returns: A ``SimpleKeychain`` instance.
Expand All @@ -52,7 +52,7 @@ public struct SimpleKeychain {
/// Initializes a ``SimpleKeychain`` instance.
///
/// - Parameter service: Name of the service under which to save items. Defaults to the bundle identifier.
/// - Parameter accessGroup: Access Group for sharing Keychain items. Defaults to `nil`.
/// - Parameter accessGroup: access group for sharing Keychain items. Defaults to `nil`.
/// - Parameter accessibility: ``Accessibility`` type the stored items will have. Defaults to ``Accessibility/afterFirstUnlock``.
/// - Parameter accessControlFlags: Access control conditions for `kSecAttrAccessControl`. Defaults to `nil`.
/// - Parameter synchronizable: Whether the items should be synchronized through iCloud. Defaults to `false`.
Expand Down Expand Up @@ -306,6 +306,7 @@ extension SimpleKeychain {
query[kSecAttrAccessControl as String] = access
} else {
#if os(macOS)
// See https://developer.apple.com/documentation/security/ksecattraccessible
if self.isSynchronizable || query[kSecUseDataProtectionKeychain as String] as? Bool == true {
query[kSecAttrAccessible as String] = self.accessibility.rawValue
}
Expand Down

0 comments on commit c7bda30

Please sign in to comment.