Skip to content

Commit

Permalink
fix: Resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoey committed Sep 4, 2024
2 parents 58f6f7b + cb30953 commit 38c52a6
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 18 deletions.
3 changes: 3 additions & 0 deletions flutter_secure_storage/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 9.2.2
[iOS, macOS] Fixed an issue which caused the readAll and deleteAll to not work properly.

## 9.2.1
* Fix async race condition bug in storage operations.
* [macOS] Return nil on macOS if key is not found
Expand Down
12 changes: 6 additions & 6 deletions flutter_secure_storage/ios/Classes/FlutterSecureStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ class FlutterSecureStorage{
return .failure(OSSecError(status: status))
}
}
internal func readAll(groupId: String?, accountName: String?, synchronizable: Bool?) -> FlutterSecureStorageResponse {
var keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: nil, returnData: true, accessControl: nil)

internal func readAll(groupId: String?, accountName: String?, synchronizable: Bool?, accessibility: String?) -> FlutterSecureStorageResponse {
var keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: accessibility, returnData: true, accessControl: nil)

keychainQuery[kSecMatchLimit] = kSecMatchLimitAll
keychainQuery[kSecReturnAttributes] = true
Expand Down Expand Up @@ -131,9 +131,9 @@ class FlutterSecureStorage{

return FlutterSecureStorageResponse(status: status, value: value)
}
internal func deleteAll(groupId: String?, accountName: String?, synchronizable: Bool?) -> FlutterSecureStorageResponse {
let keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: nil, returnData: nil, accessControl: nil)

internal func deleteAll(groupId: String?, accountName: String?, synchronizable: Bool?, accessibility: String?) -> FlutterSecureStorageResponse {
let keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: accessibility, returnData: nil, accessControl: nil)
let status = SecItemDelete(keychainQuery as CFDictionary)

if (status == errSecItemNotFound) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ public class SwiftFlutterSecureStoragePlugin: NSObject, FlutterPlugin, FlutterSt

private func deleteAll(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) {
let values = parseCall(call)
let response = flutterSecureStorageManager.deleteAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable)
let response = flutterSecureStorageManager.deleteAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable, accessibility: values.accessibility)

handleResponse(values.key, response, result)
}

private func readAll(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) {
let values = parseCall(call)
let response = flutterSecureStorageManager.readAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable)
let response = flutterSecureStorageManager.readAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable, accessibility: values.accessibility)

handleResponse(values.key, response, result)
}
Expand Down
4 changes: 2 additions & 2 deletions flutter_secure_storage/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_secure_storage
description: Flutter Secure Storage provides API to store data in secure storage. Keychain is used in iOS, KeyStore based solution is used in Android.
version: 9.2.1
version: 9.2.2
repository: https://github.com/mogol/flutter_secure_storage/tree/develop/flutter_secure_storage

environment:
Expand Down Expand Up @@ -32,7 +32,7 @@ dependencies:
# validation, so we set a ^ constraint.
# https://github.com/flutter/flutter/issues/46264
flutter_secure_storage_linux: ^1.2.1
flutter_secure_storage_macos: ^3.1.1
flutter_secure_storage_macos: ^3.1.2
flutter_secure_storage_platform_interface: ^1.1.2
flutter_secure_storage_web: ^1.2.1
flutter_secure_storage_windows: ^3.1.2
Expand Down
3 changes: 3 additions & 0 deletions flutter_secure_storage_macos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.1.2
Fixed an issue which caused the readAll and deleteAll to not work properly.

## 3.1.1
Fixed an issue which caused a platform exception when the key does not exists in the keychain.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class FlutterSecureStorage{
}
}

internal func readAll(groupId: String?, accountName: String?, synchronizable: Bool?) -> FlutterSecureStorageResponse {
var keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: nil, returnData: true)
internal func readAll(groupId: String?, accountName: String?, synchronizable: Bool?, accessibility: String?) -> FlutterSecureStorageResponse {
var keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: accessibility, returnData: true)

keychainQuery[kSecMatchLimit] = kSecMatchLimitAll
keychainQuery[kSecReturnAttributes] = true
Expand Down Expand Up @@ -127,8 +127,8 @@ class FlutterSecureStorage{
return FlutterSecureStorageResponse(status: status, value: value)
}

internal func deleteAll(groupId: String?, accountName: String?, synchronizable: Bool?) -> FlutterSecureStorageResponse {
let keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: nil, returnData: nil)
internal func deleteAll(groupId: String?, accountName: String?, synchronizable: Bool?, accessibility: String?) -> FlutterSecureStorageResponse {
let keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: accessibility, returnData: nil)
let status = SecItemDelete(keychainQuery as CFDictionary)

if (status == errSecItemNotFound) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ public class FlutterSecureStoragePlugin: NSObject, FlutterPlugin {

private func deleteAll(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) {
let values = parseCall(call)
let response = flutterSecureStorageManager.deleteAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable)
let response = flutterSecureStorageManager.deleteAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable, accessibility: values.accessibility)

handleResponse(response, result)
}

private func readAll(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) {
let values = parseCall(call)
let response = flutterSecureStorageManager.readAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable)
let response = flutterSecureStorageManager.readAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable, accessibility: values.accessibility)

handleResponse(response, result)
}
Expand Down
4 changes: 2 additions & 2 deletions flutter_secure_storage_macos/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: flutter_secure_storage_macos
description: macOS implementation of flutter_secure_storage
repository: https://github.com/mogol/flutter_secure_storage
version: 3.1.1
version: 3.1.2

environment:
sdk: ">=2.12.0 <4.0.0"
Expand All @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_secure_storage_platform_interface: ^1.1.1
flutter_secure_storage_platform_interface: ^1.1.2

flutter:
plugin:
Expand Down

0 comments on commit 38c52a6

Please sign in to comment.