Skip to content

Commit

Permalink
Merge pull request #181 from mattrubin/develop
Browse files Browse the repository at this point in the history
Release OneTimePassword 3.1.3
  • Loading branch information
mattrubin authored Apr 29, 2018
2 parents 2c091c8 + e1d7d17 commit a1bdada
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

<!--## [In development][develop]-->

## [3.1.3][] (2018-04-29)
- Ignore un-deserializable tokens in `allPersistentTokens()`. ([#179](https://github.com/mattrubin/OneTimePassword/pull/179))


## [3.1.2][] (2018-04-23)
- Synthesize Equatable conformance when compiling with Swift 4.1. ([#173](https://github.com/mattrubin/OneTimePassword/pull/173))
- Fix a warning about deprecation of cross-module struct initializers by simplifying test cases for impossible-to-create invalid Generators. ([#174](https://github.com/mattrubin/OneTimePassword/pull/174))
Expand Down Expand Up @@ -155,8 +159,9 @@ Changes between prerelease versions of OneTimePassword version 2 can be found be

## [1.0.0][] (2014-07-17)

[develop]: https://github.com/mattrubin/OneTimePassword/compare/3.1.2...develop
[develop]: https://github.com/mattrubin/OneTimePassword/compare/3.1.3...develop

[3.1.3]: https://github.com/mattrubin/OneTimePassword/compare/3.1.2...3.1.3
[3.1.2]: https://github.com/mattrubin/OneTimePassword/compare/3.1.1...3.1.2
[3.1.1]: https://github.com/mattrubin/OneTimePassword/compare/3.1...3.1.1
[3.1]: https://github.com/mattrubin/OneTimePassword/compare/3.0.1...3.1
Expand Down
2 changes: 1 addition & 1 deletion OneTimePassword.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "OneTimePassword"
s.version = "3.1.2"
s.version = "3.1.3"
s.summary = "A small library for generating TOTP and HOTP one-time passwords."
s.homepage = "https://github.com/mattrubin/OneTimePassword"
s.license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.1.2</string>
<string>3.1.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>3.1.2</string>
<string>3.1.3</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
7 changes: 6 additions & 1 deletion Sources/Keychain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ public final class Keychain {
///
/// - throws: A `Keychain.Error` if an error occurred.
public func allPersistentTokens() throws -> Set<PersistentToken> {
return Set(try allKeychainItems().map(PersistentToken.init(keychainDictionary:)))
let allItems = try allKeychainItems()
// This code intentionally ignores items which fail deserialization, instead opting to return as many readable
// tokens as possible.
// TODO: Restore deserialization error handling, in a way that provides info on the failure reason and allows
// the caller to choose whether to fail completely or recover some data.
return Set(allItems.flatMap({ try? PersistentToken.init(keychainDictionary:$0) }))
}

// MARK: Write
Expand Down
12 changes: 8 additions & 4 deletions Tests/KeychainTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ class KeychainTests: XCTestCase {
let persistentRef = try addKeychainItem(withAttributes: keychainAttributes)

XCTAssertThrowsError(try keychain.persistentToken(withIdentifier: persistentRef))
XCTAssertThrowsError(try keychain.allPersistentTokens())
// TODO: Restore deserialization error handling in allPersistentTokens()
// XCTAssertThrowsError(try keychain.allPersistentTokens())

XCTAssertNoThrow(try deleteKeychainItem(forPersistentRef: persistentRef),
"Failed to delete the test token from the keychain. This may cause future test runs to fail.")
Expand All @@ -247,7 +248,8 @@ class KeychainTests: XCTestCase {
let persistentRef = try addKeychainItem(withAttributes: keychainAttributes)

XCTAssertThrowsError(try keychain.persistentToken(withIdentifier: persistentRef))
XCTAssertThrowsError(try keychain.allPersistentTokens())
// TODO: Restore deserialization error handling in allPersistentTokens()
// XCTAssertThrowsError(try keychain.allPersistentTokens())

XCTAssertNoThrow(try deleteKeychainItem(forPersistentRef: persistentRef),
"Failed to delete the test token from the keychain. This may cause future test runs to fail.")
Expand All @@ -264,7 +266,8 @@ class KeychainTests: XCTestCase {
let persistentRef = try addKeychainItem(withAttributes: keychainAttributes)

XCTAssertThrowsError(try keychain.persistentToken(withIdentifier: persistentRef))
XCTAssertThrowsError(try keychain.allPersistentTokens())
// TODO: Restore deserialization error handling in allPersistentTokens()
// XCTAssertThrowsError(try keychain.allPersistentTokens())

XCTAssertNoThrow(try deleteKeychainItem(forPersistentRef: persistentRef),
"Failed to delete the test token from the keychain. This may cause future test runs to fail.")
Expand All @@ -281,7 +284,8 @@ class KeychainTests: XCTestCase {
let persistentRef = try addKeychainItem(withAttributes: keychainAttributes)

XCTAssertThrowsError(try keychain.persistentToken(withIdentifier: persistentRef))
XCTAssertThrowsError(try keychain.allPersistentTokens())
// TODO: Restore deserialization error handling in allPersistentTokens()
// XCTAssertThrowsError(try keychain.allPersistentTokens())

XCTAssertNoThrow(try deleteKeychainItem(forPersistentRef: persistentRef),
"Failed to delete the test token from the keychain. This may cause future test runs to fail.")
Expand Down

0 comments on commit a1bdada

Please sign in to comment.