Skip to content

Commit 09b940e

Browse files
authored
Merge pull request #189 from mattrubin/develop
Release OneTimePassword 3.1.4
2 parents a1bdada + 22a1c42 commit 09b940e

File tree

17 files changed

+56
-24
lines changed

17 files changed

+56
-24
lines changed

Diff for: .swiftlint.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ opt_in_rules:
99
- closure_spacing
1010
- conditional_returns_on_newline
1111
- contains_over_first_not_nil
12+
- convenience_type
1213
- discouraged_object_literal
1314
- discouraged_optional_boolean
1415
- discouraged_optional_collection
1516
- empty_count
1617
- empty_string
18+
- empty_xctest_method
1719
- explicit_enum_raw_value
1820
- explicit_init
1921
- extension_access_modifier
22+
- fallthrough
2023
- fatal_error_message
2124
- file_header
2225
- first_where
@@ -26,28 +29,33 @@ opt_in_rules:
2629
- let_var_whitespace
2730
- literal_expression_end_indentation
2831
- lower_acl_than_parent
32+
- modifier_order
33+
- multiline_function_chains
2934
- multiline_parameters
3035
- nimble_operator
3136
- operator_usage_whitespace
3237
- overridden_super_call
3338
- override_in_extension
3439
- pattern_matching_keywords
40+
- private_action
3541
- private_outlet
3642
- prohibited_super_call
3743
- redundant_nil_coalescing
3844
- single_test_class
3945
- sorted_first_last
4046
- switch_case_on_newline
47+
- unavailable_function
4148
- unneeded_parentheses_in_closure_argument
4249
- untyped_error_in_catch
4350
- vertical_parameter_alignment_on_call
4451
- yoda_condition
4552
disabled_rules:
46-
- colon
47-
- comma
4853
- cyclomatic_complexity
4954
- identifier_name
5055

56+
colon:
57+
flexible_right_spacing: true
58+
5159
trailing_comma:
5260
mandatory_comma: true
5361

Diff for: .travis.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ language: objective-c
55
xcode_workspace: OneTimePassword.xcworkspace
66
xcode_scheme: OneTimePassword (iOS)
77

8-
osx_image: xcode9.3
8+
osx_image: xcode10
99

1010
env:
11-
- RUNTIME="iOS 9.3" DEVICE="iPhone 6s"
1211
- RUNTIME="iOS 10.3" DEVICE="iPhone 7 Plus"
1312
- RUNTIME="iOS 11.3" DEVICE="iPhone X"
13+
- RUNTIME="iOS 12.0" DEVICE="iPhone XS Max"
1414

1515
# Include builds for watchOS
1616
matrix:
@@ -21,13 +21,19 @@ matrix:
2121
# Include an Xcode 9.2 build to test on iOS 8.x, because Xcode 9.3's iOS 8 simulator fails to launch
2222
- osx_image: xcode9.2
2323
env: RUNTIME="iOS 8.4" DEVICE="iPhone 4s"
24+
# Include an Xcode 9.4 build to ensure compatibility until Xcode 10 is in widespread use
25+
- osx_image: xcode9.4
26+
env: RUNTIME="iOS 9.3" DEVICE="iPhone 6s"
2427
# Include several build-only jobs for watchOS
2528
- xcode_scheme: OneTimePassword (watchOS)
29+
env: BUILD_ONLY="YES" RUNTIME="watchOS 5.0" DEVICE="Apple Watch Series 4 - 44mm"
30+
- xcode_scheme: OneTimePassword (watchOS)
31+
osx_image: xcode9.4
2632
env: BUILD_ONLY="YES" RUNTIME="watchOS 4.3" DEVICE="Apple Watch Series 3 - 38mm"
2733
- xcode_scheme: OneTimePassword (watchOS)
2834
env: BUILD_ONLY="YES" RUNTIME="watchOS 3.2" DEVICE="Apple Watch Series 2 - 42mm"
2935
- xcode_scheme: OneTimePassword (watchOS)
30-
env: BUILD_ONLY="YES" RUNTIME="watchOS 2.2" DEVICE="Apple Watch - 38mm"
36+
env: BUILD_ONLY="YES" RUNTIME="watchOS 2.0" DEVICE="Apple Watch - 38mm"
3137

3238
# Check out nested dependencies
3339
before_install: git submodule update --init --recursive

Diff for: CHANGELOG.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

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

5+
## [3.1.4][] (2018-09-15)
6+
- Fix compilation errors and add CI testing for Xcode 10.
7+
([#182](https://github.com/mattrubin/OneTimePassword/pull/182),
8+
[#186](https://github.com/mattrubin/OneTimePassword/pull/186))
9+
- Enable several new SwiftLint opt-in rules. ([#187](https://github.com/mattrubin/OneTimePassword/pull/187))
10+
11+
512
## [3.1.3][] (2018-04-29)
613
- Ignore un-deserializable tokens in `allPersistentTokens()`. ([#179](https://github.com/mattrubin/OneTimePassword/pull/179))
714

@@ -159,8 +166,9 @@ Changes between prerelease versions of OneTimePassword version 2 can be found be
159166

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

162-
[develop]: https://github.com/mattrubin/OneTimePassword/compare/3.1.3...develop
169+
[develop]: https://github.com/mattrubin/OneTimePassword/compare/3.1.4...develop
163170

171+
[3.1.4]: https://github.com/mattrubin/OneTimePassword/compare/3.1.3...3.1.4
164172
[3.1.3]: https://github.com/mattrubin/OneTimePassword/compare/3.1.2...3.1.3
165173
[3.1.2]: https://github.com/mattrubin/OneTimePassword/compare/3.1.1...3.1.2
166174
[3.1.1]: https://github.com/mattrubin/OneTimePassword/compare/3.1...3.1.1

Diff for: CommonCrypto/appletvos/module.modulemap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module CommonCrypto [system] {
1+
module CommonCryptoShim [system] {
22
header "/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/usr/include/CommonCrypto/CommonCrypto.h"
33
export *
44
}

Diff for: CommonCrypto/appletvsimulator/module.modulemap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module CommonCrypto [system] {
1+
module CommonCryptoShim [system] {
22
header "/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/include/CommonCrypto/CommonCrypto.h"
33
export *
44
}

Diff for: CommonCrypto/iphoneos/module.modulemap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module CommonCrypto [system] {
1+
module CommonCryptoShim [system] {
22
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/CommonCrypto/CommonCrypto.h"
33
export *
44
}

Diff for: CommonCrypto/iphonesimulator/module.modulemap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module CommonCrypto [system] {
1+
module CommonCryptoShim [system] {
22
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/CommonCrypto/CommonCrypto.h"
33
export *
44
}

Diff for: CommonCrypto/macosx/module.modulemap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module CommonCrypto [system] {
1+
module CommonCryptoShim [system] {
22
header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/CommonCrypto/CommonCrypto.h"
33
export *
44
}

Diff for: CommonCrypto/watchos/module.modulemap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module CommonCrypto [system] {
1+
module CommonCryptoShim [system] {
22
header "/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/usr/include/CommonCrypto/CommonCrypto.h"
33
export *
44
}

Diff for: CommonCrypto/watchsimulator/module.modulemap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module CommonCrypto [system] {
1+
module CommonCryptoShim [system] {
22
header "/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/usr/include/CommonCrypto/CommonCrypto.h"
33
export *
44
}

Diff for: OneTimePassword.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OneTimePassword"
3-
s.version = "3.1.3"
3+
s.version = "3.1.4"
44
s.summary = "A small library for generating TOTP and HOTP one-time passwords."
55
s.homepage = "https://github.com/mattrubin/OneTimePassword"
66
s.license = "MIT"

Diff for: OneTimePasswordLegacyTests/OTPToken.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import OneTimePassword
3030
/// information about its properties and methods, consult the underlying `OneTimePassword`
3131
/// documentation.
3232
public final class OTPToken: NSObject {
33-
required public override init() {}
33+
override public required init() {}
3434

3535
@objc public var name: String = OTPToken.defaultName
3636
@objc public var issuer: String = OTPToken.defaultIssuer

Diff for: Sources/Crypto.swift

+9-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@
2424
//
2525

2626
import Foundation
27-
import CommonCrypto
27+
#if swift(>=4.1)
28+
#if canImport(CommonCrypto)
29+
import CommonCrypto
30+
#else
31+
import CommonCryptoShim
32+
#endif
33+
#else
34+
import CommonCryptoShim
35+
#endif
2836

2937
func HMAC(algorithm: Generator.Algorithm, key: Data, data: Data) -> Data {
3038
let (hashFunction, hashLength) = algorithm.hashInfo

Diff for: Sources/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>3.1.3</string>
18+
<string>3.1.4</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>3.1.3</string>
22+
<string>3.1.4</string>
2323
<key>NSPrincipalClass</key>
2424
<string></string>
2525
</dict>

Diff for: Sources/Keychain.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public final class Keychain {
5252
// tokens as possible.
5353
// TODO: Restore deserialization error handling, in a way that provides info on the failure reason and allows
5454
// the caller to choose whether to fail completely or recover some data.
55-
return Set(allItems.flatMap({ try? PersistentToken.init(keychainDictionary:$0) }))
55+
return Set(allItems.flatMap({ try? PersistentToken(keychainDictionary: $0) }))
5656
}
5757

5858
// MARK: Write
@@ -180,7 +180,7 @@ private func addKeychainItem(withAttributes attributes: [String: AnyObject]) thr
180180

181181
private func updateKeychainItem(forPersistentRef persistentRef: Data,
182182
withAttributes attributesToUpdate: [String: AnyObject]) throws {
183-
let queryDict: [String : AnyObject] = [
183+
let queryDict: [String: AnyObject] = [
184184
kSecClass as String: kSecClassGenericPassword,
185185
kSecValuePersistentRef as String: persistentRef as NSData,
186186
]
@@ -193,7 +193,7 @@ private func updateKeychainItem(forPersistentRef persistentRef: Data,
193193
}
194194

195195
private func deleteKeychainItem(forPersistentRef persistentRef: Data) throws {
196-
let queryDict: [String : AnyObject] = [
196+
let queryDict: [String: AnyObject] = [
197197
kSecClass as String: kSecClassGenericPassword,
198198
kSecValuePersistentRef as String: persistentRef as NSData,
199199
]
@@ -206,7 +206,7 @@ private func deleteKeychainItem(forPersistentRef persistentRef: Data) throws {
206206
}
207207

208208
private func keychainItem(forPersistentRef persistentRef: Data) throws -> NSDictionary? {
209-
let queryDict: [String : AnyObject] = [
209+
let queryDict: [String: AnyObject] = [
210210
kSecClass as String: kSecClassGenericPassword,
211211
kSecValuePersistentRef as String: persistentRef as NSData,
212212
kSecReturnPersistentRef as String: kCFBooleanTrue,
@@ -233,7 +233,7 @@ private func keychainItem(forPersistentRef persistentRef: Data) throws -> NSDict
233233
}
234234

235235
private func allKeychainItems() throws -> [NSDictionary] {
236-
let queryDict: [String : AnyObject] = [
236+
let queryDict: [String: AnyObject] = [
237237
kSecClass as String: kSecClassGenericPassword,
238238
kSecMatchLimit as String: kSecMatchLimitAll,
239239
kSecReturnPersistentRef as String: kCFBooleanTrue,

Diff for: Tests/GeneratorTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ class GeneratorTests: XCTestCase {
7373

7474
func testCounter() {
7575
let factors: [(TimeInterval, TimeInterval, UInt64)] = [
76+
// swiftlint:disable comma
7677
(100, 30, 3),
7778
(10000, 30, 333),
7879
(1000000, 30, 33333),
7980
(100000000, 60, 1666666),
8081
(10000000000, 90, 111111111),
82+
// swiftlint:enable comma
8183
]
8284

8385
for (timeSinceEpoch, period, count) in factors {

Diff for: Tests/KeychainTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ private func addKeychainItem(withAttributes attributes: [String: AnyObject]) thr
319319
}
320320

321321
public func deleteKeychainItem(forPersistentRef persistentRef: Data) throws {
322-
let queryDict: [String : AnyObject] = [
322+
let queryDict: [String: AnyObject] = [
323323
kSecClass as String: kSecClassGenericPassword,
324324
kSecValuePersistentRef as String: persistentRef as NSData,
325325
]

0 commit comments

Comments
 (0)