Skip to content

Commit

Permalink
Bump to serde 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
durch committed Mar 12, 2018
1 parent 5216844 commit 78288d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "smpl_jwt"
version = "0.2.1"
version = "0.3.0"
authors = ["Drazen Urch <github@drazenur.ch>"]
description = "Very simple JWT generation lib."
repository = "https://github.com/durch/rust-jwt"
Expand All @@ -14,9 +14,9 @@ name = "smpl_jwt"
path = "src/lib.rs"

[dependencies]
serde = "0.9"
serde_derive = "0.9"
serde_json = "0.9"
serde = "^1.0"
serde_derive = "^1.0"
serde_json = "^1.0"
rustc-serialize = "0.3"
openssl = "^0.9"
time = "0.1.35"
Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ extern crate serde_derive;
extern crate serde_json;
extern crate openssl;
extern crate time;
#[macro_use]
extern crate log;

pub mod error;
Expand Down Expand Up @@ -169,7 +168,7 @@ impl<T> Jwt<T> where
let pkey = self.pkey.produce_key();
let mut signer = Signer::new(self.algo.signer(), pkey)?;
signer.update(self.input()?.as_bytes())?;
let signed: Vec<u8> = signer.finish()?;
let signed: Vec<u8> = signer.sign_to_vec()?;
Ok(signed.to_base64(URL_SAFE))
}

Expand All @@ -179,7 +178,7 @@ impl<T> Jwt<T> where

pub fn new(body: T, jwt_key: RSAKey, algo: Option<Algorithm>) -> Jwt<T> {
Jwt {
body: body,
body,
pkey: jwt_key,
algo: algo.unwrap_or(Algorithm::RS256)
}
Expand Down

0 comments on commit 78288d9

Please sign in to comment.