Skip to content

Commit 1939da3

Browse files
Add support for watchOS (#43)
* Add support for watchOS * Update exclude paths, since iOS and watchOS share common code * Updated version number to 2.3.2
1 parent 184deb5 commit 1939da3

File tree

9 files changed

+262
-6
lines changed

9 files changed

+262
-6
lines changed

Framework/iOS/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.3.1</string>
18+
<string>2.3.2</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
</dict>

Framework/macOS/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.3.1</string>
18+
<string>2.3.2</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSHumanReadableCopyright</key>

Framework/watchOS/Info.plist

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>2.3.2</string>
19+
<key>CFBundleVersion</key>
20+
<string>$(CURRENT_PROJECT_VERSION)</string>
21+
</dict>
22+
</plist>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (c) 2019, Okta, Inc. and/or its affiliates. All rights reserved.
3+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4+
*
5+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6+
* Unless required by applicable law or agreed to in writing, software
7+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
*
10+
* See the License for the specific language governing permissions and limitations under the License.
11+
*/
12+
#import <Foundation/Foundation.h>
13+
14+
#import <OktaJWTLib/NSData+SHA.h>
15+
#import <OktaJWTLib/NSData+HMAC.h>

OktaJWT.podspec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
Pod::Spec.new do |s|
22
s.name = 'OktaJWT'
3-
s.version = '2.3.1'
3+
s.version = '2.3.2'
44
s.summary = 'A JWT verification library'
55

66
s.description = <<-DESC
77
Library to validate JSON Web Tokens.
88
DESC
9-
s.platforms = { :ios => "12.0", :osx => "10.14"}
9+
s.platforms = { :ios => "12.0", :watchos => "6.0", :osx => "10.14"}
1010
s.homepage = 'https://github.com/okta/okta-ios-jwt'
1111
s.license = { :type => 'Apache-2.0', :file => 'LICENSE' }
1212
s.author = { 'Okta Developers' => 'developers@okta.com' }
1313
s.source = { :git => 'https://github.com/okta/okta-ios-jwt.git', :tag => s.version.to_s }
1414
s.social_media_url = 'https://twitter.com/oktaDev'
1515

1616
s.ios.deployment_target = '12.0'
17+
s.watchos.deployment_target = '6.0'
1718
s.osx.deployment_target = '10.14'
1819

1920
s.source_files = 'Sources/**/*.{h,m,swift}'
2021
s.ios.exclude_files = 'Sources/**/macOS/**'
22+
s.watchos.exclude_files = 'Sources/**/macOS/**'
2123
s.osx.exclude_files = 'Sources/**/iOS/**'
2224
s.swift_version = '4.2'
2325
end

OktaJWT.xcodeproj/project.pbxproj

Lines changed: 213 additions & 0 deletions
Large diffs are not rendered by default.

Sources/ThirdParty/JSONWebToken+Okta/RSAPKCS1SignerProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public extension RSAPKCS1SignerProtocol {
3131

3232
public class RSAPKCS1SignerFactory {
3333
public static func createSigner(hashFunction: SignatureAlgorithm.HashFunction, key: RSAKey) -> RSAPKCS1SignerProtocol {
34-
#if os(iOS)
34+
#if os(iOS) || os(watchOS)
3535
return RSAPKCS1SignerIOS(hashFunction: hashFunction, key: key)
3636
#elseif os(OSX)
3737
return RSAPKCS1SignerMacOS(hashFunction: hashFunction, key: key)

Sources/ThirdParty/JSONWebToken+Okta/RSAPKCS1VerifierProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public extension RSAPKCS1VerifierProtocol {
3434

3535
public class RSAPKCS1VerifierFactory {
3636
public static func createVerifier(key: RSAKey, hashFunction: SignatureAlgorithm.HashFunction) -> RSAPKCS1VerifierProtocol {
37-
#if os(iOS)
37+
#if os(iOS) || os(watchOS)
3838
return RSAPKCS1VerifierIOS(key: key, hashFunction: hashFunction)
3939
#elseif os(OSX)
4040
return RSAPKCS1VerifierMacOS(key: key, hashFunction: hashFunction)

Sources/Utils.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import Foundation
1414
#if os(iOS)
1515
import UIKit
16+
#elseif os(watchOS)
17+
import WatchKit
1618
#endif
1719

1820
open class Utils: NSObject {
@@ -128,6 +130,8 @@ open class Utils: NSObject {
128130
internal class func buildUserAgentString() -> String {
129131
#if os(iOS)
130132
return "okta-ios-jwt/\(VERSION) iOS/\(UIDevice.current.systemVersion) Device/\(Utils.deviceModel())"
133+
#elseif os(watchOS)
134+
return "okta-ios-jwt/\(VERSION) watchOS/\(WKInterfaceDevice.current().systemVersion) Device/\(Utils.deviceModel())"
131135
#elseif os(OSX)
132136
return "okta-ios-jwt/\(VERSION) macOS/\(ProcessInfo.processInfo.operatingSystemVersion) Device/\(Utils.deviceModel())"
133137
#endif

0 commit comments

Comments
 (0)