From a169d9610d4ffa79ab5602143dc60240ae7a5874 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 8 Aug 2015 10:39:05 +0200 Subject: [PATCH] chore(serde): update to serde 0.5.0 Serde move all json code into a separate crate, which we are now pulling in separately. --- Cargo.toml | 5 +++-- changelog.md | 5 +++++ src/common.rs | 2 +- src/device.rs | 2 +- src/helper.rs | 2 +- src/lib.rs | 2 +- src/lib.rs.in | 1 + src/refresh.rs | 2 +- 8 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 305ea8484..64bfb76a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "yup-oauth2" -version = "0.5.0" +version = "0.5.1" authors = ["Sebastian Thiel "] repository = "https://github.com/Byron/yup-oauth2" description = "A partial oauth2 implementation, providing the 'device' authorization flow" @@ -18,7 +18,8 @@ mime = "*" url = "*" hyper = ">= 0.5.0" itertools = "*" -serde = "*" +serde = ">= 0.5.0" +serde_json = "*" serde_macros = { version = "*", optional = true } [features] diff --git a/changelog.md b/changelog.md index 83a0d7470..d9f2c3f2a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ + +## 0.5.1 (2015-08-08) + +* compatibility with serde 0.5.x + ## v0.5.0 (2015-06-18) diff --git a/src/common.rs b/src/common.rs index aacc62eac..c4a82c4e3 100644 --- a/src/common.rs +++ b/src/common.rs @@ -190,7 +190,7 @@ pub mod tests { #[test] fn console_secret() { - use serde::json; + use serde_json as json; match json::from_str::(SECRET) { Ok(s) => assert!(s.installed.is_some() && s.web.is_none()), Err(err) => panic!(err), diff --git a/src/device.rs b/src/device.rs index de602b2ce..b8d49dff3 100644 --- a/src/device.rs +++ b/src/device.rs @@ -7,7 +7,7 @@ use hyper; use hyper::header::ContentType; use url::form_urlencoded; use itertools::Itertools; -use serde::json; +use serde_json as json; use chrono::{DateTime,UTC}; use std::borrow::BorrowMut; use std::io::Read; diff --git a/src/helper.rs b/src/helper.rs index 31619c0f6..49f617f89 100644 --- a/src/helper.rs +++ b/src/helper.rs @@ -481,7 +481,7 @@ mod tests { #[test] fn flow() { - use serde::json; + use serde_json as json; let secret = json::from_str::(SECRET).unwrap().installed.unwrap(); let res = Authenticator::new(&secret, DefaultAuthenticatorDelegate, diff --git a/src/lib.rs b/src/lib.rs index 706972d2c..7e8f93fd5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,7 +20,7 @@ //! extern crate serde; //! //! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, PollInformation, ConsoleApplicationSecret, MemoryStorage, GetToken}; -//! use serde::json; +//! use serde_json as json; //! use std::default::Default; //! # const SECRET: &'static str = "{\"installed\":{\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_secret\":\"UqkDJd5RFwnHoiG5x5Rub8SI\",\"token_uri\":\"https://accounts.google.com/o/oauth2/token\",\"client_email\":\"\",\"redirect_uris\":[\"urn:ietf:wg:oauth:2.0:oob\",\"oob\"],\"client_x509_cert_url\":\"\",\"client_id\":\"14070749909-vgip2f1okm7bkvajhi9jugan6126io9v.apps.googleusercontent.com\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\"}}"; //! diff --git a/src/lib.rs.in b/src/lib.rs.in index babb64c57..d79840e53 100644 --- a/src/lib.rs.in +++ b/src/lib.rs.in @@ -1,4 +1,5 @@ extern crate serde; +extern crate serde_json; extern crate chrono; diff --git a/src/refresh.rs b/src/refresh.rs index 9c4dc6c84..179e7dc9e 100644 --- a/src/refresh.rs +++ b/src/refresh.rs @@ -4,7 +4,7 @@ use device::GOOGLE_TOKEN_URL; use chrono::UTC; use hyper; use hyper::header::ContentType; -use serde::json; +use serde_json as json; use url::form_urlencoded; use super::Token; use std::borrow::BorrowMut;