From ee56cb88514e3b04eb48770e42de7f5e917f1c64 Mon Sep 17 00:00:00 2001 From: Sudeep Date: Fri, 28 Jan 2022 00:46:25 +0530 Subject: [PATCH 01/11] Added podspec for testing --- FKSecureStore.podspec | 12 ++++++++++++ README.md | 2 ++ 2 files changed, 14 insertions(+) create mode 100755 FKSecureStore.podspec diff --git a/FKSecureStore.podspec b/FKSecureStore.podspec new file mode 100755 index 0000000..1f1f940 --- /dev/null +++ b/FKSecureStore.podspec @@ -0,0 +1,12 @@ +Pod::Spec.new do |s| + s.name = 'FKSecureStore' + s.version = '1.0' + s.platform = :ios, '9.0' + s.license = { :type => 'MIT' } + s.homepage = 'https://github.com/idevelopers-in/FKSecureStore' + s.authors = { 'Firoz Khan' => 'f90khan@gmail.com' } + s.summary = '' + s.source = { :git => 'https://github.com/idevelopers-in/FKSecureStore', :tag => s.version } + s.source_files = 'FKSecureStore/*.{swift}' + s.requires_arc = true +end diff --git a/README.md b/README.md index cde1b1a..6f94d62 100755 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ Saved data will persist in keychain even after application is deleted or device # To-do * Option to clear keychain data if app is uninstalled. [Might help?](https://developer.apple.com/forums/thread/36442) +* Check if podspec requires linking to `Security` framework +* Add description of library to repo page and podspec # License From 5687ce974352381003c6b73b197ac9c3aeaa51ba Mon Sep 17 00:00:00 2001 From: Sudeep Date: Fri, 28 Jan 2022 00:48:50 +0530 Subject: [PATCH 02/11] Added missing ".git" from podspec source --- FKSecureStore.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FKSecureStore.podspec b/FKSecureStore.podspec index 1f1f940..7de498c 100755 --- a/FKSecureStore.podspec +++ b/FKSecureStore.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |s| s.homepage = 'https://github.com/idevelopers-in/FKSecureStore' s.authors = { 'Firoz Khan' => 'f90khan@gmail.com' } s.summary = '' - s.source = { :git => 'https://github.com/idevelopers-in/FKSecureStore', :tag => s.version } + s.source = { :git => 'https://github.com/idevelopers-in/FKSecureStore.git', :tag => s.version } s.source_files = 'FKSecureStore/*.{swift}' s.requires_arc = true end From f245b1f711dfd98b45593ff39b634a4162e7de75 Mon Sep 17 00:00:00 2001 From: Sudeep Date: Fri, 28 Jan 2022 00:50:28 +0530 Subject: [PATCH 03/11] Added summary on podspec --- FKSecureStore.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FKSecureStore.podspec b/FKSecureStore.podspec index 7de498c..8da4f78 100755 --- a/FKSecureStore.podspec +++ b/FKSecureStore.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |s| s.license = { :type => 'MIT' } s.homepage = 'https://github.com/idevelopers-in/FKSecureStore' s.authors = { 'Firoz Khan' => 'f90khan@gmail.com' } - s.summary = '' + s.summary = 'A lightweight solution to interact with the keychain' s.source = { :git => 'https://github.com/idevelopers-in/FKSecureStore.git', :tag => s.version } s.source_files = 'FKSecureStore/*.{swift}' s.requires_arc = true From d214ed4b9a48e54f09068d58f6c458bc9a5e72ff Mon Sep 17 00:00:00 2001 From: Sudeep Date: Fri, 28 Jan 2022 01:03:48 +0530 Subject: [PATCH 04/11] Marking functions and enum as public explicitly --- FKSecureStore/FKSecureStore.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/FKSecureStore/FKSecureStore.swift b/FKSecureStore/FKSecureStore.swift index c7d1016..b3e4715 100644 --- a/FKSecureStore/FKSecureStore.swift +++ b/FKSecureStore/FKSecureStore.swift @@ -28,7 +28,7 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." @objc class FKSecureStore: NSObject { - @objc enum Status: Int + @objc public enum Status: Int { case success case noData @@ -65,7 +65,7 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." - Returns: An enum containing the status of the operation. */ @discardableResult - @objc class func save(string: String, key: String) -> Status { + @objc public class func save(string: String, key: String) -> Status { if let stringData = string.data(using: .utf8, allowLossyConversion: false) { return save(data: stringData, key: key) @@ -83,7 +83,7 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." - Returns: An enum containing the status of the operation. */ @discardableResult - @objc class func save(data: Data, key: String) -> Status { + @objc public class func save(data: Data, key: String) -> Status { let query: [String: Any] = [ String(kSecClass): kSecClassKey, @@ -106,7 +106,7 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." - Returns: An optional `String` object. */ - @objc class func load(key: String) -> String? { + @objc public class func load(key: String) -> String? { if let data = load(dataForKey: key){ return String(data: data, encoding: .utf8) @@ -121,7 +121,7 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." - Returns: An optional `Data` object. */ - @objc class func load(dataForKey key: String) -> Data? { + @objc public class func load(dataForKey key: String) -> Data? { let query = [ String(kSecClass): kSecClassKey, @@ -146,7 +146,7 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." - Returns: An enum containing the status of the operation. */ @discardableResult - @objc class func delete(key: String) -> Status { + @objc public class func delete(key: String) -> Status { let query = [ String(kSecClass): kSecClassKey, @@ -163,7 +163,7 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." - Returns: An enum containing the status of the operation. */ @discardableResult - @objc class func clear() -> Status { + @objc public class func clear() -> Status { let query = [ String(kSecClass): kSecClassKey, From 77c9cdf165908ebaadfe7f1014a8e58b6b69fdc7 Mon Sep 17 00:00:00 2001 From: Sudeep Date: Fri, 28 Jan 2022 01:06:21 +0530 Subject: [PATCH 05/11] Making the class itself public --- FKSecureStore/FKSecureStore.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FKSecureStore/FKSecureStore.swift b/FKSecureStore/FKSecureStore.swift index b3e4715..3ea358e 100644 --- a/FKSecureStore/FKSecureStore.swift +++ b/FKSecureStore/FKSecureStore.swift @@ -26,7 +26,7 @@ import Security private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." -@objc class FKSecureStore: NSObject +@objc public class FKSecureStore: NSObject { @objc public enum Status: Int { From c874dd9e856b0fb14c5cabd05b3db5205a36787f Mon Sep 17 00:00:00 2001 From: Sudeep Date: Fri, 28 Jan 2022 01:10:59 +0530 Subject: [PATCH 06/11] Minor formatting in documentation --- FKSecureStore/FKSecureStore.swift | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/FKSecureStore/FKSecureStore.swift b/FKSecureStore/FKSecureStore.swift index 3ea358e..a142604 100644 --- a/FKSecureStore/FKSecureStore.swift +++ b/FKSecureStore/FKSecureStore.swift @@ -59,8 +59,8 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." Save any `String` for a particular key inside the keychain. - Parameters: - - string: The string to be saved. - - key: The key for which the string should be saved. + - string: The string to be saved. + - key: The key for which the string should be saved. - Returns: An enum containing the status of the operation. */ @@ -77,8 +77,8 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." Save any `Data` for a particular key inside the keychain. - Parameters: - - data: The data to be saved. - - key: The key for which the data should be saved. + - data: The data to be saved. + - key: The key for which the data should be saved. - Returns: An enum containing the status of the operation. */ @@ -102,10 +102,12 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." /** Retrieve any saved `String` for a particular key inside the keychain. - - Parameter key: The key for which the `String` should be retrieved. + - Parameters: + - key: The key for which the `String` should be retrieved. - Returns: An optional `String` object. */ + @discardableResult @objc public class func load(key: String) -> String? { if let data = load(dataForKey: key){ @@ -117,10 +119,12 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." /** Retrieve any saved `Data` for a particular key inside the keychain. - - Parameter key: The key for which the `Data` should be retrieved. + - Parameters: + - key: The key for which the `Data` should be retrieved. - Returns: An optional `Data` object. */ + @discardableResult @objc public class func load(dataForKey key: String) -> Data? { let query = [ @@ -141,7 +145,8 @@ private let kSecureKeyPrefix = Bundle.main.bundleIdentifier! + ".FKSecureStore." /** Delete stored data for a particular key inside the keychain. - - Parameter key: The key for which the data should be deleted. + - Parameters: + - key: The key for which the data should be deleted. - Returns: An enum containing the status of the operation. */ From 6b3637dda8a079e9155fe0e9f79d96c70dca4740 Mon Sep 17 00:00:00 2001 From: Sudeep Date: Fri, 28 Jan 2022 01:16:21 +0530 Subject: [PATCH 07/11] Added security framework to podspec --- FKSecureStore.podspec | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/FKSecureStore.podspec b/FKSecureStore.podspec index 8da4f78..88bf177 100755 --- a/FKSecureStore.podspec +++ b/FKSecureStore.podspec @@ -8,5 +8,6 @@ Pod::Spec.new do |s| s.summary = 'A lightweight solution to interact with the keychain' s.source = { :git => 'https://github.com/idevelopers-in/FKSecureStore.git', :tag => s.version } s.source_files = 'FKSecureStore/*.{swift}' + s.frameworks = 'Security' s.requires_arc = true end diff --git a/README.md b/README.md index 6f94d62..f6b9407 100755 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Saved data will persist in keychain even after application is deleted or device # To-do * Option to clear keychain data if app is uninstalled. [Might help?](https://developer.apple.com/forums/thread/36442) -* Check if podspec requires linking to `Security` framework +* ~~Check if podspec requires linking to `Security` framework~~ * Add description of library to repo page and podspec # License From 1c320b2eb9d0507e6f38ebb49ecb2cf63b205366 Mon Sep 17 00:00:00 2001 From: Sudeep <8945229+sdpjswl@users.noreply.github.com> Date: Fri, 28 Jan 2022 01:38:16 +0530 Subject: [PATCH 08/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f6b9407..09e49f0 100755 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Saved data will persist in keychain even after application is deleted or device * Option to clear keychain data if app is uninstalled. [Might help?](https://developer.apple.com/forums/thread/36442) * ~~Check if podspec requires linking to `Security` framework~~ -* Add description of library to repo page and podspec +* Add description of library to repo page and podspec # License From a049c9d8d132812c6f620d7582ec5cb88ba38b44 Mon Sep 17 00:00:00 2001 From: Sudeep <8945229+sdpjswl@users.noreply.github.com> Date: Fri, 28 Jan 2022 04:31:41 +0530 Subject: [PATCH 09/11] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 09e49f0..72b6719 100755 --- a/README.md +++ b/README.md @@ -38,8 +38,7 @@ Delete any saved data for a particular key in the keychain. ``` Delete all saved data for the app in the keychain. All data for any key you might have saved will be deleted. -#### Note -Saved data will persist in keychain even after application is deleted or device is restarted. +**Note:** Saved data will persist in keychain even after application is deleted or device is restarted. # To-do From 4cc810ff49e1465cbdceb85664bb15e459cda315 Mon Sep 17 00:00:00 2001 From: Sudeep Date: Mon, 31 Jan 2022 18:21:07 +0530 Subject: [PATCH 10/11] Updated summary as per repo info in podspec and added dummy change log file --- CHANGELOG.md | 7 +++++++ FKSecureStore.podspec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100755 index 0000000..6f13646 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Change Log + +## [1.0](https://github.com/idevelopers-in/FKSecureStore/releases/tag/1.0) +Released on ??, ?? ??, 2022. + +#### Added +* Initial release. diff --git a/FKSecureStore.podspec b/FKSecureStore.podspec index 88bf177..4ea5cd1 100755 --- a/FKSecureStore.podspec +++ b/FKSecureStore.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |s| s.license = { :type => 'MIT' } s.homepage = 'https://github.com/idevelopers-in/FKSecureStore' s.authors = { 'Firoz Khan' => 'f90khan@gmail.com' } - s.summary = 'A lightweight solution to interact with the keychain' + s.summary = 'A helper for keeping data secured in the keychain' s.source = { :git => 'https://github.com/idevelopers-in/FKSecureStore.git', :tag => s.version } s.source_files = 'FKSecureStore/*.{swift}' s.frameworks = 'Security' From 7a8227cc7b0d59084cb14baf01012389df5e85d2 Mon Sep 17 00:00:00 2001 From: Sudeep <8945229+sdpjswl@users.noreply.github.com> Date: Mon, 31 Jan 2022 18:22:13 +0530 Subject: [PATCH 11/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 72b6719..dd420e9 100755 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Delete all saved data for the app in the keychain. All data for any key you migh * Option to clear keychain data if app is uninstalled. [Might help?](https://developer.apple.com/forums/thread/36442) * ~~Check if podspec requires linking to `Security` framework~~ -* Add description of library to repo page and podspec +* ~~Add description of library to repo page and podspec~~ # License