Compare commits

..

17 Commits

Author SHA1 Message Date
Matthew Palmer 5e9fc402dd Update README.md 2016-08-19 13:27:14 +10:00
Matthew Palmer 4010a3303e Update README.md 2016-08-19 13:26:59 +10:00
Matthew Palmer 955f12033c Update README.md 2016-08-19 13:25:37 +10:00
Matthew Palmer 798405f93a Update README.md 2016-08-19 13:25:14 +10:00
Matthew Palmer 299bb3fa3f Update README.md 2016-08-19 13:22:52 +10:00
Matthew Palmer 6814e7f7aa Update README.md 2016-08-19 13:22:30 +10:00
Matthew Palmer 173ab46b6e Update README.md 2016-08-19 07:46:20 +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
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
5 changed files with 43 additions and 7 deletions
+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.
+2
View File
@@ -718,6 +718,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;
@@ -766,6 +767,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;
+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"]