Skip to content

Commit ddbf734

Browse files
authored
Merge pull request #1 from kylef/master
Update
2 parents b605fe2 + e5745f9 commit ddbf734

22 files changed

+333
-123
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

.travis.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
language: objective-c
2-
osx_image: xcode8
3-
script:
4-
- set -o pipefail
1+
os:
2+
- linux
3+
- osx
4+
language: generic
5+
sudo: required
6+
dist: trusty
7+
osx_image: xcode8.3
8+
env:
9+
- SWIFT_VERSION=3.1.1
10+
install:
11+
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"; fi
512
- git submodule update --init --recursive
6-
- xcodebuild -project JWT.xcodeproj -scheme JWT-OSX test -sdk macosx | xcpretty -c
7-
- pod lib lint --quick
13+
script:
14+
- swift test
15+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then xcodebuild -project JWT.xcodeproj -scheme JWT-OSX test -sdk macosx; fi
16+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then xcodebuild -project JWT.xcodeproj -scheme JWT-iOS build -sdk iphonesimulator; fi
17+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then xcodebuild -project JWT.xcodeproj -scheme JWT-tvOS build -sdk appletvsimulator; fi
18+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then xcodebuild -project JWT.xcodeproj -scheme JWT-watchOS build -sdk watchsimulator; fi
19+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pod lib lint; fi

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# JSON Web Token Changelog
22

3+
## 2.2.0
4+
5+
### Enhancements
6+
7+
- On Apple platforms, JSONWebToken will use the system CommonCrypto where possible.
8+
- Allow passing additional headers when encoding a JWT.
9+
- Allow passing leeway parameter for date checks when verifying a JWT.
10+
11+
312
## 2.1.0
413

514
### Enhancements

Cartfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

Cartfile.resolved

Lines changed: 0 additions & 1 deletion
This file was deleted.

Carthage/Checkouts/CryptoSwift

Lines changed: 0 additions & 1 deletion
This file was deleted.

CommonCrypto/module.modulemap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module CommonCrypto [system] {
2+
header "shim.h"
3+
export *
4+
}

CommonCrypto/shim.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include <CommonCrypto/CommonCrypto.h>

JSONWebToken.podspec

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'JSONWebToken'
3-
spec.version = '2.1.0'
3+
spec.version = '2.2.0'
44
spec.summary = 'Swift library for JSON Web Tokens (JWT).'
55
spec.homepage = 'https://github.com/kylef/JSONWebToken.swift'
66
spec.license = { :type => 'BSD', :file => 'LICENSE' }
@@ -12,6 +12,18 @@ Pod::Spec.new do |spec|
1212
spec.tvos.deployment_target = '9.0'
1313
spec.watchos.deployment_target = '2.0'
1414
spec.requires_arc = true
15-
spec.dependency 'CryptoSwift', '~> 0.6.1'
1615
spec.module_name = 'JWT'
16+
spec.exclude_files = ['Sources/HMACCryptoSwift.swift']
17+
18+
if ARGV.include?('lint')
19+
spec.pod_target_xcconfig = {
20+
'SWIFT_INCLUDE_PATHS' => Dir.pwd,
21+
}
22+
else
23+
spec.pod_target_xcconfig = {
24+
'SWIFT_INCLUDE_PATHS' => '$(PODS_ROOT)/JSONWebToken/',
25+
}
26+
end
27+
28+
spec.preserve_paths = 'CommonCrypto/{shim.h,module.modulemap}'
1729
end

JWT.xcodeproj/project.pbxproj

Lines changed: 24 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
2734C6A81D88001F00BFF9F1 /* CryptoSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66725DAB1C59202E00FC32F4 /* CryptoSwift.framework */; };
11-
2734C6A91D88002900BFF9F1 /* CryptoSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66725DAB1C59202E00FC32F4 /* CryptoSwift.framework */; };
12-
2734C6AA1D88003000BFF9F1 /* CryptoSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66725DAB1C59202E00FC32F4 /* CryptoSwift.framework */; };
10+
273010FF1F33EABA00219C35 /* HMAC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273010FE1F33EABA00219C35 /* HMAC.swift */; };
11+
273011001F33EABA00219C35 /* HMAC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273010FE1F33EABA00219C35 /* HMAC.swift */; };
12+
273011011F33EABA00219C35 /* HMAC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273010FE1F33EABA00219C35 /* HMAC.swift */; };
13+
273011021F33EABA00219C35 /* HMAC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273010FE1F33EABA00219C35 /* HMAC.swift */; };
14+
273011161F34029900219C35 /* HMACCommonCrypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273011041F33FC5F00219C35 /* HMACCommonCrypto.swift */; };
15+
273011171F34029900219C35 /* HMACCommonCrypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273011041F33FC5F00219C35 /* HMACCommonCrypto.swift */; };
16+
273011181F34029A00219C35 /* HMACCommonCrypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273011041F33FC5F00219C35 /* HMACCommonCrypto.swift */; };
17+
273011191F34029A00219C35 /* HMACCommonCrypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 273011041F33FC5F00219C35 /* HMACCommonCrypto.swift */; };
1318
277794051DF221F800573F3E /* ClaimSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 277794041DF221F800573F3E /* ClaimSet.swift */; };
1419
277794061DF221F800573F3E /* ClaimSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 277794041DF221F800573F3E /* ClaimSet.swift */; };
1520
277794071DF221F800573F3E /* ClaimSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 277794041DF221F800573F3E /* ClaimSet.swift */; };
@@ -44,7 +49,6 @@
4449
CD9B623D1C7753FB005D4844 /* Decode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 520A71151C469F010005C709 /* Decode.swift */; };
4550
CD9B623E1C7753FB005D4844 /* Base64.swift in Sources */ = {isa = PBXBuildFile; fileRef = 520A71131C469F010005C709 /* Base64.swift */; };
4651
CD9B62421C7753FB005D4844 /* JWT.h in Headers */ = {isa = PBXBuildFile; fileRef = 279D63A11AD07FFF0024E2BC /* JWT.h */; settings = {ATTRIBUTES = (Public, ); }; };
47-
CD9B62891C7758BB005D4844 /* CryptoSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66725DAB1C59202E00FC32F4 /* CryptoSwift.framework */; };
4852
/* End PBXBuildFile section */
4953

5054
/* Begin PBXContainerItemProxy section */
@@ -55,30 +59,12 @@
5559
remoteGlobalIDString = 279D639B1AD07FFF0024E2BC;
5660
remoteInfo = JWT;
5761
};
58-
66725DAA1C59202E00FC32F4 /* PBXContainerItemProxy */ = {
59-
isa = PBXContainerItemProxy;
60-
containerPortal = 66725DA21C59202E00FC32F4 /* CryptoSwift.xcodeproj */;
61-
proxyType = 2;
62-
remoteGlobalIDString = 754BE45519693E190098E6F3;
63-
remoteInfo = "CryptoSwift iOS";
64-
};
65-
66725DB21C59202E00FC32F4 /* PBXContainerItemProxy */ = {
66-
isa = PBXContainerItemProxy;
67-
containerPortal = 66725DA21C59202E00FC32F4 /* CryptoSwift.xcodeproj */;
68-
proxyType = 2;
69-
remoteGlobalIDString = 754BE46019693E190098E6F3;
70-
remoteInfo = CryptoSwiftTests;
71-
};
72-
CD9B628A1C7758CA005D4844 /* PBXContainerItemProxy */ = {
73-
isa = PBXContainerItemProxy;
74-
containerPortal = 66725DA21C59202E00FC32F4 /* CryptoSwift.xcodeproj */;
75-
proxyType = 1;
76-
remoteGlobalIDString = 754BE45419693E190098E6F3;
77-
remoteInfo = "CryptoSwift iOS";
78-
};
7962
/* End PBXContainerItemProxy section */
8063

8164
/* Begin PBXFileReference section */
65+
273010FE1F33EABA00219C35 /* HMAC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMAC.swift; sourceTree = "<group>"; };
66+
273011041F33FC5F00219C35 /* HMACCommonCrypto.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMACCommonCrypto.swift; sourceTree = "<group>"; };
67+
273011091F33FC9100219C35 /* HMACCryptoSwift.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMACCryptoSwift.swift; sourceTree = "<group>"; };
8268
277794041DF221F800573F3E /* ClaimSet.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClaimSet.swift; sourceTree = "<group>"; };
8369
2777940A1DF22BE400573F3E /* JOSEHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JOSEHeader.swift; sourceTree = "<group>"; };
8470
2777940F1DF22D0D00573F3E /* Encode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Encode.swift; sourceTree = "<group>"; };
@@ -94,7 +80,6 @@
9480
520A71161C469F010005C709 /* JWT.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JWT.swift; sourceTree = "<group>"; };
9581
520A711B1C469F440005C709 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
9682
540942F3614C41E3827F2013 /* Pods_JWT.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JWT.framework; sourceTree = BUILT_PRODUCTS_DIR; };
97-
66725DA21C59202E00FC32F4 /* CryptoSwift.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CryptoSwift.xcodeproj; path = Carthage/Checkouts/CryptoSwift/CryptoSwift.xcodeproj; sourceTree = "<group>"; };
9883
CD9B62231C7753D8005D4844 /* JWT.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JWT.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9984
CD9B62351C7753EC005D4844 /* JWT.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JWT.framework; sourceTree = BUILT_PRODUCTS_DIR; };
10085
CD9B62471C7753FB005D4844 /* JWT.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JWT.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -106,7 +91,6 @@
10691
isa = PBXFrameworksBuildPhase;
10792
buildActionMask = 2147483647;
10893
files = (
109-
2734C6A81D88001F00BFF9F1 /* CryptoSwift.framework in Frameworks */,
11094
);
11195
runOnlyForDeploymentPostprocessing = 0;
11296
};
@@ -122,23 +106,20 @@
122106
isa = PBXFrameworksBuildPhase;
123107
buildActionMask = 2147483647;
124108
files = (
125-
CD9B62891C7758BB005D4844 /* CryptoSwift.framework in Frameworks */,
126109
);
127110
runOnlyForDeploymentPostprocessing = 0;
128111
};
129112
CD9B622D1C7753EC005D4844 /* Frameworks */ = {
130113
isa = PBXFrameworksBuildPhase;
131114
buildActionMask = 2147483647;
132115
files = (
133-
2734C6A91D88002900BFF9F1 /* CryptoSwift.framework in Frameworks */,
134116
);
135117
runOnlyForDeploymentPostprocessing = 0;
136118
};
137119
CD9B623F1C7753FB005D4844 /* Frameworks */ = {
138120
isa = PBXFrameworksBuildPhase;
139121
buildActionMask = 2147483647;
140122
files = (
141-
2734C6AA1D88003000BFF9F1 /* CryptoSwift.framework in Frameworks */,
142123
);
143124
runOnlyForDeploymentPostprocessing = 0;
144125
};
@@ -148,7 +129,6 @@
148129
279D63921AD07FFF0024E2BC = {
149130
isa = PBXGroup;
150131
children = (
151-
66725DA21C59202E00FC32F4 /* CryptoSwift.xcodeproj */,
152132
520A711B1C469F440005C709 /* Package.swift */,
153133
520A71121C469F010005C709 /* Sources */,
154134
279D639E1AD07FFF0024E2BC /* Sources */,
@@ -218,19 +198,13 @@
218198
520A71151C469F010005C709 /* Decode.swift */,
219199
2777940F1DF22D0D00573F3E /* Encode.swift */,
220200
520A71161C469F010005C709 /* JWT.swift */,
201+
273010FE1F33EABA00219C35 /* HMAC.swift */,
202+
273011041F33FC5F00219C35 /* HMACCommonCrypto.swift */,
203+
273011091F33FC9100219C35 /* HMACCryptoSwift.swift */,
221204
);
222205
path = Sources;
223206
sourceTree = "<group>";
224207
};
225-
66725DA31C59202E00FC32F4 /* Products */ = {
226-
isa = PBXGroup;
227-
children = (
228-
66725DAB1C59202E00FC32F4 /* CryptoSwift.framework */,
229-
66725DB31C59202E00FC32F4 /* Tests.xctest */,
230-
);
231-
name = Products;
232-
sourceTree = "<group>";
233-
};
234208
AC8AE547FDAF3DD80EB4DB2F /* Frameworks */ = {
235209
isa = PBXGroup;
236210
children = (
@@ -326,7 +300,6 @@
326300
buildRules = (
327301
);
328302
dependencies = (
329-
CD9B628B1C7758CA005D4844 /* PBXTargetDependency */,
330303
);
331304
name = "JWT-iOS";
332305
productName = JWT;
@@ -398,12 +371,6 @@
398371
mainGroup = 279D63921AD07FFF0024E2BC;
399372
productRefGroup = 279D639D1AD07FFF0024E2BC /* Products */;
400373
projectDirPath = "";
401-
projectReferences = (
402-
{
403-
ProductGroup = 66725DA31C59202E00FC32F4 /* Products */;
404-
ProjectRef = 66725DA21C59202E00FC32F4 /* CryptoSwift.xcodeproj */;
405-
},
406-
);
407374
projectRoot = "";
408375
targets = (
409376
279D639B1AD07FFF0024E2BC /* JWT-OSX */,
@@ -415,23 +382,6 @@
415382
};
416383
/* End PBXProject section */
417384

418-
/* Begin PBXReferenceProxy section */
419-
66725DAB1C59202E00FC32F4 /* CryptoSwift.framework */ = {
420-
isa = PBXReferenceProxy;
421-
fileType = wrapper.framework;
422-
path = CryptoSwift.framework;
423-
remoteRef = 66725DAA1C59202E00FC32F4 /* PBXContainerItemProxy */;
424-
sourceTree = BUILT_PRODUCTS_DIR;
425-
};
426-
66725DB31C59202E00FC32F4 /* Tests.xctest */ = {
427-
isa = PBXReferenceProxy;
428-
fileType = wrapper.cfbundle;
429-
path = Tests.xctest;
430-
remoteRef = 66725DB21C59202E00FC32F4 /* PBXContainerItemProxy */;
431-
sourceTree = BUILT_PRODUCTS_DIR;
432-
};
433-
/* End PBXReferenceProxy section */
434-
435385
/* Begin PBXResourcesBuildPhase section */
436386
279D63A51AD07FFF0024E2BC /* Resources */ = {
437387
isa = PBXResourcesBuildPhase;
@@ -475,12 +425,14 @@
475425
isa = PBXSourcesBuildPhase;
476426
buildActionMask = 2147483647;
477427
files = (
428+
273011161F34029900219C35 /* HMACCommonCrypto.swift in Sources */,
478429
520A71181C469F010005C709 /* Claims.swift in Sources */,
479430
520A711A1C469F010005C709 /* JWT.swift in Sources */,
480431
520A71191C469F010005C709 /* Decode.swift in Sources */,
481432
277794101DF22D0D00573F3E /* Encode.swift in Sources */,
482433
2777940B1DF22BE400573F3E /* JOSEHeader.swift in Sources */,
483434
277794051DF221F800573F3E /* ClaimSet.swift in Sources */,
435+
273010FF1F33EABA00219C35 /* HMAC.swift in Sources */,
484436
520A71171C469F010005C709 /* Base64.swift in Sources */,
485437
);
486438
runOnlyForDeploymentPostprocessing = 0;
@@ -497,12 +449,14 @@
497449
isa = PBXSourcesBuildPhase;
498450
buildActionMask = 2147483647;
499451
files = (
452+
273011171F34029900219C35 /* HMACCommonCrypto.swift in Sources */,
500453
CD9B62171C7753D8005D4844 /* Claims.swift in Sources */,
501454
CD9B62181C7753D8005D4844 /* JWT.swift in Sources */,
502455
CD9B62191C7753D8005D4844 /* Decode.swift in Sources */,
503456
277794111DF22D0D00573F3E /* Encode.swift in Sources */,
504457
2777940C1DF22BE400573F3E /* JOSEHeader.swift in Sources */,
505458
277794061DF221F800573F3E /* ClaimSet.swift in Sources */,
459+
273011001F33EABA00219C35 /* HMAC.swift in Sources */,
506460
CD9B621A1C7753D8005D4844 /* Base64.swift in Sources */,
507461
);
508462
runOnlyForDeploymentPostprocessing = 0;
@@ -511,12 +465,14 @@
511465
isa = PBXSourcesBuildPhase;
512466
buildActionMask = 2147483647;
513467
files = (
468+
273011181F34029A00219C35 /* HMACCommonCrypto.swift in Sources */,
514469
CD9B62291C7753EC005D4844 /* Claims.swift in Sources */,
515470
CD9B622A1C7753EC005D4844 /* JWT.swift in Sources */,
516471
CD9B622B1C7753EC005D4844 /* Decode.swift in Sources */,
517472
277794121DF22D0D00573F3E /* Encode.swift in Sources */,
518473
2777940D1DF22BE400573F3E /* JOSEHeader.swift in Sources */,
519474
277794071DF221F800573F3E /* ClaimSet.swift in Sources */,
475+
273011011F33EABA00219C35 /* HMAC.swift in Sources */,
520476
CD9B622C1C7753EC005D4844 /* Base64.swift in Sources */,
521477
);
522478
runOnlyForDeploymentPostprocessing = 0;
@@ -525,12 +481,14 @@
525481
isa = PBXSourcesBuildPhase;
526482
buildActionMask = 2147483647;
527483
files = (
484+
273011191F34029A00219C35 /* HMACCommonCrypto.swift in Sources */,
528485
CD9B623B1C7753FB005D4844 /* Claims.swift in Sources */,
529486
CD9B623C1C7753FB005D4844 /* JWT.swift in Sources */,
530487
CD9B623D1C7753FB005D4844 /* Decode.swift in Sources */,
531488
277794131DF22D0D00573F3E /* Encode.swift in Sources */,
532489
2777940E1DF22BE400573F3E /* JOSEHeader.swift in Sources */,
533490
277794081DF221F800573F3E /* ClaimSet.swift in Sources */,
491+
273011021F33EABA00219C35 /* HMAC.swift in Sources */,
534492
CD9B623E1C7753FB005D4844 /* Base64.swift in Sources */,
535493
);
536494
runOnlyForDeploymentPostprocessing = 0;
@@ -543,11 +501,6 @@
543501
target = 279D639B1AD07FFF0024E2BC /* JWT-OSX */;
544502
targetProxy = 279D63A91AD07FFF0024E2BC /* PBXContainerItemProxy */;
545503
};
546-
CD9B628B1C7758CA005D4844 /* PBXTargetDependency */ = {
547-
isa = PBXTargetDependency;
548-
name = "CryptoSwift iOS";
549-
targetProxy = CD9B628A1C7758CA005D4844 /* PBXContainerItemProxy */;
550-
};
551504
/* End PBXTargetDependency section */
552505

553506
/* Begin XCBuildConfiguration section */
@@ -594,6 +547,7 @@
594547
ONLY_ACTIVE_ARCH = YES;
595548
PRODUCT_NAME = "$(PROJECT_NAME)";
596549
SDKROOT = macosx;
550+
SWIFT_INCLUDE_PATHS = "$(SRCROOT)";
597551
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
598552
SWIFT_VERSION = 3.0;
599553
VERSIONING_SYSTEM = "apple-generic";
@@ -637,6 +591,7 @@
637591
MTL_ENABLE_DEBUG_INFO = NO;
638592
PRODUCT_NAME = "$(PROJECT_NAME)";
639593
SDKROOT = macosx;
594+
SWIFT_INCLUDE_PATHS = "$(SRCROOT)";
640595
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
641596
SWIFT_VERSION = 3.0;
642597
VERSIONING_SYSTEM = "apple-generic";

0 commit comments

Comments
 (0)