Compare commits

..

14 Commits

Author SHA1 Message Date
matthewpalmer 8d59a42f52 Merge branch 'master' into swift-2.3
* master:
  Update README.md
  Update rocket link
  Add padding symbols
  Add spacing over heading for rocket section
  Update rocket link position and style
  Add link to Rocket to README
  build with APPLICATION_EXTENSION_API_ONLY = YES
2016-09-17 13:32:40 +10:00
Matthew Palmer 9613c8fd22 Update README.md 2016-08-19 13:28:08 +10:00
matthewpalmer f2269ef8d1 Update rocket link 2016-08-13 11:58:01 +10:00
matthewpalmer 4d00c74922 Add padding symbols 2016-08-13 11:56:33 +10:00
matthewpalmer 1e8fcc8c2c Add spacing over heading for rocket section 2016-08-13 11:53:55 +10:00
matthewpalmer 9e1e912788 Update rocket link position and style 2016-08-13 11:53:13 +10:00
matthewpalmer c6838a31f2 Add link to Rocket to README 2016-08-13 11:44:55 +10:00
Matthew Palmer cdd1b2893a Merge pull request #127 from Podfactor/app-extension-safe
Fix warning when linking against Locksmith from an app extension
2016-07-09 06:38:03 +10:00
matthewpalmer 49da6a45e7 Merge branch 'davbeck-swift-2.3' into swift-2.3
* davbeck-swift-2.3:
  Updated for Swift 2.3
2016-07-09 06:34:25 +10:00
David Beck a2fe855f63 Updated for Swift 2.3
No breaking code changes applied to this project for Swift 2.3, just an update to the project to set it's version.
2016-06-14 07:51:13 -07:00
Tom Brow 7b9237c39e build with APPLICATION_EXTENSION_API_ONLY = YES 2016-05-31 17:25:45 -05:00
Matthew Palmer 1b278e59a5 Merge pull request #118 from jakemarsh/master
Carthage doesn't allow single quotes. Change README to doubles.
2016-04-09 13:25:19 +10:00
Jake Marsh 1359edf840 Update README.md
Carthage doesn't allow single quotes. Change to doubles.
2016-04-06 19:24:58 -07:00
matthewpalmer 6b32c7ec68 Fix regression in update method to fix #110 2016-02-16 20:23:02 +11:00
10 changed files with 76 additions and 13 deletions
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Locksmith"
s.version = "2.0.7"
s.version = "2.0.8"
s.summary = "Locksmith is a powerful, protocol-oriented library for working with the keychain in Swift."
s.description = <<-DESC
Locksmith is a powerful, protocol-oriented library for working with the iOS, Mac OS X, watchOS, and tvOS keychain in Swift. It provides extensive support for a lot of different keychain requests, and extensively uses Swift-native concepts.
+30 -1
View File
@@ -346,26 +346,32 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = "Mathew Palmer";
TargetAttributes = {
0EC25C581BA385AA004191AF = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0800;
};
0EC25C611BA385AB004191AF = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0800;
};
0EC25C741BA385F6004191AF = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0800;
};
0EC25C7D1BA385F6004191AF = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0800;
};
0EC25CA61BA39C9F004191AF = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0800;
};
FBD0C9481C1866BE00291F2A = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
};
};
};
@@ -542,6 +548,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-iOS";
PRODUCT_NAME = Locksmith;
SKIP_INSTALL = YES;
SWIFT_VERSION = 2.3;
};
name = Debug;
};
@@ -562,6 +569,8 @@
PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-iOS";
PRODUCT_NAME = Locksmith;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 2.3;
};
name = Release;
};
@@ -576,6 +585,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-iOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
@@ -590,6 +600,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-iOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 2.3;
};
name = Release;
};
@@ -613,6 +625,7 @@
PRODUCT_NAME = Locksmith;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 2.3;
};
name = Debug;
};
@@ -636,6 +649,8 @@
PRODUCT_NAME = Locksmith;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 2.3;
};
name = Release;
};
@@ -652,6 +667,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-OS-XTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 2.3;
};
name = Debug;
};
@@ -668,6 +684,8 @@
PRODUCT_BUNDLE_IDENTIFIER = "net.matthewpalmer.Locksmith-OS-XTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 2.3;
};
name = Release;
};
@@ -687,6 +705,7 @@
PRODUCT_NAME = Locksmith;
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 2.3;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
@@ -709,6 +728,8 @@
PRODUCT_NAME = Locksmith;
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 2.3;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
@@ -718,6 +739,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -738,6 +760,7 @@
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
@@ -753,6 +776,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -766,6 +790,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -785,6 +810,7 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -821,6 +847,7 @@
PRODUCT_NAME = Locksmith;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 2.3;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
@@ -845,6 +872,8 @@
PRODUCT_NAME = Locksmith;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 2.3;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
+9 -1
View File
@@ -7,6 +7,14 @@ A powerful, protocol-oriented library for working with the keychain in Swift.
- [x] ⌚️ watchOS 2
- [x] 📺 tvOS
> &nbsp;
>
> 🚀 I make [Rocket](http://matthewpalmer.net/rocket?utm_source=locksmith&utm_medium=readme&utm_campaign=open_source), an app that gives you Slack-style emoji everywhere on your Mac.
>
> &nbsp;
## Details
How is Locksmith different to other keychain wrappers?
* Locksmiths API is both super-simple and deeply powerful
@@ -32,7 +40,7 @@ Locksmith is available through [CocoaPods](http://cocoapods.org).
Locksmith is available through [Carthage](https://github.com/Carthage/Carthage).
github 'matthewpalmer/Locksmith'
github "matthewpalmer/Locksmith"
## Quick start
+9 -5
View File
@@ -517,11 +517,15 @@ extension CreateableSecureStorable {
let status = SecItemUpdate(query, attributesToUpdate)
if let error = LocksmithError(fromStatusCode: Int(status)) {
throw error
}
if status != errSecSuccess {
throw LocksmithError.Undefined
if error == .NotFound || error == .NotAvailable {
try self.createInSecureStore()
} else {
throw error
}
} else {
if status != errSecSuccess {
throw LocksmithError.Undefined
}
}
}
}
+22
View File
@@ -53,6 +53,12 @@ class LocksmithTests: XCTestCase {
let loaded3 = Locksmith.loadDataForUserAccount(userAccount, inService: service)! as! TestingDictionaryType
XCTAssertEqual(loaded3, updatedData)
try! Locksmith.deleteDataForUserAccount(userAccount, inService: service)
try! Locksmith.updateData(["some update": "data"], forUserAccount: userAccount, inService: service)
let updateResult = Locksmith.loadDataForUserAccount(userAccount, inService: service)! as! [String: String]
XCTAssertEqual(updateResult, ["some update": "data"])
}
func testStaticMethodsForDefaultService() {
@@ -94,6 +100,22 @@ class LocksmithTests: XCTestCase {
createGenericPasswordWithData(data)
}
func testUpdateCreatesIfNotExists() {
let data = ["some": "data"]
struct CreateGenericPassword: CreateableSecureStorable, GenericPasswordSecureStorable, ReadableSecureStorable {
var data: [String: AnyObject]
let account: String
let service: String
}
let update = CreateGenericPassword(data: data, account: userAccount, service: service)
try! update.updateInSecureStore()
let read = update.readFromSecureStore()!.data as! [String: String]
XCTAssertEqual(read, ["some": "data"])
}
func testUpdateForGenericPassword() {
let data = ["some": "data"]