Skip to content

Commit 3d00374

Browse files
github-actions[bot]Firefox Sync Engineering
andauthored
Auto update with latest AS Release v91.0.0 (#37)
* Version 91.0.0 Co-authored-by: Firefox Sync Engineering <[email protected]>
1 parent 4ca440b commit 3d00374

16 files changed

+1112
-230
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// swift-tools-version:5.4
22
import PackageDescription
33

4-
let checksum = "397f09236f031fe614bfdbc5ba4b8953bfd98e1df640e442962a5d7e2b96d006"
5-
let version = "v90.0.0"
4+
let checksum = "24d3d6a0364adef008bf33549751dee847b09d6b046666e955480805ca508d9a"
5+
let version = "v91.0.0"
66
let url = "https://github.com/mozilla/application-services/releases/download/\(version)/MozillaRustComponents.xcframework.zip"
77

88
let package = Package(

generated/fxa-client/FxAClient/FxAccountStorage.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
import Foundation
6-
import SwiftKeychainWrapper
76

87
class KeyChainAccountStorage {
9-
internal var keychainWrapper: KeychainWrapper
8+
internal var keychainWrapper: MZKeychainWrapper
109
internal static var keychainKey: String = "accountJSON"
11-
internal static var accessibility: KeychainItemAccessibility = .afterFirstUnlock
10+
internal static var accessibility: MZKeychainItemAccessibility = .afterFirstUnlock
1211

1312
init(keychainAccessGroup: String?) {
14-
keychainWrapper = KeychainWrapper.sharedAppContainerKeychain(keychainAccessGroup: keychainAccessGroup)
13+
keychainWrapper = MZKeychainWrapper.sharedAppContainerKeychain(keychainAccessGroup: keychainAccessGroup)
1514
}
1615

1716
func read() -> PersistedFirefoxAccount? {
@@ -55,9 +54,9 @@ class KeyChainAccountStorage {
5554
}
5655
}
5756

58-
public extension KeychainWrapper {
57+
public extension MZKeychainWrapper {
5958
func ensureStringItemAccessibility(
60-
_ accessibility: SwiftKeychainWrapper.KeychainItemAccessibility,
59+
_ accessibility: MZKeychainItemAccessibility,
6160
forKey key: String
6261
) {
6362
if hasValue(forKey: key) {

generated/fxa-client/FxAClient/KeychainWrapper+.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
import Foundation
6-
import SwiftKeychainWrapper
76

8-
extension KeychainWrapper {
7+
extension MZKeychainWrapper {
98
/// Return the base bundle identifier.
109
///
1110
/// This function is smart enough to find out if it is being called from an extension or the main application. In
@@ -22,13 +21,13 @@ extension KeychainWrapper {
2221
return baseBundleIdentifier
2322
}
2423

25-
static var shared: KeychainWrapper?
24+
static var shared: MZKeychainWrapper?
2625

27-
static func sharedAppContainerKeychain(keychainAccessGroup: String?) -> KeychainWrapper {
26+
static func sharedAppContainerKeychain(keychainAccessGroup: String?) -> MZKeychainWrapper {
2827
if let s = shared {
2928
return s
3029
}
31-
let wrapper = KeychainWrapper(serviceName: baseBundleIdentifier, accessGroup: keychainAccessGroup)
30+
let wrapper = MZKeychainWrapper(serviceName: baseBundleIdentifier, accessGroup: keychainAccessGroup)
3231
shared = wrapper
3332
return wrapper
3433
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
//
2+
// KeychainOptions.swift
3+
// SwiftKeychainWrapper
4+
//
5+
// Created by James Blair on 4/24/16.
6+
// Copyright © 2016 Jason Rendel. All rights reserved.
7+
//
8+
// The MIT License (MIT)
9+
//
10+
// Permission is hereby granted, free of charge, to any person obtaining a copy
11+
// of this software and associated documentation files (the "Software"), to deal
12+
// in the Software without restriction, including without limitation the rights
13+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
// copies of the Software, and to permit persons to whom the Software is
15+
// furnished to do so, subject to the following conditions:
16+
//
17+
// The above copyright notice and this permission notice shall be included in all
18+
// copies or substantial portions of the Software.
19+
//
20+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26+
// SOFTWARE.
27+
28+
// swiftlint:disable all
29+
30+
import Foundation
31+
32+
protocol MZKeychainAttrRepresentable {
33+
var keychainAttrValue: CFString { get }
34+
}
35+
36+
// MARK: - KeychainItemAccessibility
37+
38+
public enum MZKeychainItemAccessibility {
39+
/**
40+
The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user.
41+
42+
After the first unlock, the data remains accessible until the next restart. This is recommended for items that need to be accessed by background applications. Items with this attribute migrate to a new device when using encrypted backups.
43+
*/
44+
@available(iOS 4, *)
45+
case afterFirstUnlock
46+
47+
/**
48+
The data in the keychain item cannot be accessed after a restart until the device has been unlocked once by the user.
49+
50+
After the first unlock, the data remains accessible until the next restart. This is recommended for items that need to be accessed by background applications. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present.
51+
*/
52+
@available(iOS 4, *)
53+
case afterFirstUnlockThisDeviceOnly
54+
55+
/**
56+
The data in the keychain item can always be accessed regardless of whether the device is locked.
57+
58+
This is not recommended for application use. Items with this attribute migrate to a new device when using encrypted backups.
59+
*/
60+
@available(iOS 4, *)
61+
case always
62+
63+
/**
64+
The data in the keychain can only be accessed when the device is unlocked. Only available if a passcode is set on the device.
65+
66+
This is recommended for items that only need to be accessible while the application is in the foreground. Items with this attribute never migrate to a new device. After a backup is restored to a new device, these items are missing. No items can be stored in this class on devices without a passcode. Disabling the device passcode causes all items in this class to be deleted.
67+
*/
68+
@available(iOS 8, *)
69+
case whenPasscodeSetThisDeviceOnly
70+
71+
/**
72+
The data in the keychain item can always be accessed regardless of whether the device is locked.
73+
74+
This is not recommended for application use. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present.
75+
*/
76+
@available(iOS 4, *)
77+
case alwaysThisDeviceOnly
78+
79+
/**
80+
The data in the keychain item can be accessed only while the device is unlocked by the user.
81+
82+
This is recommended for items that need to be accessible only while the application is in the foreground. Items with this attribute migrate to a new device when using encrypted backups.
83+
84+
This is the default value for keychain items added without explicitly setting an accessibility constant.
85+
*/
86+
@available(iOS 4, *)
87+
case whenUnlocked
88+
89+
/**
90+
The data in the keychain item can be accessed only while the device is unlocked by the user.
91+
92+
This is recommended for items that need to be accessible only while the application is in the foreground. Items with this attribute do not migrate to a new device. Thus, after restoring from a backup of a different device, these items will not be present.
93+
*/
94+
@available(iOS 4, *)
95+
case whenUnlockedThisDeviceOnly
96+
97+
static func accessibilityForAttributeValue(_ keychainAttrValue: CFString) -> MZKeychainItemAccessibility? {
98+
for (key, value) in keychainItemAccessibilityLookup {
99+
if value == keychainAttrValue {
100+
return key
101+
}
102+
}
103+
104+
return nil
105+
}
106+
}
107+
108+
private let keychainItemAccessibilityLookup: [MZKeychainItemAccessibility: CFString] = {
109+
var lookup: [MZKeychainItemAccessibility: CFString] = [
110+
.afterFirstUnlock: kSecAttrAccessibleAfterFirstUnlock,
111+
.afterFirstUnlockThisDeviceOnly: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly,
112+
.always: kSecAttrAccessibleAlways,
113+
.whenPasscodeSetThisDeviceOnly: kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly,
114+
.alwaysThisDeviceOnly: kSecAttrAccessibleAlwaysThisDeviceOnly,
115+
.whenUnlocked: kSecAttrAccessibleWhenUnlocked,
116+
.whenUnlockedThisDeviceOnly: kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
117+
]
118+
119+
return lookup
120+
}()
121+
122+
extension MZKeychainItemAccessibility: MZKeychainAttrRepresentable {
123+
internal var keychainAttrValue: CFString {
124+
return keychainItemAccessibilityLookup[self]!
125+
}
126+
}

0 commit comments

Comments
 (0)