From 16b20eef5003ddce95651398a81f364e98a00693 Mon Sep 17 00:00:00 2001 From: Hernan Zalazar Date: Wed, 14 Sep 2016 19:22:59 -0300 Subject: [PATCH] Release 2.0.0 --- .travis.yml | 8 ++++---- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ JWTDecode/Info.plist | 2 +- JWTDecodeTests/Info.plist | 2 +- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ca5e06..a8f0cee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,10 +15,10 @@ notifications: env: matrix: - SCHEME="JWTDecode-iOS" IOS_DESTINATION_VERSION="10.0" CARTHAGE_BUILD_PLATFORM="iOS" - - SCHEME="JWTDecode-iOS" IOS_DESTINATION_VERSION="9.3" CARTHAGE_BUILD_PLATFORM="iOS" - - SCHEME="JWTDecode-iOS" IOS_DESTINATION_VERSION="9.2" CARTHAGE_BUILD_PLATFORM="iOS" - - SCHEME="JWTDecode-iOS" IOS_DESTINATION_VERSION="9.1" CARTHAGE_BUILD_PLATFORM="iOS" - - SCHEME="JWTDecode-iOS" IOS_DESTINATION_VERSION="9.0" CARTHAGE_BUILD_PLATFORM="iOS" + # - SCHEME="JWTDecode-iOS" IOS_DESTINATION_VERSION="9.3" CARTHAGE_BUILD_PLATFORM="iOS" + # - SCHEME="JWTDecode-iOS" IOS_DESTINATION_VERSION="9.2" CARTHAGE_BUILD_PLATFORM="iOS" + # - SCHEME="JWTDecode-iOS" IOS_DESTINATION_VERSION="9.1" CARTHAGE_BUILD_PLATFORM="iOS" + # - SCHEME="JWTDecode-iOS" IOS_DESTINATION_VERSION="9.0" CARTHAGE_BUILD_PLATFORM="iOS" - SCHEME="JWTDecode-tvOS" CARTHAGE_BUILD_PLATFORM="tvOS" - SCHEME="JWTDecode-OSX" CARTHAGE_BUILD_PLATFORM="Mac" global: diff --git a/CHANGELOG.md b/CHANGELOG.md index 272afd1..87e6ecc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,40 @@ # Change Log +## [2.0.0](https://github.com/auth0/JWTDecode.swift/tree/2.0.0) (2016-09-14) + +[Full Changelog](https://github.com/auth0/JWTDecode.swift/compare/1.2.0...2.0.0) + +Support for Xcode 8 & Swift 3. + +Following Swift API Guidelines, all functions and methods requires a parameter label. + +So now to decode a token + +```swift +try JWTDecode.decode(jwt: "token") +``` + +Also now JWTDecode errors conforms the protocol LocalizableError + +``` +public enum DecodeError: LocalizedError { + case invalidBase64Url(String) + case invalidJSON(String) + case invalidPartCount(String, Int) + + public var localizedDescription: String { + switch self { + case .invalidJSON(let value): + return NSLocalizedString("Malformed jwt token, failed to parse JSON value from base64Url \(value)", comment: "Invalid JSON value inside base64Url") + case .invalidPartCount(let jwt, let parts): + return NSLocalizedString("Malformed jwt token \(jwt) has \(parts) parts when it should have 3 parts", comment: "Invalid amount of jwt parts") + case .invalidBase64Url(let value): + return NSLocalizedString("Malformed jwt token, failed to decode base64Url value \(value)", comment: "Invalid JWT token base64Url value") + } + } +} +``` + ## [1.2.0](https://github.com/auth0/JWTDecode.swift/tree/1.2.0) (2016-09-13) [Full Changelog](https://github.com/auth0/JWTDecode.swift/compare/1.1.0...1.2.0) diff --git a/JWTDecode/Info.plist b/JWTDecode/Info.plist index f061131..6e01bfb 100644 --- a/JWTDecode/Info.plist +++ b/JWTDecode/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.2.0 + 2.0.0 CFBundleSignature ???? CFBundleVersion diff --git a/JWTDecodeTests/Info.plist b/JWTDecodeTests/Info.plist index 631d44c..f931463 100644 --- a/JWTDecodeTests/Info.plist +++ b/JWTDecodeTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.2.0 + 2.0.0 CFBundleSignature ???? CFBundleVersion