Skip to content

Commit

Permalink
Release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hzalaz committed Aug 17, 2016
1 parent b812203 commit 3a6eb66
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 5 deletions.
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Change Log

## [1.1.0](https://github.com/auth0/JWTDecode.swift/tree/1.1.0) (2016-08-17)

[Full Changelog](https://github.com/auth0/JWTDecode.swift/compare/1.0.0...1.1.0)

**Changed:**

- Rework how claims are decoded [\#35](https://github.com/auth0/JWTDecode.swift/pull/35) ([hzalaz](https://github.com/hzalaz)
- Add expired method to A0JWT [\#25](https://github.com/auth0/JWTDecode.swift/pull/25) ([wkoszek](https://github.com/wkoszek)
- Require only App Extension Safe API (in iOS) [\#20](https://github.com/auth0/JWTDecode.swift/pull/20) ([hzalaz](https://github.com/hzalaz)

**Added:**

- Swift 2.3 [\#34](https://github.com/auth0/JWTDecode.swift/pull/34) ([hzalaz](https://github.com/hzalaz)
- Return JWT string representation [\#19](https://github.com/auth0/JWTDecode.swift/pull/19) ([hzalaz](https://github.com/hzalaz)
- Add tvOS Support [\#33](https://github.com/auth0/JWTDecode.swift/pull/33) ([adolfo](https://github.com/adolfo)

**Deprecated:**

To provide a better experience while dealing with claims and converting their values to Swift types, we deprecated the following method to retrive JWT claims

```swift
public func claim<T>(name: String) -> T?
```

In favor of the following method to retrieve the claim

```swift
let claim = jwt.claim(name: "claim_name")
```

and then you can try converting it's value to the proper type like

```swift
if let email = claim.string {
print("JWT had email \(email)")
}
```

The supported conversions are:

```swift
var string: String?
var integer: Int?
var double: Double?
var date: NSDate?
var array: [String]?
```

## [1.0.0](https://github.com/auth0/JWTDecode.swift/tree/1.0.0) (2015-09-16)

[Full Changelog](https://github.com/auth0/JWTDecode.swift/compare/0.3.2...1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion JWTDecode/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>1.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion JWTDecodeTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>1.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ JWTDecode is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "JWTDecode", '~> 1.0'
pod "JWTDecode"
```

###Carthage
Expand Down Expand Up @@ -101,10 +101,23 @@ jwt.expiresAt
```

### Custom Claims
If we also have our custom claims we can retrive them calling `claim<T>(name: String) -> T?` where `T` is the value type of the claim, e.g.: a `String`
If we also have our custom claims we can retrive them calling `claim(name: String) -> Claim` then you can try converting the value like

```swift
let custom: String? = jwt.claim("email")
let claim = jwt.claim(name: "email")
if let email = claim.string {
print("Email in jwt was \(email)")
}
```

The supported conversions are:

```swift
var string: String?
var integer: Int?
var double: Double?
var date: NSDate?
var array: [String]?
```

### Error Handling
Expand Down

0 comments on commit 3a6eb66

Please sign in to comment.